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] invoking methods on an object
Date Mon, 03 Oct 2011 22:55:26 GMT
On Mon, Oct 3, 2011 at 9:17 AM, Daniel Luis dos Santos
<daniel.dlds@gmail.com> wrote:
> Hello,
>
> I am beggining to use commons-SCXML. For now I created a generic class that wraps the
library's code just like the class AbstractStateMachine in the stopwatch example.
>
> Each class from my application that will be governed by a state machine has an instance
of this, and has methods to trigger events on it.
<snip/>

Note that the AbstractStateMachine pattern is a starter pattern and is
limited if used in isolation. More patterns here:

  http://commons.apache.org/scxml/guide/using-commons-scxml.html


> What I want to do is have methods from the object be called from state machine events.
For example, when I enter a state I want to be able to call a method on the stateful object.
>
> I am trying to use invoke inside <onentry> but the markup is ignored. How can I
do this ?
>
<snap/>

If you're talking about the <invoke> element, that is not an action
(its a child of state not onentry) and requires Invoker
implementations to be registered with the executor for each "type" of
invoke.

If you want to call arbitrary Java methods within <onentry>, best to
write a custom action for that. More on that here:

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

-Rahul


> I am using version 0.9 from maven central.
>
> Thanks
> Daniel Santos
>

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


Mime
View raw message