[jboss-user] [JBoss jBPM] - Re: Error in node-->TaskNode

kukeltje do-not-reply at jboss.com
Sat Aug 12 09:31:37 EDT 2006


ok, out of curiosity, I made a unit test out of it and cannot reproduce your problem. 

The following testcase works with both jbpm 3.1 and cvs-head

package my.tests.jbpm;
  | 
  | import org.jbpm.graph.def.Node;
  | import org.jbpm.graph.def.ProcessDefinition;
  | import org.jbpm.graph.def.Transition;
  | import org.jbpm.graph.node.TaskNode;
  | import org.jbpm.instantiation.Delegation;
  | import org.jbpm.taskmgmt.def.Task;
  | 
  | 
  | import junit.framework.TestCase;
  | 
  | public class MyTest extends TestCase {
  | 
  | 	public void testStartNode() {
  | 		    ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
  | 		      "<process-definition  xmlns=''  name='myProcess'>" +
  | 		      "   <start-state name='start'>" +
  | 		      "      <transition name='to_task1' to='task1'></transition>" +
  | 		      "   </start-state>" +
  | 		      "   <task-node name='task1'>" +
  | 		      "      <task name='first'>" +
  | 		      "           <assignment class='com.test.assignment.PartMaster' config-type='bean'>" +
  | 		      "	              <groupName>leader</groupName>" +
  | 		      "	          </assignment>" +
  | 		      "	     </task>" +
  | 		      "      <transition name='to_end1' to='end1'></transition>" +
  | 		      "   </task-node>" +
  | 		      "   <end-state name='end1'></end-state>" +
  | 		      "</process-definition>"
  | 		    );
  | 
  | 		    Node node = processDefinition.getNode("start");
  | 		    Transition tran = node.getLeavingTransition("to_task1");
  | 		    assertNotNull( tran );
  | 		    Node node2 = tran.getTo();
  | 		    assertEquals("task1", node2.getName());
  | 		    TaskNode tn = (TaskNode) node2;
  | 		    Task task =  tn.getTask("first");
  | 		    assertNotNull("task is not 'first'", task);
  | 		    String delegationName = task.getAssignmentDelegation().getClassName();
  | 		    assertEquals("com.test.assignment.PartMaster", delegationName);
  | 		  }
  | }
  | 

So you are doing something wrong....

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

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



More information about the jboss-user mailing list