Exploring BOS: How to use buttons in a form to direct a process between different paths

When a process has multiple paths, the process designer has to specify when and how various alternate paths are taken. One way to do this in Bonita Open Solution is through the use of multiple Submit buttons.

This tutorial video shows one way to do this.

In user forms designed in Bonita Open Solution, the Submit button completes the step (task) and the case in progress then passes to the next step in the process. (In multi-page forms, the last form in the series has the Submit button.)

You can define two Submit buttons so that the selection of one button sends the process to one path and the selection of the other sends the process to a different path.

For example, you can use Submit buttons to direct the process flow to one path for the condition “True” and a different path for the condition “False.” (In this example process, we’ll define “true” as “one horn” and “false” as “two horns.”)

For the step where you want to define alternate paths, go to Step -> Forms and Add a Form. Add two Submit buttons to the Form.

Rename the buttons so they appropriately reflect the path to the next step.

Go to Details -> Actions. In the Expression field, enter the condition or expression to be associated with this button. Save to the predefined variable that you will use on the conditions defined for the transition that connects this step to the next step in its path. In this example, ${numberOfHorns} is defined as “false;” ie, the path of two horns.

Go back to the process on the Bonita Studio whiteboard and select the transition between this step and the subsequent step, and apply the defined condition.

When the form is presented to the user, the selection of the Two horns button will send the process to the next step, “List the species with two horns.”

Do the same for the One horn button.

You can download this process from Contributions – count the horns and name that rhino!