0
public void executeRules(IlrRule[] rules){
       IlrRuleset rulesetNew = new IlrRuleset();
       IlrContext ctxt = new IlrContext(rulesetNew);
       IlrTask task = ruleset.getTask("ExecFlow#exe");
       IlrRuleTaskRunner runner = ctxt.getRuleTaskRunner(task);
       runner.setActiveRules(rules);
       int fired = 0;
       runner.runInitialActions();
       fired += runner.runBody();
       runner.runFinalActions();

}

How we can create a dynamic ruleset from group of rules? this group is a dynamic. I am using IBM ODM 8.0.1

kc2001
  • 5,008
  • 4
  • 51
  • 92

3 Answers3

1

Just be careful with dynamic selects. If you have a lot of rules, it can increase the execution time of the rule set significantly.

Justin Phillips
  • 1,358
  • 2
  • 12
  • 26
0

All Java implementation are disappeared, we used irl language, this is the solution :

We defined the scope and we select the rules dynamically

scope= {exe.R05,exe.R04,exe.R03}

body = dynamicselect() {
    return selectedFunction(context.getRuleset().allRules);
}
Pshemo
  • 122,468
  • 25
  • 185
  • 269
0
body = dynamicselect() {    
    return selectedFunction(context.getRuleset().allRules);    
}

Is sufficient to custom the rules which you like to executed.

Sir Crispalot
  • 4,792
  • 1
  • 39
  • 64