commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guofeng Zhang" <>
Subject [SCXML]Event Payloads can is not accessible when the event is triggered in a custom action
Date Sat, 01 Mar 2008 04:47:56 GMT
I practice the Hello custom action. The following is the document. I found that _eventdata
is always null ( or empty). When I use the log action to display it on an entry, its value
is also displyed as null. 

it works well when the event is triggered by engine.triggerEvent().  I do not make any change
to the Hello class.
<scxml xmlns=""

     <state id="init">
            <my:hello name="finished" />
        <transition event="helloevent"
                        cond="empty _eventdata" target="empty" />
         <transition event="helloevent"
                        cond="_eventdata eq 'finished'" target="finished" />
         <transition event="helloevent" target="tostop" />

the following is part of the java code:
   // (1) Create a list of custom actions, add as many as are needed
       List<CustomAction> customActions = new ArrayList<CustomAction>();
       CustomAction ca =
             new CustomAction("http://my.custom-actions.domain/CUSTOM",
                              "hello", Hello.class);
       // (2) Parse the SCXML document containing the custom action(s)
       SCXML stateMachine = null;
       try {
        URL url = HelloWorld.class.getClassLoader().getResource("custom-hello-world-01.xml")
        ErrorHandler errorHandler = new SimpleErrorHandler();
        stateMachine = SCXMLParser.parse(url, errorHandler, customActions);
       } catch (Exception e) {
           // bad document, take necessary action
       final SCXMLExecutor engine = new SCXMLExecutor( new JexlEvaluator(), new SimpleDispatcher(),
                 new SimpleErrorReporter());
       engine.setStateMachine( stateMachine );
       engine.setRootContext( new JexlContext() );
       engine.addListener(stateMachine, new EntryListener() );
       try {
       } catch (ModelException me) {
       //waiting in another thread.

What's is wrong with my document? I use commons-scxml-0.7.
Thanks for your help.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message