2

I am using CodeEffects rule editor for writing business rules in our application. I have many if-else conditions which are actually nested-if type rules. With no support of nested-if, I need to re-write all if conditions every time.

But I can't find any way to write rule as mentioned below.

  • if (Condition1)
    • (
      • if (sub-condition1)( ....)
      • else if (....)
    • )
  • else
    • (
      • ....
    • )

1 Answers1

1

The best way to substitute nested IFs is to use the same sub-conditions multiple times:

if condition1 and sub-condition1 then DoOneThing else if sub-condition1 then DoAnotherThing else DoSomethingElse

It's not perfect but it'll do.

Alex
  • 566
  • 1
  • 6
  • 14