the process like this: start-> node1->node2->end;
I need the previous task instance,not the new node1 instance.
Does anyone tell me how to resolve the question?
Do you really need the same task instance?
Or just task which has same data as node1? I would you gateway and loop afterward to node1 which creates another instance of it.
If i create another instance , when query the history task instance for the user, the results will contain multiple same task.
We are also thinking how to do this kind of processes, but we also want to keep log what was changes, so we don't mind multiple same task.
Eg. node1 set to value A, then rejected, node1 set to value B, again rejected, node1 set to C and accepted. Process finished.
Then the history show what was changed when, which is ok for us:
user X set value A on 1.1.2011
reject by Z on 1.1.2011
user X set value B on 2.1.2011
rejected by Z on 2.1.2011
user X set value C on 3.1.2011
accepted by Z on 3.1.2011
I think there is no posibility to open same instance of task - which would mean change of status from Completed to Ready.
Let us know if you find some nice solution.
I think Marie is right, according to the task life cycle, http://docs.jboss.org/jbpm/v5.1/userguide/ch.Human_Tasks.html#d0e3368, you won't be able to make this. When a human task is completed, you can't go to uncomplete it, you have to complete a new task instance. You could make some hack, changing manually the task in the db?, and something with the task work item, but in my opinion it would not make sense.
Would not filtering the history query for multiple instances?
You could make use of human task life cycle operations - other than the most common. Depending on your scenario you could either user forward or delegate. That of course would change you process a bit, meaning you will have only one task node that once it is done by the first actor, it could be delegated to the other actor for review instead of completing it if you want to operate on the same task instance. The other person could either approve it and move on with the process flow or return it back to the previous assignee.
For more details take a look at task service section of the documentation, especially task client api.
Unfortunately you will not be able to utilize console for that, it does not cover all the task life cycle operations, afaik.
Would that make your case?