How to define a function for use in an ODM decision table w/o changing the XOM?

一个人想着一个人 提交于 2019-12-04 13:01:30
kc2001

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:

  1. Right click the bom folder in the Eclipse rules project.
  2. Select New -> BOM Entry from the menu.
  3. Select the Create an empty BOM entry option and then click Finish.
  4. Double click the new BOM entry to bring up the BOM editor view, and then click New Class.
  5. Enter the class name and then click Finish.
  6. Double click the new BOM class from the list, then under the Members section, click the New button.
  7. In the New Member dialog, select the Method option, enter a Name (isBetween), return Type for the method (boolean), and add three String parameters (testee - the value being tested, min and max). Click the Finish button.
  8. Double click the new method under the Members section, and select the Static and Final options.
  9. 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}
  10. 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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!