Weitere Kapitel dieses Buchs durch Wischen aufrufen
Target audience Business analyst, developer, rule author In this chapter you will learn The different rule entry languages and rule artifacts, namely, technical rules, action rules, decision tables, decision trees, and scorecards How to build your custom rule language How to orchestrate rule execution with ruleset parameters and ruleflow How to optimize rule execution by selecting the appropriate rule execution algorithm for a given rule task Key points The Ilog Rule Language (IRL) is the foundation upon which other languages and rule artifacts are built. Action rules, decision tables, decision trees, and scorecards are translated into/executed as IRL technical rules. Be aware of the possibility to develop your own rule language (with the Business Rule Language Development Framework), but resist the temptation to. Refer to your application objects through ruleset parameters. Use ruleflows to orchestrate rule execution. They provide a high-level control mechanism and a context for rule execution. Ruleflows offer opportunities for speeding execution through run-time rule selection, and algorithm selection.
Bitte loggen Sie sich ein, um Zugang zu diesem Inhalt zu erhalten
Sie möchten Zugang zu diesem Inhalt erhalten? Dann informieren Sie sich jetzt über unsere Produkte:
The first full-fledged ILOG Rule Language was based on the rule language OPS5 (see Chap. 6).
When we build a BOM entry from a Java project, we not only “import” the classes from that project, but we also “import” commonly useful classes from the Java library including basic types, collections, java.util.Date, java.util.Calendar, etc. These additional classes constitute what JRules calls the boot bom. Empty BOM entries actually are not empty: they contain the boot bom. The default boot bom can be changed.
Recall the discussion in Sect. 6.3.2 regarding the engine notification. The good news is that BAL rule authors do not need to worry about this, because this behavior can be configured at the BOM level. Indeed, we can set up a particular data member setter (or void function member) to automatically trigger an update when used in the action part of a rule. We will come back to this in the next section when we talk about BAL to IRL translation.
EBNF stands for Extended Backus-Naur Form. People familiar with Yacc or ANTLR will recognize the syntax. Things that are supposed to appear as-is (language keywords) appear between quotes. Things that are optional appear between square brackets ([optional]). Groups of things that can appear zero or more times appear as (…)*.
The exact type is ilog.rules.engine.IlrCollection, which is a dynamic collection in the sense that objects will be automatically removed from the collection as soon as they no longer satisfy the conditions that got them in.
Called logical conditions and logical assert. The system maintains some sort of a reference-count of justifications for Alarm (or ServiceRequest) objects, and we need to redefine the equals method on the class Alarm (or ServiceRequest) accordingly. More can be found in the product documentation.
We would not explain it any further, especially that we strongly recommend not using else, because it makes rules error prone and the ruleset hard to maintain.
In this and subsequent IRL translations, we omitted class package names for presentation purposes. Just be aware that the real IRL code shows fully qualified class names in class conditions.
The lifetime issue is a bit more complex: It spans the evaluation of the condition part and the lifetime of the rule instance, if one is created. See Chap. 6.
Please do not write rules like this one at home ☺: This rule breaks every rule writing guideline we mentioned in Chap. 9. It is only meant to illustrate various syntactic constructs.
We simplified the underlying IRL to make it more readable, by: (a) removing class package names, (b) reducing the number of extraneous parentheses, and (c) simplifying/faking the way Date constants are handled.
This is useful in those situations where (a) all the cells have the same value, or (b) the action takes no arguments – and thus no values to enter – or (c) the action represents a non-business tasks that business rule authors should not care about.
This is a misnomer because mathematically speaking, the partition of a set S is a set of non-overlapping subsets of S whose union equals S.
Check root package ilog.rules.dt, and more specifically, ilog.rules.dt.model.
The Internal Revue Service expects all US entities (corporations, individuals) to file for taxes every year, and it has the necessary authority and … hum … leverage to make sure they comply. With foreign entities, because it lacks such “leverage”, it requires that a percentage of their gains on each transaction be preemptively withheld (typically 30%, but sometimes 15% or 10%) or reported … unless, of course … (a few hundred rules and exceptions based on type of entity, country of origin, existence of treaties, type of transaction, etc.).
As is the case with statistical models, it is part science (mostly), part art. Note that the JRules Scorecard Modeler does not support those statistical analyses: They need to be done using other tools such as the SAS Enterprise Miner ™.
We greatly simplified the actual IRL to make it readable. The actual IRL has more actions, and some of the functions have more parameters.
If you must know, we need to create an Eclipse plug-in project using the extension point ilog.rules.studio.brl.languages.
Of course, we could have several out parameters in Java … if we aggregate them in a single return object.
This is a somewhat abusive simplification, but it will do for now: (1) the API for manipulating XML data (XML XOM) is slightly different, for both working memory insertion, and parameter passing, (2) with inout parameters, for the case of local invocation (same JVM, as in the example above) the variable passed as inout will reflect the changes made by rule execution (no need to fetch the new value from outputs), and (3) the RES API does enable us to pass data that is to be inserted in working memory.
And in a distant past (Rules C++), they were.
For example, public static class data members.
JRules enables us to use variable names that contain spaces. However, internally, it replaces spaces by “_” … and “_” by “$_$”.
We insist on the term behaves as because internally, it is the same ruleset object and the same rule engine, except that different subsets of the ruleset will be activated as we move from one rule task to another.
The properties of a rule can be either extractable, in which case they are available in the run-time representation of rules, or non-extractable, in which case they are development time-only properties. The extractability of a rule property is a true/false attribute than can be set in rule model extensions. See Chap. 17 for more information about extending the rule metamodel.
We will be able to extract the ruleset, but when we load it into a ruleset object, we get a ruleset parsing error.
Data entry typically involves saving the data entered in the database, but also, pulling out the policy object from the database. Payment requires either printing checks or making automatic transfers by accessing a banking system.
Note that the current BOM does not support these rules. They are used for illustration purposes.
That is, without the in/ from constructs.
For example, in RETE mode, when an object is insert’ed, all of the rules that concern it will be evaluated. In sequential and fastpath mode, the new object may or may not be considered depending on the tuple enumerator used by the sequential algorithm or the rule ordering algorithm used by fastpath.
Object local variables are variables defined using the form “set <var name>to a <object type> [scope expression].” A variable that represents the value of an attribute (regardless of its type) is not mapped to an IRL class condition.
Well. They can also handle simple extensions like specifying value editors or specializing tokens of the language, but they cannot handle different grammatical structures.
We can call it a domain-specific language to make it more acceptable ☺.
- Rule Authoring in JRules
Mr. Jérôme Boyer
Prof. Hafedh Mili
- Springer Berlin Heidelberg
- Chapter 11
Neuer Inhalt/© ITandMEDIA