Background:  I have several states that need to call the same external substate 
machine.  Once the substate machine has finished I need it to return to the 
calling state.

Question:  How can I get the substate machine to return to the calling state 
without explicitly naming the calling state in the transition?

I have found bits and pieces in the archives and online but no good examples or 
full explanations.
Any pointers to online documentation for this would also be helpful.  Thanks.

Code:
I would like to return from the password.xml substate to the calling state 
(SaveButton, ReloadButton, etc).  The tag <transition event="e_Done"        
target="* Back to Calling State* " /> specifies a specific state However, that 
state depends on the calling state.  How do I get it to return to the calling 
state automatically?

<state id="SaveButton" src="Password.xml" >
        <transition event="e_Done"        target="SteadyState" />
    </state>
<state id="ReloadButton" src="Password.xml" >
        <transition event="e_Done"        target="SteadyState" />
    </state>


Password.xml
<scxml xmlns="http://www.w3.org/2005/07/scxml";
       xmlns:my="http://www.ttt.com"; version="1.0" initialstate="PasswordCheck">
    <state id="PasswordCheck" >
        <onentry>
            <my:StateLog/>
            <my:PasswordCheck/>
        </onentry>
        <transition event="e_Done"        target="SteadyState" />
        <transition event="e_validate"        target="PasswordValid" />
        <transition event="e_allow"        target="ControlGranted" />
    </state>
    <state id="PasswordValid" >
        <onentry>
            <my:StateLog/>
            <my:PasswordValid/>
        </onentry>
        <transition event="e_allow"        target="ControlGranted" />
        <transition event="e_Done"        target=" SteadyState " />
    </state>
    <state id="ControlGranted" >
        <onentry>
            <my:StateLog/>
            <my:ControlGranted/>
        </onentry>
        <transition event="e_Done"        target="* Back to Calling State* " />
    </state>
</scxml>


--
Landon Ouyang
Senior Design Engineer
ITT Electronics Systems, Radar Systems - Gilfillan
7821 Orion Ave,
Van Nuys, CA 91406
(818) 901-2982


________________________________
This e-mail and any files transmitted with it may be proprietary and are 
intended solely for the use of the individual or entity to whom they are 
addressed. If you have received this e-mail in error please notify the sender.
Please note that any views or opinions presented in this e-mail are solely 
those of the author and do not necessarily represent those of ITT Corporation. 
The recipient should check this e-mail and any attachments for the presence of 
viruses. ITT accepts no liability for any damage caused by any virus 
transmitted by this e-mail.

Reply via email to