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] Calling methods through scxml
Date Sat, 31 Jul 2010 15:43:28 GMT
On Fri, Jul 30, 2010 at 8:57 PM, Fabrizio Morbini <fmorbini@gmail.com> wrote:
> other two alternatives may be:
> 1) use the expr attribute of the log element.
> 2) create a custom action, e.g. "eval" that does just what you are asking.
>
<snip/>

More about custom actions here:

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

-Rahul


> On Fri, Jul 30, 2010 at 15:08, Christopher Dragert
> <chris.dragert@mail.mcgill.ca> wrote:
>> Hello,
>>
>> I'm trying to find an elegant way to call a method from an object using scxml.  I
start by placing my object ("foo") in the context, then starting execution.  My goal would
be to have something like:
>>
>> <onentry>
>>     <expr="foo.bar()/>
>> </onentry>
>>
>> but this does not work since expr is not a tag.  Instead, the best method I've found
is to create a dummy variable in my data model and then fake assignments to it:
>>
>> <datamodel>
>>     <data id="scratch" />
>> </datamodel>
>>
>> <state id="hello" final="true">
>>     <onentry>
>>         <assign location="scratch" expr="foo.bar()/>
>>     </onentry>
>> </state>
>>
>> While this works, it seems unneccesary and contrived.  Is there a more elegant way
to do this?
>>
>> Thanks,
>> Chris Dragert

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


Mime
View raw message