[jboss-user] [JBoss jBPM] - Re: Examples

jplenhart do-not-reply at jboss.com
Wed Aug 22 12:30:18 EDT 2007


Hi Ronald,

First off thank you for the reply --- been having a bad week in the world of JBoss:-)

All I am trying to get going is the most basic example, here is a method from the 'action' example.


  | public void testTransitionAction() {
  |     // The next process is a variant of the hello world process.
  |     // We have added an action on the transition from state s 
  |     // to the end-state.  The purpose of this test is to show 
  |     // how easy it is to integrate java code in a jBPM process.
  |     ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
  |       "<process-definition>" +
  |       "  <start-state>" +
  |       "    <transition to='s' />" +
  |       "  </start-state>" +
  |       "  <state name='s'>" +
  |       "    <transition to='end'>" +
  |       "      <action class='org.jbpm.tutorial.action.MyActionHandler' />" +
  |       "    </transition>" +
  |       "  </state>" +
  |       "  <end-state name='end' />" +
  |       "</process-definition>"
  |     );
  |     
  |     // Let's start a new execution for the process definition.
  |     ProcessInstance processInstance = 
  |       new ProcessInstance(processDefinition);
  |     
  |     // The next signal will cause the execution to leave the start 
  |     // state and enter the state 's'
  |     processInstance.signal();
  | 
  |     // Here we show that MyActionHandler was not yet executed. 
  |     assertFalse(MyActionHandler.isExecuted);
  |     // ... and that the the main path of execution is positioned in 
  |     // the state 's'
  |     assertSame(processDefinition.getNode("s"), 
  |                processInstance.getRootToken().getNode());
  |     
  |     // The next signal will trigger the execution of the root 
  |     // token.  The token will take the transition with the
  |     // action and the action will be executed during the  
  |     // call to the signal method.
  |     processInstance.signal();
  |     
  |     // Here we can see that MyActionHandler was executed during 
  |     // the call to the signal method.
  |     assertTrue(MyActionHandler.isExecuted);
  |   }
  | 

The process definition is hardcoded - I have all the jars in my build path.

I do not see an ant build file associated with this sample either so I am just trying to use the JUnit plugin from eclipse.

Thanks,

Jason

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4076968#4076968

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4076968



More information about the jboss-user mailing list