You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Rostand <gu...@hotmail.com> on 2008/12/10 13:45:41 UTC

how to parse and serialize a string located in a transition

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

-- 
View this message in context: http://www.nabble.com/how-to-parse-and-serialize-a-string--located-in-a-transition-tp20934640p20934640.html
Sent from the Commons - User mailing list archive at Nabble.com.


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


Re: [SCXML] how to parse and serialize a string located in a transition

Posted by Rahul Akolkar <ra...@gmail.com>.
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 <gu...@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