Embedded rules 📝
As a DecisionRules user, you certainly already know that you can create rules in Decision Tables, or in Scripting Rules. These two features can be also combined in Rule flow, which is used for more complex rules/conditions. From now on, however, it is possible to call the Decision Table directly from the Scripting rules.
Why this feature is useful?
Decision Tables and Scripting Rules differ in the ease of creating the conditions inside the DecisionRules. Decision Tables are designed as user-friendly as possible even for non-technical people. Even though we offer a large set of different operations and operators, sometimes it can happen that even so it is not enough for certain more complex use-cases.
For a better picture, imagine the case when you are letting your employees/ groups of companies/ customers register to your system. But for being registered, for example for certain benefits, the “user/customer” needs to accomplish some conditions. Sure, the majority of those conditions could be easily specified in Decision Tables. But sometimes there are conditions that must be evaluated within a group of users. And exactly at this moment, embedded rules in Scripting Rules are coming to the scene.
How to call another rule from Scripting Rules
How? Very smoothly and easily because all you need is to know the ruleID and use the right method. The method is called solve().
Call your rule by using: DR.solve( ruleid, data, version, Solverstrategy)
From the previous formula is now visible that there are other parameters that have to be specified before running the solver. The first parameter, as was mentioned before, is the ruleID. Then obviously you need to have input data for your solver, and then specify the version of the ruleset you are going to use during solving. The last parameter is the execution strategy (Standard, First match, or what if for example, the main condition for getting to another step in registration is age, which will be specified by the date of birth
To find out more, check our documentation or visit DecisionRules.io to it out on your own. If you have any further information or demo inquiry contact us at firstname.lastname@example.org or at email@example.com
Thank you for reading,
Team DecisionRule.io 🚀