commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabrizio Morbini <>
Subject [scxml] templating/src/xinclude and returning a value(through datamodel/donedata)
Date Thu, 06 May 2010 15:34:11 GMT
Hi, i'm experimenting with the src attribute to reuse fsm. I'm having
some trouble with returning a value from an included fsm to the
calling state.

I'm using this description at, in particular
the section about subdialogs from which it seems possible to return a
value from an included scxml fsm.
However i have been unable to do so. I've tried several variants but
none with the expected outcome. Here is the current variant:

=============file a.scxml=====================================
<?xml version="1.0"?>
<scxml xmlns=""

  <!--  trivial 5 second microwave oven example -->
  <!--  see for
different way to access the datamodel -->
    <data id="cook_time" expr="10"/>

  <state id="s1">
    <!-- off state -->
    <transition target="s2"/>

  <state id="s2" src="b.scxml#s111">

    <!-- on/pause state -->

    <transition event="s2.done" cond="aaa eq 's3'" target="s3"/>
    <transition event="s2.done" cond="aaa eq 's4'" target="s4"/>
    <transition event="s2.done" target="s5"/>


    <final id="s3"/>
    <final id="s4"/>
    <final id="s5"/>
=============end of file a.scxml==============================

=============file b.scxml=====================================
<?xml version="1.0" encoding="us-ascii"?>
<scxml version="1.0" xmlns=""
xmlns:cs="" initial="s111">
	<state id="s111">
	<initial><transition target="s11"/></initial>
  	<datamodel><data id="aaa"/></datamodel>

    <state id="s11">
		<transition target="s12">
				<!--<cs:var name="aaa" expr="'s3'" />-->
				<assign location="aaa" expr="'s3'"/>

	<final id="s12">
=============end of file b.scxml==============================

i tried to use also <var> instead of a previously defined variable in
the datamodel, without success.

the simple way would be to use the donedata in a final state in the
included fsm but it doesn't seem that donedata is supported, is this

given that src is not going to be supported in the next standard, do
you have some pointer to examples/doc of how to use xinclude to do
what the src is supposed to do?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message