This answer is heavily based on Justin Phillips's nice answer to this question, updated for ODM 8.5. Please plus up his answer.
The main idea is to create a function in the Business Object Model (BOM) that can be called from your rules. To add a BOM function:
- Right click the
bom
folder in the Eclipse rules project. - Select
New -> BOM Entry
from the menu. - Select the
Create an empty BOM entry
option and then clickFinish
. - Double click the new BOM entry to bring up the BOM editor view, and
then click
New Class
. - Enter the class name and then click
Finish
. - Double click the new BOM class from the list, then under
the
Members
section, click theNew
button. - In the
New Member
dialog, select theMethod
option, enter aName
(isBetween
), returnType
for the method (boolean
), and add three String parameters (testee
- the value being tested,min
andmax
). Click theFinish
button. - Double click the new method under the
Members
section, and select theStatic
andFinal
options. - Click the Create link under the "Member Verbalization" section and fill in the Template text box with
{0} is between {1,min} to {2,max}
- Under the
BOM to XOM Mapping
section, enter your Java code.
11. Go back to the class level BOM editor and set the Execution name
to the value void
in the "BOM to XOM Mapping" section. This indicates that the BOM class is not linked to a Java class (XOM).
The verbalization for the newly created member should now be accessible when filling out the Test
in the Condition Column
for the decision table.