Generally, decision-state
is used exclusively for a boolean conditional. It's more clear and concise as to what it occurs.
For instance,
<decision-state id="myDecisionState">
<if test="myBooleanFunction()" then="resultIsTrueState" else="resultIsFalseState" />
</decision-state>
This can be replicated using an action-state
like so:
<action-state id="myActionState">
<evaluate expression="myBooleanFunction()" />
<transition on="yes" to="resultIsTrueState" />
<transition on="no" to="resultIsFalseState" />
</action-state>
However, the difference is that action-state
does not just operate on booleans - it can trigger transitions on String (string value)
, Boolean (yes/no)
, Enum (enum name)
with any other result considered a success
.
So, by contrast to a decision-state
which actually has to decide something, an action-state
can simply be used to execute some code.
<action-state id="myActionState">
<evaluate expression="myFunction()" />
<transition on="success" to="myNextState" />
</action-state>
I hope that clears stuff up.