We can write If/Else condition in expression rule then why do we need decisions objects in Appian

Certified Associate Developer

We can write If/Else condition in expression rule then why do we need decisions objects in Appian

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Senior Developer

    Hello  

    If() - When you are using if for a single condition your code would look much simpler and easier to understand. Also when you are using If() to evaluate multiple conditions that is nested if() it would be difficult to understand the order of evaluation. Also when you pass a null value to If() it would by default consider it to be a false. 

    a!match() -  You can compare multiple conditions against a single value and avoid lot of confusion. Also it would have a whenTrue parameter and a default.

    Decisions -  Similar to decisions but the complete condition sets are predefined and if your condition matches any of the defined patterns in the Decision object then it would return a out else a default.  Easier to read and understand each set of condition. I have mostly used Decisions when a set of logics should return groups or users. would be more static values. 


      <---This would make Decision different from match and If() I guess.

    In practice for simpler logics we would use If() and when you have a huge set of possibilities against a single value we would use a!match() and when you have multiple variables/values to evaluate as a single condition and provide output (Expected values in a scenario which would be predefined in your decision object) we would use decision.

    Hope this helps!

Reply
  • 0
    Certified Senior Developer

    Hello  

    If() - When you are using if for a single condition your code would look much simpler and easier to understand. Also when you are using If() to evaluate multiple conditions that is nested if() it would be difficult to understand the order of evaluation. Also when you pass a null value to If() it would by default consider it to be a false. 

    a!match() -  You can compare multiple conditions against a single value and avoid lot of confusion. Also it would have a whenTrue parameter and a default.

    Decisions -  Similar to decisions but the complete condition sets are predefined and if your condition matches any of the defined patterns in the Decision object then it would return a out else a default.  Easier to read and understand each set of condition. I have mostly used Decisions when a set of logics should return groups or users. would be more static values. 


      <---This would make Decision different from match and If() I guess.

    In practice for simpler logics we would use If() and when you have a huge set of possibilities against a single value we would use a!match() and when you have multiple variables/values to evaluate as a single condition and provide output (Expected values in a scenario which would be predefined in your decision object) we would use decision.

    Hope this helps!

Children
No Data