[jboss-user] [JBoss jBPM] - Re: Easy One : Creating Testcase Swimlane Assignments

JerWah do-not-reply at jboss.com
Wed Aug 23 12:30:30 EDT 2006


Answers:
Version: bpm 3.1.2

This is the testcase I am trying to run:


  | public void testProcess() throws Exception {
  | 		
  | //		 Extract a process definition from the processdefinition.xml file.
  | 		FileInputStream fis = new FileInputStream("processes/Hello/processdefinition.xml");
  | 		ProcessDefinition MyDef = ProcessDefinition.parseXmlInputStream(fis);
  | 			assertNotNull("Definition should not be null",MyDef);
  | 		
  | //		 Start the Instance
  | 		ProcessInstance MyInstance=new ProcessInstance(MyDef);
  | 		
  | 		assertEquals(
  | 					"Instance is now in the start state",
  | 					MyInstance.getRootToken().getNode().getName(), "start");
  | 		MyInstance.signal();
  | 		
  | //		 Brings us to the FORK so we should now have active children
  | 		assertEquals(
  | 					"Should have Children",
  | 					MyInstance.getRootToken().hasActiveChildren(), true );
  | 					//Dump Children list to out.
  | 		
  | 		System.out.println(MyInstance.getRootToken().getChildren().toString());
  | 		
  | //		 Signal the left hand side
  | 		MyInstance.signal("B1");
  | //		 Signal the right hand side
  | 		MyInstance.signal("S1");
  | 		
  | 		System.out.println("BLAH");
  | 
  | // 		 Should put us back past the join
  | //		MyInstance.signal();
  | //		assertEquals(
  | //					"Instance is now in the end state",
  | //					MyInstance.getRootToken().getNode().getName(), "end1");
  | //		
  | //		assertTrue("Instance is ended", MyInstance.hasEnded());
  | 		
  | 	}
  | 

process definition:

  | <?xml version="1.0" encoding="UTF-8"?>
  | 
  | <process-definition
  |   xmlns="urn:jbpm.org:jpdl-3.1"  name="Hello">
  |    <swimlane name="ME">
  |       <assignment expression="user(Karl Taylor)"></assignment>
  |    </swimlane>
  |    <start-state name="start">
  |    
  |       <transition name="tr0" to="fork1"></transition>
  |    </start-state>
  |    <end-state name="end1"></end-state>
  |    <fork name="fork1">
  |       <transition name="tr1" to="BOBBY">
  |       </transition>
  |       <transition name="tr2" to="SALLY"></transition>
  |    </fork>
  |    <task-node name="BOBBY">
  |       <task name="task1" blocking="true" swimlane="ME">
  |       </task>
  |       <transition name="B1" to="join1"></transition>
  |    </task-node>
  |    <task-node name="SALLY">
  |       <task name="task1" blocking="true" swimlane="ME">
  |       </task>
  |       <transition name="S1" to="join1"></transition>
  |    </task-node>
  |    <join name="join1">
  |       <transition name="" to="end1"></transition>
  |    </join>
  | </process-definition>
  | 

Debug output

  | 12:29:14,403 [main] INFO  JbpmConfiguration : using jbpm configuration resource 'jbpm.cfg.xml'
  | 12:29:14,410 [main] DEBUG JbpmConfiguration : loading defaults in jbpm configuration
  | 12:29:14,683 [main] DEBUG ObjectFactoryImpl : adding object info 'default.jbpm.context'
  | 12:29:14,686 [main] DEBUG ObjectFactoryImpl : adding object info 'resource.hibernate.cfg.xml'
  | 12:29:14,688 [main] DEBUG ObjectFactoryImpl : adding object info 'resource.business.calendar'
  | 12:29:14,690 [main] DEBUG ObjectFactoryImpl : adding object info 'resource.default.modules'
  | 12:29:14,692 [main] DEBUG ObjectFactoryImpl : adding object info 'resource.converter'
  | 12:29:14,694 [main] DEBUG ObjectFactoryImpl : adding object info 'resource.action.types'
  | 12:29:14,697 [main] DEBUG ObjectFactoryImpl : adding object info 'resource.node.types'
  | 12:29:14,698 [main] DEBUG ObjectFactoryImpl : adding object info 'resource.parsers'
  | 12:29:14,700 [main] DEBUG ObjectFactoryImpl : adding object info 'resource.varmapping'
  | 12:29:14,702 [main] DEBUG ObjectFactoryImpl : adding object info 'jbpm.msg.wait.timout'
  | 12:29:14,704 [main] DEBUG ObjectFactoryImpl : adding object info 'jbpm.byte.block.size'
  | 12:29:14,706 [main] DEBUG ObjectFactoryImpl : adding object info 'mail.smtp.host'
  | 12:29:14,710 [main] DEBUG ObjectFactoryImpl : adding object info 'jbpm.task.instance.factory'
  | 12:29:14,712 [main] DEBUG ObjectFactoryImpl : adding object info 'jbpm.variable.resolver'
  | 12:29:14,714 [main] DEBUG ObjectFactoryImpl : adding object info 'jbpm.mail.address.resolver'
  | 12:29:14,715 [main] DEBUG JbpmConfiguration : loading specific configuration...
  | 12:29:15,012 [main] DEBUG JpdlParser$JpdlEntityResolver : resolving schema reference publicId(null) systemId(http://jbpm.org/jpdl-3.1.xsd)
  | 12:29:15,014 [main] DEBUG JpdlParser$JpdlEntityResolver : providing input source to local 'jpdl-3.1.xsd' resource
  | 12:29:15,201 [main] DEBUG NodeTypes : node 'page' will not be available. class 'org.jboss.seam.pageflow.Page' couldn't be loaded
  | 12:29:15,203 [main] DEBUG NodeTypes : node 'start-page' will not be available. class 'org.jboss.seam.pageflow.Page' couldn't be loaded
  | 12:29:15,238 [main] DEBUG GraphElement : event 'process-start' on 'ProcessDefinition(Hello)' for 'Token(/)'
  | 12:29:15,241 [main] DEBUG GraphElement : event 'before-signal' on 'StartState(start)' for 'Token(/)'
  | 12:29:15,242 [main] DEBUG GraphElement : event 'node-leave' on 'StartState(start)' for 'Token(/)'
  | 12:29:15,243 [main] DEBUG GraphElement : event 'transition' on 'Transition(tr0)' for 'Token(/)'
  | 12:29:15,244 [main] DEBUG GraphElement : event 'node-enter' on 'Fork(fork1)' for 'Token(/)'
  | 12:29:15,247 [main] DEBUG GraphElement : event 'node-leave' on 'Fork(fork1)' for 'Token(/tr1)'
  | 12:29:15,248 [main] DEBUG GraphElement : event 'transition' on 'Transition(tr1)' for 'Token(/tr1)'
  | 12:29:15,249 [main] DEBUG GraphElement : event 'node-enter' on 'TaskNode(BOBBY)' for 'Token(/tr1)'
  | 12:29:15,260 [main] DEBUG GraphElement : event 'task-create' on 'Task(task1)' for 'Token(/tr1)'
  | 



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

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



More information about the jboss-user mailing list