commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabrizio Morbini <fmorb...@gmail.com>
Subject [scxml] templates
Date Mon, 21 Jun 2010 16:45:42 GMT
Hi, i would appreciate if somebody could clarify the working of
templates as exemplified here:

http://wiki.apache.org/commons/SCXML/Tutorials/Templating

i tried the following scenario:

===============file a.scxml:
<scxml id="SCXML" initial="start" xmlns="http://www.w3.org/2005/07/scxml">
 <state id="start">
  <transition event="start1" target="aa"></transition>
  <transition event="start2" target="aa"></transition>
 </state>
 <state id="aa" src="b.scxml#aa">
  <onentry></onentry>
  <onexit></onexit>
  <transition event="aa.done" target="end1"></transition>
 </state>
 <state id="aa" src="b.scxml#aa">
  <onentry></onentry>
  <onexit></onexit>
  <transition event="aa.done" target="end2"></transition>
 </state>
 <final id="end2"></final>
 <final id="end1"></final>
</scxml>

===============file b.scxml:
<scxml id="SCXML" xmlns="http://www.w3.org/2005/07/scxml">
 <state id="aa" initial="aa1">
  <final id="aa2"></final>
  <state id="aa1">
   <transition target="aa2"></transition>
  </state>
 </state>
</scxml>

When i load a.scxml in the executor, i get no errors or warnings.
However, the execution ends always with state "end2" no matter if i
send the event "start1" or the event "start2".
This suggests that nodes cannot use the same name, even though the
templating example seems to suggest that the same subnetwork can be
used in multiple locations without renaming the nodes.

if i rename the two nodes "aa" in a.scxml with "node1" and "node2" the
parsing of the file a.scxml fails with error:
ERROR 09:26:47.853 [main           ] [ModelUpdater             ]
Initial state null or not a descendant of state with ID "node1"

this suggests that, the naming of the node with the src attribute
influences how the content from the src url  is added to it. So i
changed the type of "node1" and "node2" to parallel and that solves
the parsing problem but doesn't produce the expected behavior:

sending the event "start2" i obtain the following execution trace:

DEBUG 09:33:57.749 [main           ] [sax                      ] endDocument()
DEBUG 09:33:57.758 [Thread-1       ] [Context                  ]
_eventdata = null
DEBUG 09:33:57.758 [Thread-1       ] [Context                  ]
_eventdatamap = {start.entry=null}
DEBUG 09:33:57.758 [Thread-1       ] [Context                  ]
_eventdata = null
DEBUG 09:33:57.758 [Thread-1       ] [Context                  ]
_eventdatamap = {start.entry=null}
DEBUG 09:33:57.758 [Thread-1       ] [SCXMLExecutor            ]
Current States: [start]
DEBUG 09:33:57.758 [main           ] [Context                  ]
_eventdata = null
DEBUG 09:33:57.758 [main           ] [Context                  ]
_eventdatamap = {start2=null}
DEBUG 09:33:57.759 [main           ] [Context                  ]
_eventdata = null
DEBUG 09:33:57.759 [main           ] [Context                  ]
_eventdatamap = {start.exit=null, node2.entry=null}
DEBUG 09:33:57.759 [main           ] [Context                  ]
_eventdata = null
DEBUG 09:33:57.759 [main           ] [Context                  ]
_eventdatamap = {start.entry=null}
DEBUG 09:33:57.759 [main           ] [SCXMLExecutor            ]
Current States: []

it seems that the content of node2 is never executed and end2 is not reached.

thanks,
fabrizio.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message