[jboss-user] [JBoss jBPM] - Re: Re: task in start state

kukeltje do-not-reply at jboss.com
Wed Jan 16 13:13:38 EST 2008


jbpm contains many unittests. If you look at the test (code below for convenience) you'll quickly see the difference


  | package org.jbpm.taskmgmt.exe;
  | 
  | import org.jbpm.graph.def.ProcessDefinition;
  | import org.jbpm.graph.exe.ProcessInstance;
  | 
  | import junit.framework.TestCase;
  | 
  | public class StartTaskTest extends TestCase {
  | 
  |   public void testStartTaskPresent() {
  |     ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
  |       "<process-definition>" +
  |       "  <start-state>" +
  |       "    <task name='lets get it started' />" +
  |       "    <transition to='going steady' />" +
  |       "  </start-state>" +
  |       "  <state name='going steady' />" +
  |       "</process-definition>"
  |     );
  |     
  |     ProcessInstance processInstance = new ProcessInstance(processDefinition);
  |     
  |     TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();
  |     assertNotNull(taskInstance);
  |     assertEquals("lets get it started", taskInstance.getName());
  |     taskInstance.end();
  |     
  |     assertEquals("going steady", processInstance.getRootToken().getNode().getName());
  |   }
  | 
  |   public void testStartTaskAbsent() {
  |     ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
  |       "<process-definition>" +
  |       "  <start-state>" +
  |       "    <transition to='going steady' />" +
  |       "  </start-state>" +
  |       "  <state name='going steady' />" +
  |       "</process-definition>"
  |     );
  |     
  |     ProcessInstance processInstance = new ProcessInstance(processDefinition);
  |     
  |     TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();
  |     assertNull(taskInstance);
  |   }
  | 
  | }
  | 

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

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



More information about the jboss-user mailing list