0

I have written a rule like

if
    the period of 'Request' is more than 0
then
    set the date of 'Request' to due_date - 1 Day;
else
    set the date of 'Request' to due_date ;

for period values other than 0 it's working fine but when value of period is 0 it just skips whole rule, i.e it neither go to then nor else. I am using ODM 8.6 and testing through DVS file.

I have tried same thing in ODM 8.5 and it's working fine there please help in getting this issue resolved.

Ankit
  • 38
  • 1
  • 7
  • Is the semicolon after the then part correct, or could it be that it ends the if-then statement prematurely? – chiccodoro Dec 02 '14 at 07:33
  • @chiccodoro it is correct,also it could have been the case if i had put semicolon after 'if' part, But for case of 0, it should not look into if part no matter what it is – Ankit Dec 02 '14 at 09:10
  • I don't grasp the point, since I don't know odm/ilog/jrules too well. However my take is that the if part is *always* evaluated, even if the period is 0. But the evaluation has a different result. Furthermore I guess the semicolon is part of the syntax, not part of the expression, so it influences how the rule is parsed and processed long before it is evaluated on any data. If the semicolon after the "then" part finishes the rule and the "else" part is ignored on parsing, that would explain why nothing happens in the "else" case. – chiccodoro Dec 02 '14 at 15:15
  • @chiccodoro It's not case, we get error of then's semocolon is removed.also i should mention that period is int here. – Ankit Dec 03 '14 at 05:01
  • I see. I am sorry I cannot help... – chiccodoro Dec 03 '14 at 08:07

1 Answers1

0

Did you try with the latest fixpack?

In general it is poor design for rules to use the else construct. Try to split the rule into 2 different rules:

  • for period of 'Request'>0, and
  • for period of 'Request'<0.
z_blue
  • 350
  • 3
  • 20