R2ML has a rich syntax, so it can represent business rules from both Drools and Jess languages, providing this way the interchange possibility.
Drools is classified as an Object-Oriented Production Rules engine written entirely in Java language, and more specifically it is a Forward-Chaining rule engine.
The mapping from Drools to R2ML is possible as R2ML supports the representation of the PRs by relying on the OMG's PRR (8) Specification.
Object oriented rules systems as Drools and ILOG JRules ate build on top of Java vocabularies.
For example, a rule from Drools may use one or many Java beans classes in order to describe its own vocabulary.
For example, if we assume the Drools import declaration (i.
All imported Java beans in Drools rule packages form the rules vocabulary.
Excepting the rules and their import declarations, a Drools package may contain other specific constructs like: globals, user-defined functions and queries, but they do not represent the subject of our translation.
The general principles of mapping a Drools rule into a R2ML production rule is:
The Drools language syntax also contains the comments expressed in Java-like syntax, such as:
In the following lines we describe the mapping of Drools conditions into R2ML appropriate ones.
The entire LHS of a Drools rule is in fact a tuple of facts (i.
1 Mapping Drools patterns without Field Constraints
A Drools pattern without field constraints, will map into the r2ml:ObjectClassificationAtom.