cancel
Showing results for 
Search instead for 
Did you mean: 

Human task: self-finishing on condition

erik1
Champ in-the-making
Champ in-the-making
Hello,

I am new to Activiti / BPMN 2.0, my question may be a bit naive.

Basically, I need a task which is completed if a user has collected five apples:

1. A user gets the task to collect five apples, via REST call.
2. Everytime the user found an apple, a REST call is made and the process engine is informed about apple++.
3. After five apples have been found, the process engine itself marks the task as completed and moves on.

- Working with a looped task would mean that the user has to claim each of the generated task instances. This seems like overkill to me, as each task would process just one apple and lots of REST call would have to me made.
- I thought about script task, which periodically checks a process variable, but that seems not to be very elegant.
- Also, storing task related variables (apple count) in the process engine environment seems bad practice to me.

How would you implement such a "self completing counter task, assignable to a person"?
An example or a concrete pointer to some information would be very nice.

Thanks
Erik
1 REPLY 1

trademak
Star Contributor
Star Contributor
Hi,

You can use a multi instance user task to do this.
When you create a multi instance user task with 5 items, you get what you want I think.

Best regards,