0

I am working in ilog and I have a decision table in which say I have 5 rules. I have some input field as condition say name and age (dummy data) and have some action part related to it. When I pass the input with some condition value as null, exception handler is called in which i have handled the exception and returned false. But problem is if exception occurred in first row then it should throw exception and program should directly reach final action, but in my case all 5 rules are executed and I am getting 5 values for exception which equals the number of rows in table.

public boolean handleexception(IRLruntimeexception ex)
{
    errorcode=ex.getmessage();
    return false;
}

I am getting 5 times error code value which is incorrect

djv
  • 15,168
  • 7
  • 48
  • 72

2 Answers2

0

This is maybe because RetePlus algorithm matches all conditions before executing actions

Try to change the algorithm of your ruletask to sequential.

Akram GARGOURI
  • 205
  • 1
  • 10
  • Can you explain more? where you put your exceptionHandler? it's a ruleflow handler or a rule handler? – Akram GARGOURI Sep 24 '14 at 09:26
  • exception is for rule handler.its a separate class which implements ilrexception handler class .so whenever exception occurs this class method i.e handle exception is called – Techie1227 Sep 24 '14 at 10:11
0

The exception handler is called for each rule, since each row in a decision table is actually an independent rule. The conditions for each rule will be evaluated for the data provided.

You should approach rule programming just like you would approach programming in any other language, and validate the data/check for null values before passing the data into the rules. So for example, the first task in your ruleflow or initial actions would check for any null or invalid data. If the data passes the null check, the other tasks in the ruleflow are invoked.

See the document Check for null values in rules for additional recommendations on how to handle null values for input data into rules.

z_blue
  • 350
  • 3
  • 20