Nested Loops in OpenRules Decision Models

Iterating over collections (arrays) of decision variables is a frequent need in real-world decision models. For example, the following decision table defines if a company has high-paid employees:

The iteration here is defined by the [for each Employee in Employees] in the first row. The ACTION-BREAK in the column “ActionExecute” will force the iteration process to stop (break) when the very first high-paid employee is found.

Sometimes, we need to iterate over arrays inside arrays (nested loops). Since the release 9.1.1 OpenRules allows nested loops like in the following example:

Here employees can live in multiple locations and we need to find employees who live in a location with a “Selected Zip Code”. The nested loops here are defined by the [for each Employee in Employees; for each Location in Locations] in the first row. Here is another examples of nested loops from the decision model “Permit Eligibility“:

This decision table for each Applicant and each Spouse will execute two other decision tables “CheckSharedPeriods” and “AddSharedPeriods”. If you run this decision model using OpenRules Debugger, it shows the currently selected Applicant and Spouse:

There are no limitations on a number of nested loops. I expect that the described ways of defining various loops are intuitive enough to be understood by non-technical users.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.