Conditions tab

On the Conditions tab, you must specify two parts of the definition:

  1. Expression

    Specify the expression that is used to decide which branch must be executed. Define the expression with Javascript (nashorn).

    Decision parameters are referenced as, $.<decisionParameterName> for example $.book.

    In case the Decision parameter is a JSON object. You can specify elements from a parameter with JSON Path expressions. For example if the Decision parameter contains JSON Object:

    {
       "store":{
          "book":[
             {
                "category":"reference",
                "author":"Nigel Rees",
                "title":"Sayings of the Century",
                "price":8.95
             },
             {
                "category":"fiction",
                "author":"Evelyn Waugh",
                "title":"Sword of Honour",
                "price":12.99
             }
          ],
          "bicycle":{
             "color":"red",
             "price":19.95
          }
       },
       "expensive":10
    }
    

    List of all books is required. You can define parameter 'books' with the value ${input.List}.store.book.

    This is an example expression to find if a parameter contains any expensive books:

    for (var i=0; i<$.books.length; i++)  {
       if ($.books[i].price>9) {
          'Expensive';
    	  break;
       }
       else {
          'Cheap';
       }
    }
  2. Branches

    For each branch specify the expression value.

    Default branch with undefined value is always available. It is used in case the expression results in not matching any other value defined on other branches.