rollbackTransaction issue
jsanmarco Sep 21, 2005 5:23 PMHi all,
I have the following process definition:
<?xml version="1.0" encoding="UTF-8"?> <process-definition name="forkWait"> <start-state name="start"> <task> <controller> <variable name="color" /> <variable name="size" /> </controller> </task> <transition name="toT1" to="task1"></transition> </start-state> <end-state name="end"></end-state> <node name="task1"> <action name="action1" class="com.lumina.jbpm.tasks.Task1"></action> <transition name="toFork1" to="fork1"></transition> </node> <node name="task2"> <action name="action2" class="com.lumina.jbpm.tasks.Task2"></action> <transition name="toJoin1" to="join1"></transition> </node> <node name="task3"> <action name="action3" class="com.lumina.jbpm.tasks.Task3"></action> <transition name="toJoin1" to="join1"></transition> </node> <node name="Task5"> <!-- <transition name="toEnd" to="end"></transition> --> <action class="com.lumina.jbpm.tasks.Task5"></action> <transition name="toend" to="end"></transition> </node> <fork name="fork1"> <transition name="toEsperar1" to="esperar1"></transition> <transition name="toEsperar2" to="esperar2"></transition> </fork> <state name="esperar1"> <transition name="toTask2" to="task2"></transition> </state> <state name="esperar2"> <transition name="toTask3" to="task3"></transition> </state> <join name="join1"> <transition name="toTask5" to="Task5"></transition> </join> </process-definition>
1) I start the processInstance which runs until states "esperar1" and "esperar2" are reached.
2) Then I persist the processInstance and perform a jbpmSession.commitTransaction().
3) I recover the processInstance from the DB and signal on "toEsperar1" ( processInstance.findToken("/toEsperar1").signal() ) which makes "task2" to be executed and reach "join1" join node.
4) I persist the processInstance and perform a jbpmSession.commitTransaction().
5) After a while, I recover the processInstance from the DB and signal on "toEsperar2" ( processInstance.findToken("/toEsperar2").signal() ) which makes "task3" to be executed, reaching "join1" join node (now both tokens arrived to the join) and "task5" being executed.
6) Now I rollback the transaction by calling jbpmSession.rollbackTransaction().
7) I recover the processInstance from the DB and signal again on "toEsperar2" ( processInstance.findToken("/toEsperar2").signal() )
At this time, "task3" is NOT executed but "task5" executes normally.
My question is why "task3" is NOT executed if in 6) I rolled back to a step before it is executed?
Regards,
Juan Manuel