assertEquals("4", element.element("id").getTextTrim() );
assertEquals("aloha", element.element("greeting").getTextTrim() );
}
public void testWriteReferenceAction() throws Exception {
ProcessDefinition processDefinition = new ProcessDefinition();
// add a global action with name 'pina colada'
Delegation instantiatableDelegate = new Delegation();
instantiatableDelegate.setClassName("com.foo.Fighting");
instantiatableDelegate.setConfigType("bean");
instantiatableDelegate.setConfiguration("<id>4</id><greeting>aloha</greeting>");
Action action = new Action();
action.setName("pina colada");
action.setActionDelegation(instantiatableDelegate);
processDefinition.addAction(action);
// now create a reference to it from event node-enter on state 'a'
State state = (State) processDefinition.addNode( new State() );
Action refAction = new Action();
refAction.setReferencedAction(action);
state.addEvent(new Event(Event.EVENTTYPE_NODE_ENTER)).addAction(refAction);
AbstractXmlTestCase.toXmlAndParse( processDefinition, "/process-definition/state[1]/event[1]/action[1]" );