Decision

The Decision job type uses basic operators to evaluate attributes of an entity or input XML. Based upon the result of the operation (aka ‘decision’), the indicated jobs will be processed. Apart from decisions based on entity of XML attributes, decisions can be made on type of event or alert that triggered the decision job or by the number of entities selected for processing.

The following Job Parameters may be specified when defining a Decision Job Definition:

  • Parameter 1 - Decision Parameters (Required): Specifies the parameters on which decisions will be based. Defined as VariableName:Source pairs with semi-colon as the separator between two pairs. This value is not case sensitive. Supports attributes from ESC (API or SQL) or input XML or any other attributes of the entity itself, which may not be extracted from the ESC or input XML. It also supports attributes of the result output from the previous job. To use any value from the previous job’s output, the following format must be used as the source:
  • \\INPUT.<xml/json hierarchy structure>

    Note: <xml/json hierarchy structure> represents the element whose value is being sourced.

    If the Decision job is initiated by an Event Notification, and decision is to be made based on the Event Notification type, the keyword ‘EventType’ should be used as the source. See Event Type Example.

    If the Decision Job is initiated by an Alert, and decision is to be made based on the Alert Type, the keyword ‘AlertType’ should be used as the source. See Alert Type Example.

    If the decision is based on the number of entities being processed (from ESC or UI selection), the keyword ‘EntityCount’ should be used as the source. See Entity Count Example.

  • Parameter 2 – Decision Rules (Required): Set of formulae/equations/expressions using the variables (from Parameter 1), mathematical and logical operators (aka ‘condition’) and the Job ID to be executed if the condition evaluates to ‘true’. This value is not case sensitive.
    • Use colon (:) to specify the job ID to be executed when the condition passes

    • Use semi-colon (;) as the separator between rules

    • Allowed mathematical operators: +, -, /, *, ^ , on one or more variables defined in Parameter 1

    • Allowed logical operators: =, <>, <, >, <=, >=, || (for ‘or’), && (for ‘and’).

      For example, the string “var1 >= 100: job1 ; var2 < 100 : job2” can be read as “If var1 is greater than or equal to 100, execute job1; if var2 is less than 100, execute job2”.

    • Use parentheses ‘( )’ for complex computations and conditions.

    • You can specify a default job to be run when none of the conditions match using the keyword ‘default’.

      For example, “Commodity = ‘CHEM’ || Commodity = ’EXPL’ : Job1; default : Job2”. Can be read as “If the Commodity value is ‘CHEM’ or ‘EXPL’, Job1 will be executed. Otherwise, Job2 will be executed.”

    See Example scenarios for Decision job.

If the Next Job on Success field is defined at the Decision job definition level, it will be ignored.

If the Next Job on Failure field is defined at the Decision job definition level and:

  • If Decision job is part of a Chaining job, then it will be ignored.

  • If Decision job is not part of a Chaining job, then Job ID specified in Next Job on Failure will be executed if the decision job fails.

Entity Selection Criteria Usage

Entities could be selected from UI (that is, input override data) or from the ESC or from input files.

Note: For more details, see the "Job Server" topic in the Transportation Manager System Administration Guide.

See Also

Job Types
Job Server