Process XOR gateway expression

I would like to evaluate a date within the XOR gate. 

Something like this..

Process Variable pv!effectiveDate

if the value of effectiveDate is greater than the 20th of current month, then go one way, else the other.

However, I am getting an error:

XOR An error occurred while evaluating expression: =if(pv!effectiveDate>day(20)) (Expression evaluation error at function 'if': Invalid number of parameters, function 'if' a minimum of 3 parameters (condition,true,false), passed 1.) (Logic Output)

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    A few issues here.

    The main thrust of the error message is that you have an if() statement that does not meet requirements -- an if() statement needs to have a condition, then a return if true, and a return if false.  In other words every if statement needs 3 parameters.  Yours has only one.  My best guess here is that you should just remove the "if" portion, because you can just put in a statement that evaluates to true or false for the gateway condition.  At the very least, it should be if( {condition}, true(), false() ).

    Your second issue is, your "day()" function won't do anything when you call it on the literal "20".  I'm guessing what you meant to write was something like:

    day(pv!effectiveDate) > 20

    As always, I suggest trying out things like this in a blank instance of the Expression Rule editor.  You can go to "[yoursite]/suite/design/rule" to do this most easily without having to create/save an expression rule object.