fmorbini / scxmlgui

A graphical user interface for editing SCXML finite state machines.
Other
105 stars 37 forks source link

Multiple targets are not allowed #14

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
According to the SCXML standard:

3.4: parallel nodes may have transitions.
3.3: transitions may have multiple targets.

NullPointerException on the following example (if the three transitions in the 
parallel state are removed the exception disappears):

<?xml version="1.0" encoding="UTF-8"?>
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" name="Fan3" 
initial="All">
    <parallel id="All">
        <transition event="SwitchBothOff" target="OffLeft OffRight"/>
        <transition event="SwitchLeftOn" target="OnLeft"/>
        <transition event="SwitchRightOn" target="OnRight"/>
        <state id="FanLeft" initial="OffLeft">
            <state id="OffLeft">
                <onentry>
                    <log expr="'OnEntry OffLeft'"/>
                </onentry>
                <transition event="SwitchLeft" target="OnLeft"/>
                <onexit>
                    <log expr="'OnExit OffLeft'"/>
                </onexit>
            </state>
            <state id="OnLeft">
                <onentry>
                    <log expr="'OnEntry OnLeft'"/>
                </onentry>
                <transition event="SwitchLeft" target="OffLeft"/>
                <onexit>
                    <log expr="'OnExit OnLeft'"/>
                </onexit>
            </state>
        </state>
        <state id="FanRight" initial="OffRight">
            <state id="OffRight">
                <onentry>
                    <log expr="'OnEntry OffRight'"/>
                </onentry>
                <transition event="SwitchRight" target="OnRight"/>
                <onexit>
                    <log expr="'OnExit OffRight'"/>
                </onexit>
            </state>
            <state id="OnRight">
                <onentry>
                    <log expr="'OnEntry OnRight'"/>
                </onentry>
                <transition event="SwitchRight" target="OffRight"/>
                <onexit>
                    <log expr="'OnExit OnRight'"/>
                </onexit>
            </state>
        </state>
    </parallel>
</scxml>

Original issue reported on code.google.com by azra...@gmail.com on 5 Sep 2010 at 9:41

GoogleCodeExporter commented 9 years ago

Original comment by fmorbini on 6 Sep 2010 at 7:05

GoogleCodeExporter commented 9 years ago
with the latest revision (71) the file above can be read properly. I still need 
to update all write operations to handle multiple targets.

Original comment by fmorbini on 18 Sep 2010 at 12:01

GoogleCodeExporter commented 9 years ago
revision 79 adds support for edges with multiple target.

to ass a new target to an existing edge press CTRL and drag the target of the 
existing edge to the node you want to add as additional target for that edge.

Original comment by fmorbini on 8 Oct 2010 at 6:22