commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rahul Akolkar" <rahul.akol...@gmail.com>
Subject Re: [SCXML] how to parse and serialize a string located in a transition
Date Wed, 10 Dec 2008 19:43:12 GMT
Since this is a shared mailing list, please prefix your email subject
with the correct Commons component such as the [SCXML] prefix I have
added to this message.

To your question below ...

On Wed, Dec 10, 2008 at 7:45 AM, Rostand <guyso10@hotmail.com> wrote:
>
> ich want to add a String in a transition of my statemachine and write it out
> too in a document after serialize the code.
>  e.g:
> <transition target="move" event="waitingForMove">
> cond(received(Div_tpMsID, Div_DriverID, div_ID, '*', 'done[]'));
> writeLog('INFO', '; device; Finished');
> </transition>
>
> the String i want to add is :
> cond(received(Div_tpMsID, Div_DriverID, div_ID, '*', 'done[]'));
> writeLog('INFO', '; device; Finished'));
>
> can anyone tell me how i should do this?
>
> thanks
>
<snip/>

Body content isn't really permissible in <transition> so the parser
just ignores it. <transition> can have executable content (as child
elements), which is a sequence of standard and/or custom actions. You
can learn more about using custom actions in the user guide here:

  http://commons.apache.org/scxml/guide/custom-actions.html

In other words, its possible to do this instead:

  <transition target="move" event="waitingForMove">
    <my:action>
      cond(received(Div_tpMsID, Div_DriverID, div_ID, '*', 'done[]'));
      writeLog('INFO', '; device; Finished');
    </my:action>
  </transition>

where <my:action> would then be parsed and serialized as expected (and
furthermore, you would be able to associate execution behavior with
the action -- this would happen when the transition is followed, based
on your requirements since you'd implement the custom action).

-Rahul

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


Mime
View raw message