Skip to content

Instantly share code, notes, and snippets.

@jbeard4
Last active April 13, 2018 01:24
Show Gist options
  • Save jbeard4/4459506 to your computer and use it in GitHub Desktop.
Save jbeard4/4459506 to your computer and use it in GitHub Desktop.
To emulate a "join" transition in SCXML, you can use a single "default transition" (a transition without a trigger) originating from the parallel state, and use a cond attribute with "In()" predicates for each parallel substate you wish you join. You can find the definition of a join transition in the following paper: http://citeseerx.ist.psu.ed…
<scxml>
<parallel id="P">
<state id="A">
<state id="A-start">
<transition target="A-done" event="t"/>
</state>
<state id="A-done"/>
</state>
<state id="B">
<state id="B-start">
<transition target="B-done" event="t"/>
</state>
<state id="B-done"/>
</state>
<transition target="done" cond="In('A-done') &amp;&amp; In('B-done')"/>
</parallel>
<state id="done"/>
</scxml>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment