How to get taskid after the complete method

cancel
Showing results for 
Search instead for 
Did you mean: 
coooong
Member II

How to get taskid after the complete method

Hi,

I have a workflow like: startevent -> task1(Assignee:Tom) -> choose sequence flow "agree"  ->task2(Assignee:Jerry) -> choose sequence flow "disagree"  -> task1

when the flow arrive to task1, i want to set assignee to "Tom" again.

Now i have an idea like:

when the flow arrive to task1, i use complete method, after the complete method, set a local variable "pre_task_id(task1's taskid)" in task2 so that i can use task1's taskid to search in "act_hi_taskinst" table for assignee(Tom), but  this method "taskService.setVariableLocal(taskId, variableName, value)"  need task2's taskid, how can i get the task2's taskid after complete method?

Or please let me konw if there any better solution

222.PNG