0
votes

I'm using JBPM workflow in my project.

Requirement : I have two user task. Here, my workflow falls on first task say 'Task-1'. And that is assigned to a user say 'User-A'. User-A is working on it. Meanwhile, for some condition, i need to hold the 'Task-1' and create another task say 'Task-2'. That task is assigned to another user says 'User-B'. Once 'Task-2' is completed, i need to go back to 'Task-1' with its appropriate status. ie., assigned state with User-A.

How can i do this requirements using Java along with JBPM Workflow/Drools

Thanks in advance

2

2 Answers

0
votes

yes you can. You can use the task management APIs to create the task when Task 1 is suspended and then resume Task 1 when task 2 is completed. You will need also to set up the event listeners so you know when Task 1 is suspended and Task 2 is completed. This is not a common sub task though, so you will need to do some extra coding. Are you using jBPM 6?

0
votes

I think the best practice would be to use a boundary event on the first user task, which would pause the first task (you would need to code that in a custom task) and generate a new user task.

After the second task is complete, you would resume the first one (again, another custom task would be needed), folowed by an End event (not a Terminate event though! You can see the differences here) to stop that thread of execution and let the other thread continue.