0

I would like to know, how should we execute the rules written in technical rule of IBM ODM. I am using ODM V8.0.1. I have tried as below.

  1. I created a XOM having class named Courier.java

    public class Courier { private String courierType; private int distance;

    with getters & setters

    }

  2. I created a rule project adding this XOM and created respective BOM.

  3. I have added Courier Object as IN_OUT ruleset parameter with Name as "courier"
  4. Then created a Technical Rule with below code

    when { cour : Courier(); }

    then { note("Courier Object Check is Satisfied"); }

  5. Created a ruleflow having only one rule task pointing the above technical rule.

  6. Then I run this ruleflow as

    • Run as --> Run Configuration

      • In Run Configuration dailog box, written below function to create courier object and
        ran the configuration.

      com.seldart.Courier cour= new com.seldart.Courier(); return cour;

      Ruleflow execution went for 2 seconds but the statement in note() method has not
      printed in the console.

I am not sure, whether rule flow has not picked the technical rule itself to run or courier object is not recognized ? Kindly guide me on executing this technical rule in right way. Thanks.

Selva
  • 1
  • 3

2 Answers2

0

I think you have to explicitly add your courier ruleset parameter to the working memory, for instance in the Initial Action of the Start Node of your ruleflow.

For example, in IRL:

insert courier;
ratiaris
  • 327
  • 2
  • 10
0

Simply, first of all create an action verbalization for your function in B2X. This way, it becames "visible" to all rule objects in your project and references.

Second, try to create an action rule and reference this new verbalization with it.

Third, create a rule flow to orchestrate this action rule.

To execute all this stuff try to simulate the ruleset or export and run the jar package with the ILOG/IBM JRules API.

Martin Zabel
  • 3,589
  • 3
  • 19
  • 34