Comments (8)
Hi @fgmacedo,
But does it calling on_transition (on_event) function as it used to in 0.9.0?
from python-statemachine.
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.
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.
Yes. Are you getting an error? Or an action not being called?
from python-statemachine.
The function on_transition is not being called
from python-statemachine.
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.
Ok I will,
Tnx
from python-statemachine.
Nice! Closing the issue. Feel free to reach out any time.
Best!
from python-statemachine.
Related Issues (20)
- Validators need to return `bool` HOT 4
- Supporting abstract classes
- Add easy way to chain transitions HOT 7
- Question: how to save state to disk HOT 5
- Example throws type error on __init__() HOT 5
- About contributing HOT 2
- #365: No longer invoking transition callbacks breaks things HOT 4
- SignatureAdapter wrap HOT 4
- A small question about docs of `Actions` HOT 4
- Consider returning all values from actions for a triggered transition HOT 18
- Is there a way to make a transition from two or more states to one state instead of writing one by one? HOT 2
- Initialising multiple states by assigning them HOT 1
- Problem with pip when installing under Python 3.10.11 HOT 2
- Multiple Observers not working on singular State machine HOT 4
- Event keyword arguments are silently overwritten when particular keyword argument names are used HOT 4
- Finalize action after transition success or failure. HOT 1
- feature request: async callbacks HOT 3
- Incompatible with spy wrapper from pytest-mock HOT 3
- Add automation (GH action) to publish a new version on pypi HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-statemachine.