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: README.md
+23-6
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,7 @@ Trigger parameters can be used to dynamically select the destination state using
144
144
145
145
### Ignored Transitions and Reentrant States
146
146
147
-
Firing a trigger that does not have an allowed transition associated with it will cause an exception to be thrown.
147
+
In Stateless, firing a trigger that does not have an allowed transition associated with it will cause an exception to be thrown. This ensures that all transitions are explicitly defined, preventing unintended state changes.
148
148
149
149
To ignore triggers within certain states, use the `Ignore(TTrigger)` directive:
Alternatively, a state can be marked reentrant so its entry and exit actions will fire even when transitioning from/to itself:
156
+
Alternatively, a state can be marked reentrant. A reentrant state is one that can transition back into itself. In such cases, the state's exit and entry actions will be executed, providing a way to handle events that require the state to reset or reinitialize.
157
157
158
158
```csharp
159
159
stateMachine.Configure(State.Assigned)
@@ -167,6 +167,23 @@ By default, triggers must be ignored explicitly. To override Stateless's default
When a dynamic transition results in the same state as the current state, it effectively becomes a reentrant transition, causing the state's exit and entry actions to execute. This can be useful for scenarios where the state needs to refresh or reset based on certain triggers.
This event will be invoked at the very end of the trigger handling, after the last entry action has been executed.
203
+
This event will be invoked at the very end of the trigger handling, after the last entry action has been executed.
187
204
188
205
### Export to DOT graph
189
206
@@ -207,9 +224,9 @@ digraph {
207
224
This can then be rendered by tools that support the DOT graph language, such as the [dot command line tool](http://www.graphviz.org/doc/info/command.html) from [graphviz.org](http://www.graphviz.org) or [viz.js](https://github.com/mdaines/viz.js). See http://www.webgraphviz.com for instant gratification.
208
225
Command line example: `dot -T pdf -o phoneCall.pdf phoneCall.dot` to generate a PDF file.
209
226
210
-
### Export to mermaid graph
227
+
### Export to Mermaid graph
211
228
212
-
It can be useful to visualize state machines on runtime. With this approach the code is the authoritative source and state diagrams are by-products which are always up to date.
229
+
Mermaid graphs can also be generated from state machines.
213
230
214
231
```csharp
215
232
phoneCall.Configure(State.OffHook)
@@ -226,7 +243,7 @@ stateDiagram-v2
226
243
OffHook --> Ringing : CallDialled
227
244
```
228
245
229
-
This can then be rendered by GitHub or [Obsidian](https://github.com/obsidianmd)
246
+
This can be rendered by GitHub markdown or an engine such as [Obsidian](https://github.com/obsidianmd).
0 commit comments