How do I loop a task using a condition?

A question often asked about tasks is: How do I loop a task using a condition?

Example
A practical example of this could be when a plan has to be validated by a certain number of Managers before being carried out.
We’ve shown this example in a new video tutorial, now available in the online BonitaSoft Documentation.

How validation works
Each of the Managers will validate the plan in turn, by clicking on a submit button in a form displayed in Bonita User Experience.
When all the Managers (5 in the case of the video tutorial) have validated the plan, the maximum number of loops has been reached.
The 5th and last validation will end the loop, terminate the task and finish the validation of the plan.

Configure the task
Take a look at our video tutorial, How to loop a task or a call activity, where the above example is illustrated.
It shows how to configure a loop on a human task using a Boolean variable (True/false variable).
Simply set up a Boolean variable on a pool first, see Define a boolean variable, then apply the Boolean variable to a task. You can set a maximum number of loops for the task.

More tutorial videos are available in the BonitaSoft Documentation video library.

Have fun with Bonita!