English-like Expressions inside Decision Tables

OpenRules Release 10.3 adds an ability to create complex English-like expressions inside your decision tables. With new predefined functions for lists and arrays of business objects, you don’t need to use loops in many practical situations. Consider a relatively simple example.

Let’s say your decision model deals with Company’s Employees described in this Glossary:

You don’t need to organize loops to calculate the average salary, the total number of children, or find the states where the employees live. You may simply use the following expressions inside decision table cells:

Here you see examples of the currently supported functions for lists/arrays of objects: Count, Sum, Max, Min, Average, Array, List, Set, DistinctArray, DistinctList, First, and Last. For more details, see OpenRules solution for DMCommunity’s March-2023 Challenge or download the complete decision model from here.

You may use similar expressions directly inside your decision table cells or you may introduce new decision variables in the Glossary and pre-calculate them using a decision table with the “ActionAssign”. The future release will add more functions and expand their usability. In particular, we will have functions with multiple parameters like Intersection of two lists. Your feedback and suggestions are welcome.

Leave a comment

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