commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mike shugar <>
Subject [SCXML] - Events, Payload, DataModel - seeking simple working example
Date Tue, 25 Sep 2012 02:53:04 GMT
Hi SCXML users, this is my first post.

I have been learning commons SCXML over the last month or so, and have made
good progress with my own modified AbstractStateMachine, but I am now stuck.

I am trying to develop a stand alone Java application that uses SCXML for
state orchestration, and external classes to perform steps.

The pattern I want is to have:
1. SCXML transitions into a state,
2. SCXML calls out to an external class (OnEntry) to perform a step, passing
DataModel Data as input to the external class
3. the external class asynchronously performs the step based on the passed
4. the external class modifies the passed Data based on the performance of
the step
5. the external class passes an event (TriggerEvents) to SCXML with updated
Data to be made available in the State Machine for future steps.

I am successful up to step 4. But I have been unable to get the updated Data
to be absorbed into the AbstractStateMachine. I am working stand alone and
would like to avoid JEXL and EL.

Can anyone provide a working example of DataModel Data being updated in a

I have tried to TriggerEvent with a payload, but could not figure out how to
make that payload stick to a state's Datamodel. This is my preferred way of
passing Data into the Statemachine if I can get it working, but I want to
avoid JEXL/EL.

I also tried the following code to force an update to the DataModel.  It
does not throw an exception, but the Data Model is not updated.

private void updateInfo() {
 String str = "";
 Map children =
 State state = ((State) children.get("myStateWithADataModel"));
    Datamodel dm = state.getDatamodel();

 Data newData = new Data();
 myXMLNode.getFirstChild().setTextContent("Did I succeed in changing
Datamodel by XML Node content?  Sorry no.");

Thanks in advance for any help or examples.


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

View raw message