You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

User Inputs

Setting any Input to ‘user given’ indicates that this parameter must be supplied by the user who executes this workflow, regardless of whether the step where it is introduced is ever executed.

When the ‘user given’ option is selected the form changes to show an additional field where this variable can be named.  These variable names are global in scope, and the same name used multiple times will refer to the same variable.  For example if your variable is ‘customer_name’ and it is used in three separate steps, the workflow will only request ‘customer_name’ once and use it in all three instances.


Conditions and Routing

The ‘Conditions & Routes’ section examines the data returned as the result of a workflow step and decides which step is next.  The workflow creator can define an unlimited number of separate conditions leading to different next steps, and each condition can consist of an unlimited number of individual comparisons.  The system evaluates each condition in order, from top to bottom, and immediately proceeds when it finds a match.

The “add condition” button in the upper-left is used to create a new condition.  Each Conditions & Routes section can have an unlimited number of routes defined. Individual routes can be removed by clicking the trashcan icon at the right, and the route can be renamed by clicking on the existing name in the header.

At the bottom of every Conditions & Routes section is a “Route” section which dictates which step the workflow will be directed to if these conditions are met.

Each routing section is evaluated in order, from top to bottom, until a match is found.  Once a match is found the system proceeds to the indicated step without evaluating further conditions.  Multiple matches are not checked for. If no next-route is found, the workflow errors, possibly triggering a rollback.

Initially each condition consists of a single comparison clause.  All comparison clauses consist of a ‘left value,’ which indicates source data, an ‘operator,’ which defines the nature of the comparison, and a ‘right value,’ which denotes the comparison data.

Both the ‘left value’ and the ‘right value’ areas can accept data from a variety of sources.  The options are:

  1. http code:  uses the HTTP code returned by the API call in the step.
  2. body:  accesses some value in the body of the API request.  Parameters are accessed by name, and arrays are accessed by “$index.parameter” as elsewhere.  (ex: the name of the first object in an array would be ‘0.name’)
  3. default value:  a static, default value defined by the workflow creator
  4. user given:  a value which must be supplied when the workflow is invoked
  5. workflow link:  a reference to data obtained in a previous step
  6. function:  indicates that the data for this field is the output of a data-processing function.  These functions are described in greater detail later in this document.


The ‘operators’ are self-explanatory boolean comparators, but a few require special syntax:

  1. The operators IN and NOT IN accept comma-separated arrays (ex: one,two,three) for their values.  See “Getting Started 8. Compound Branching Conditions” for examples.
  2. NULL, NOT NULL, TRUE, and FALSE do not require a right-hand value.
  3. BETWEEN and NOT BETWEEN accept a tuple with the format “minvalue,maxvalue” (ex: ‘200,299’ for valid HTTP codes).
  4. We should get Tony to talk a bit on what happens using numerical operators on strings.


The add-clause button (the plus symbol) and the remove-clause button (the minus symbol) on the far right allow you to join individual clauses into a compound clause, like “if A or B” or “if A and B and C”.  Once clicked, the add clause button creates a new clause below the last existing clause.  

At the far right of each comparison clause is a drop down that dictates how this and the next clause are to be joined.  The drop-down contains two operators, AND and OR, which join the two conditions as advertised.


Output

The Output area is always the final section in every workflow and determines what data is returned to the user when the workflow is invoked.  The workflow can be configured to return individual fields, entire arrays, individual members of arrays, and the entire body return from the executed steps.

The “add parameter” button allows you to populate the Output area with individual return parameters.  There is no limit on how many parameters can be returned by a single workflow.  

Each Output parameter consists of a number of parts:  the parameter name, the parameter type, and the type details.  Each parameter requires a distinct name. This is the name used in the return payload.  

The parameter types field is similar to those in the Optional and Required Parameters section.  You can define a parameter to draw its data either from a workflow link, a function, user given data, or a javascript function.  These functions are more fully described in the Optional and Required Parameters section.

Parameters can be removed by clicking the trashcan on the right.


  • No labels