Pregunta

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

¿Fue útil?

Solución 3

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);
}

Otros consejos

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

body = dynamicselect() {    
    return selectedFunction(context.getRuleset().allRules);    
}

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

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top