GithubHelp home page GithubHelp logo

Comments (8)

galhyt avatar galhyt commented on June 22, 2024 1

Hi @fgmacedo,

But does it calling on_transition (on_event) function as it used to in 0.9.0?

from python-statemachine.

galhyt avatar galhyt commented on June 22, 2024 1

Ok, I managed with this problem.
I had a decorator to each event's method so I just removed it and moved the logic else where.

from python-statemachine.

fgmacedo avatar fgmacedo commented on June 22, 2024

Hi @galhyt , it should work the same.

The main difference is that I've made explicit the difference between Event and Transition. An event is the name of the trigger bound to one or more transitions, and transition is any arc that connect two states.

Taking your example:

transition = source.to(target)
  • transition is the event name.
  • source.to(target) is the transition.

If your system is more event-oriented, you can use the sm.send(<event_name>):

sm.send("transition")

Or if you want to call the event in an imperative-style programming, you can still call the event as a method:

sm.transition()

Please see https://python-statemachine.readthedocs.io/en/latest/transitions.html for a more complete explanation.

Best regards!

from python-statemachine.

fgmacedo avatar fgmacedo commented on June 22, 2024

Yes. Are you getting an error? Or an action not being called?

from python-statemachine.

galhyt avatar galhyt commented on June 22, 2024

The function on_transition is not being called

from python-statemachine.

fgmacedo avatar fgmacedo commented on June 22, 2024

The function on_transition is not being called

Can you please copy-paste or write a complete example that reproduces the error that I can run locally?

We have automated tests to test this callback, so maybe is something easy like a typo that a fresh look on the code can spot.

from python-statemachine.

galhyt avatar galhyt commented on June 22, 2024

Ok I will,
Tnx

from python-statemachine.

fgmacedo avatar fgmacedo commented on June 22, 2024

Nice! Closing the issue. Feel free to reach out any time.

Best!

from python-statemachine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.