Element <transition>¶
Purpose: Connect one state to another with an optional positive selection weight.
Why: Use it inside a state machine to define one allowed next-state edge and its weight.
Example¶
1 | |
Decision guide¶
Business value: Makes one allowed lifecycle edge and its relative likelihood reviewable.
-
Use when
- A state-machine permits a transition from one named state to another.
-
Choose another approach when
- Defining an independent value or using it outside a state-machine.
-
Prerequisites
- Place it inside state-machine and reference valid state names.
Complete examples¶
Generate a deterministic order lifecycle from a transition graph
Use a state machine when values must follow allowed business transitions instead of independent random selection.
| order-lifecycle/datamimic.xml | |
|---|---|
1 2 3 4 5 6 7 8 9 10 11 | |
Rules and invalid combinations¶
I919 โ State Machine Transition Unknown Attribute
Why: A
Resolution: Remove the unexpected attribute(s) or correct the spelling.
I920 โ State Machine Transition Missing From/To
Why: A
Resolution: Provide both 'from' and 'to' on every
I921 โ State Machine Transition Weight Not Numeric
Why: A
Resolution: Use a numeric weight, e.g. weight="0.9".
I922 โ State Machine Transition Weight Not Positive
Why: A
Resolution: Use a strictly positive weight (or omit weight= for the default of 1.0).
Allowed parents / Allowed children¶
Allowed parents: else, else-if, if, state-machine, while
Allowed children:
None
Attributes¶
Show all 3 attributes
from
State from which this directed transition starts.
required; string.
to
State reached when this transition is selected.
required; string.
weight
Positive relative probability among transitions with the same from state.
optional; number; Default: 1.0.