AnsweredAssumed Answered

Human task: self-finishing on condition

Question asked by erik1 on Jan 19, 2012
Latest reply on Jan 20, 2012 by trademak
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

Outcomes