commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Armel SORO <armel.soro.sc...@gmail.com>
Subject [SCXML] Parent and child engines
Date Fri, 06 Mar 2009 10:11:01 GMT
Hi,

Since I am new to SCXML, I have some questions to ask:
First, is it possible to automatically trigger an event from a derived
engine to a main engine?
Secondly, how can we handle "unexpected" events (events not taken into
account) in a given state machine?

Any answer to the questions above would be appreciated to deal with the
following case:
I have a main engine that is responsible for managing a given SCXML
document. A new engine is instantiated each time an external activity is
invoked in this document.
For example, the main SCXML document looks like this:

<scxml ...>
   <state id="test1">
       <invoke src="SRC" targettype="scxml">
          <param name="param1" expr="'value1'"/>
       </invoke>
       <transition event="SRC.invoke.done" target="test2"/>
   </state>
   <state id="test2">
      ...
   </state>
   . ..
</scxml>

So, invoking the external activity "SRC" causes the main engine to
instantiate and launch a derived engine that has the state machine below:

<scxml ...>
  <state id="invokedActivity"/>
     <invoke src="WebSRC" targettype="web">
       <param name="textToDisplay" expr="param1"/>
    </invoke>
   <transition event="WebSRC.invoke.done" target="invocationDone"/>
 </state>

 <final id="invocationDone">
   <event name="SRC.invoke.done"/>
 </finale>
...
</scxml>

What I want is that once this derived engine is triggered the event
"WebSRC.invoke.done", it raises the event "SRC.invoke.done" to the main
engine. I also want the derived engine to forward "unexpected" events to its
parent engine.

Thanks in advance for ideas!


-- 
Armel SORO

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message