You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/actions.md
+8-9Lines changed: 8 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
# Actions
2
2
3
-
An action is the way a StateMachine can cause things to happen in the
3
+
Action is the way a StateMachine can cause things to happen in the
4
4
outside world, and indeed they are the main reason why they exist at all.
5
5
6
6
The main point of introducing a state machine is for the
7
7
actions to be invoked at the right times, depending on the sequence of events
8
8
and the state of the guards.
9
9
10
10
Actions are most commonly performed on entry or exit of a state, although
11
-
it is possible to add them before / after a transition.
11
+
it is possible to add them before/after a transition.
12
12
13
13
There are several action callbacks that you can define to interact with a
14
14
StateMachine in execution.
@@ -257,9 +257,9 @@ You can also declare an event while also adding a callback:
257
257
258
258
```
259
259
260
-
Note that with this syntax, the result`loop` that is present on the `ExampleStateMachine.loop`
260
+
Note that with this syntax, the resulting`loop` that is present on the `ExampleStateMachine.loop`
261
261
namespace is not a simple method, but an {ref}`event` trigger. So it only executes if the
262
-
StateMachine is on the right state.
262
+
StateMachine is in the right state.
263
263
264
264
So, you can use the event-oriented approach:
265
265
@@ -275,8 +275,7 @@ On loop
275
275
276
276
## Other callbacks
277
277
278
-
In addition to {ref}`actions`, you can specify {ref}`validators-and-guards` that are checked
279
-
before an transition is started. They are meant to stop a transition to occur.
278
+
In addition to {ref}`actions`, you can specify {ref}`validators and guards` that are checked before a transition is started. They are meant to stop a transition to occur.
280
279
281
280
```{seealso}
282
281
See {ref}`guards` and {ref}`validators`.
@@ -320,7 +319,7 @@ Actions and Guards will be executed in the following order:
320
319
321
320
python-statemachine implements a custom dispatch mechanism on all those available Actions and
322
321
Guards, this means that you can declare an arbitrary number of `*args` and `**kwargs`, and the
323
-
library will match your method signature of what's expect to receive with the provided arguments.
322
+
library will match your method signature of what's expected to receive with the provided arguments.
324
323
325
324
This means that if on your `on_enter_<state.id>()` or `on_execute_<event>()` method, you need to know
326
325
the `source` ({ref}`state`), or the `event` ({ref}`event`), or access a keyword
@@ -346,10 +345,10 @@ For your convenience, all these parameters are available for you on any Action o
346
345
: The {ref}`Event` that was triggered.
347
346
348
347
`source`
349
-
: The {ref}`State` the statemachine was when the {ref}`Event` started.
348
+
: The {ref}`State` the state machine was when the {ref}`Event` started.
0 commit comments