Templates

Extensibility is among the major OpenRules capabilities that make the product highly customizable allowing users to create domain-specific decision tables. As an example, let’s add a new column type “SumOfArray” which is supposed to summarize all elements of an array and assign the result to another variable.  Here is the proper template and a decision table that was created based on it:

This template defines a new action type called “SumOfArray” in the first row. The second row can contain any Java snippet including any standard and 3rd party Java methods. The third row defines the type and name of the array. And the 4th row should contain the name of the variable in which this action is supposed to put a sum of the array. A decision table on the right uses the action of the type “SumOfArray”. If “My Array” is defined as {1,2,3,4,5} then the variable “Sum” will become 15. This action column now can be mixed with regular Condition and Conclusion columns in any decision table.

.