-
1. Re: Problem in getting proper workflow transitions:
ducn Jun 5, 2007 2:00 AM (in response to maxp)Can you also post the processdefinition.xml?
Cheers,
Duc -
2. Re: Problem in getting proper workflow transitions:
kukeltje Jun 5, 2007 2:37 AM (in response to maxp)why do you assume it should be in task-node2? How does it even get to end, you don't even signal it..etc...etc... so please, never post partial processdefinitions and partial code....
-
3. Re: Problem in getting proper workflow transitions:
maxp Jun 5, 2007 2:50 AM (in response to maxp)Hi Duc
Here is the process definition.xml file for the same
<process-definition
xmlns="urn:jbpm.org:jpdl-3.1" name="credit-request-approval">
<start-state name="start">
</start-state>
<task-node name="task-node1">
</task-node>
<task-node name="task-node2">
</task-node>
<task-node name="task-node3">
</task-node>
<end-state name="Request Approved"></end-state>
<end-state name="Request rejected"></end-state>
</process-definition> -
4. Re: Problem in getting proper workflow transitions:
maxp Jun 5, 2007 2:51 AM (in response to maxp)Hi Duc
Here is the process definition.xml file for the same
<process-definition
xmlns="urn:jbpm.org:jpdl-3.1" name="credit-request-approval">
<start-state name="start">
</start-state>
<task-node name="task-node1">
</task-node>
<task-node name="task-node2">
</task-node>
<task-node name="task-node3">
</task-node>
<end-state name="Request Approved"></end-state>
<end-state name="Request rejected"></end-state>
</process-definition> -
5. Re: Problem in getting proper workflow transitions:
maxp Jun 5, 2007 2:53 AM (in response to maxp)Hi Duc
Here is the process definition.xml file for the same<process-definition xmlns="urn:jbpm.org:jpdl-3.1" name="credit-request-approval"> <start-state name="start"> <transition name="enter-request" to="task-node1"></transition> </start-state> <task-node name="task-node1"> <task name="enter-details" ></task> <transition name="send for approval" to="task-node2"></transition> </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>
-
6. Re: Problem in getting proper workflow transitions:
maxp Jun 5, 2007 2:57 AM (in response to maxp)Hi kukeltje,
I assumed that it would be in task-node 2 because a signal should move state from one node to another , is'nt it.
Lets say i start a process , signal to move to next state and store it. Then when later on say i reload the instance again and does another signal it should go to next state, but in my case in the latter scenario, it jumps to the end state. I just fail to understand whats happening here.
Do i need to maintain some information somewhere. i doubt that, but asked just incase.
-Max -
7. Re: Problem in getting proper workflow transitions:
ducn Jun 5, 2007 3:14 AM (in response to maxp)
You can see in the debug output log what really happened.
Duc -
8. Re: Problem in getting proper workflow transitions:
maxp Jun 5, 2007 3:33 AM (in response to maxp)Ok. let me ask a different question
[ I am unable to find anything useful from debug logs, I posted here after checking all that only]
Lets say i create a taskInstance like this
TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();
// Save the process instance along with the task instance
jbpmContext.save(processInstance);
Now say the user performs some task on this instance and a UI event is created to move to next state,
I load the taskInstance based on its id
TaskInstance taskInstance = taskMgmtSession.loadTaskInstance(taskInstanceId);
Then i do
taskInstance.end(transitionName);
This finishes the current task. But new tasks or anything is created.
How would the task in next state created in db. ??? And how can i check whether the state has moved to next state.
If i do
ProcessInstance processInstance = taskInstance.getTaskMgmtInstance().getProcessInstance();
and processInstance.signal() - > the rootToken.node.name shows end-state
But i want process to go on next state ? so signal goes out of the picture.
Any ideas ducn/kukeltje ??
-Max -
9. Re: Problem in getting proper workflow transitions:
maxp Jun 5, 2007 3:39 AM (in response to maxp)Editing last few lines
This finishes the current task. But "NO" new tasks or anything is created.
How would the task in next state created in db. ??? And how can i check whether the state has moved to next state.
If i do
ProcessInstance processInstance = taskInstance.getTaskMgmtInstance().getProcessInstance();
and processInstance.signal() - > the rootToken.node.name shows end-state
But i want process to go on next state ? so signal goes out of the picture.
Any ideas ducn/kukeltje ??
-Max -
10. Re: Problem in getting proper workflow transitions:
maxp Jun 5, 2007 6:11 AM (in response to maxp)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 thisProcessInstance processInstance = new ProcessInstance(processDefinition2); TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance(); taskInstance.start(); context.save(processInstance);
and in a seperate servlet i doTaskMgmtSession 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 -
11. Re: Problem in getting proper workflow transitions:
maxp Jun 5, 2007 7:33 AM (in response to maxp)Any clues anyone ??
-
12. Re: Problem in getting proper workflow transitions:
estaub Jun 5, 2007 7:51 AM (in response to maxp)I think you forgot to jbpmContext.close().
-Ed Staub -
13. Re: Problem in getting proper workflow transitions:
maxp Jun 5, 2007 8:00 AM (in response to maxp)Nopes i have done that.
I have checked the same twice and i am closing the context properly.
-Max -
14. Re: Problem in getting proper workflow transitions:
estaub Jun 5, 2007 8:20 AM (in response to maxp)TaskInstance taskInstance = context.loadTaskInstanceForUpdate(1L);
1L??? What the L is 1L?
-Ed Staub