On Mon, Oct 3, 2011 at 9:17 AM, Daniel Luis dos Santos
<[email protected]> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to