[jboss-user] [JBoss jBPM] - Re: Problem in getting proper workflow transitions:

maxp do-not-reply at jboss.com
Tue Jun 5 06:11:21 EDT 2007


Ok let me give  a concrete example:


  | <process-definition
  |   xmlns="urn:jbpm.org:jpdl-3.1"  name="credit-request-approval">
  |   
  |    <start-state name="start">
  |       <task name="task-node1" ></task>
  |       <transition name="send for approval" to="task-node2">
  |    </start-state>
  | 
  |    </task-node>
  |    <task-node name="task-node2">
  |       <task name="approval1"></task>
  |       <transition name="approved" to="task-node3"></transition>
  |       <transition name="rejected" to="Request rejected"></transition>
  |    </task-node>
  |    <task-node name="task-node3">
  |       <task name="approval2"></task>
  |       <transition name="approved" to="Request Approved"></transition>
  |       <transition name="rejected" to="Request rejected"></transition>
  |    </task-node>
  |    <end-state name="Request Approved"></end-state>
  |    <end-state name="Request rejected"></end-state>
  | </process-definition>	
  | 

if i do

  | {
  | 
  |                   ProcessInstance processInstance =  new ProcessInstance(processDefinition2);
  |                   TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();
  |                   taskInstance.start();
  |                   context.save(processInstance);
  | 
  |                   Token token = processInstance.getRootToken();
  |                   System.out.println(token.getNode().getName() + " <br><br>");
  | 
  |                   taskInstance.end("send for approval");
  | 
  |                   token = processInstance.getRootToken();
  |                   System.out.println(token.getNode().getName() + " <br><br>");
  | }
  | 

2 task instances are created for me 
start and task-node2


But, say i do something like this 


  | 
  |   ProcessInstance processInstance =  new ProcessInstance(processDefinition2);
  |                   TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();
  |                   taskInstance.start();
  |                   context.save(processInstance);
  | 

and in a seperate servlet i do 

  |       TaskMgmtSession taskMgmtSession = context.getTaskMgmtSession();
  |       TaskInstance taskInstance = context.loadTaskInstanceForUpdate(1L);
  |       taskInstance.end("send for approval");      
  | 


then only the start taskinstance is created. 

Any ideas why this might be the case. 

Is it something related to same context or something ? Any ideas how i can achieve this . 

I must mention i am creating seperate contexts in these different servlets if that might be the case. I am really unsure of this behaviour .

Ideas ? ? 

- MAx




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

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



More information about the jboss-user mailing list