Applies to version: 2022.1.x and above; author: Dominika Stelmach
The WEBCON BPS 2022 version introduces a new For each operator, which allows you to configure an action, operation, or automation for each element from the selected collection.
Fig. 1. For each operator
The operator iterates over the collection elements, which can be an item list, any data source, attachments added to the workflow instance, and any collection defined as a business rule.
Fig. 2. Collection type
For Data Source and Attachments collections, the collection values are in a separate group in the Values list in the Variable Editor.
Fig. 3. Collection columns for data sources and attachments
After expanding the symbol of three dots and selecting the Properties option, the user can add and configure actions performed in the loop. We can achieve the same effect by double-clicking on the bar with the operator's name.
Fig. 4. The action configuration the For each operator
One example of using the For each operator can be the process used to manage a marketing campaign. The process consists of two workflows:
Marketing offer workflow
Fig. 5. Marketing offer workflow
Marketing request subworkflow
Fig. 6. Marketing request workflow
After registering a new campaign, the user goes to the next step and fills out the details of the offer. On the Clients item list, some people should receive an e-mail with a special offer.
Fig. 7. Marketing request workflow – creating a new offer
After completing the details, a user goes through the Offer created path. The system will automatically start the Marketing request subworkflow with a task for the responsible person for each row in the Clients item list. An e-mail is configured in such a way that the client’s response will go directly to the client’s supervisor, which will significantly increase the entire process.
Fig. 8. Marketing request workflow
In WEBCON BPS Designer Studio, enter the Offer created path configuration in the Marketing offer workflow, and then create a new automation with the For each operator. As a collection type, select Item list -> Clients.
Fig. 9. New automation
Fig. 10. For each configuration
Then enter the configuration of the operator and add the Start a subworkflow action. In the Basic tab, select the process and workflow to be start.
Fig. 11. The Start a subworkflow action – Basic tab
The Data tab allows you to indicate the form fields. The form field values from the marketing action are mapped here, which allows the Marketing request process to work with the correct data. In the presented example, the item list columns are indicated, after which the for each operator iterates.
Fig. 12. The Start a subworkflow action – Data tab