Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Introduction

The JS7 - If Instruction

...

is used for conditional processing of orders. It can be used for example to evaluate the

...

return value of a previous job and it can be used to check any order variables. The If Instruction allows to use an Else Instruction that is executed in case that the condition does not match.

Workflow

In the

...

jdConditionalVariables

...

 workflow an If

...

Instruction 

...

is used for the following purpose:

  • The If Instruction uses the

...

  • expression variable( 'run_job1' ) == true. With this predicate, if the job's order

...

  • variable run_job1

...

  • is assigned the value

...

  • true then the If Instruction

...

  • evaluates to true

...

  • . This If Instruction is used to either run job1 or to run job2 depending on the evaluation result.
  • Find more details from the JS7 - Expressions for Variables article.


To execute the workflow from the folder 07_ConditionalExecution follow the steps described below

...

:

  1. Click the folder 07_ConditionalExecution and expand the jdConditionalVariables workflow.

    Image Modified


  2. Click the workflow action menu of the

...

  1. and use the Add Order menu item from the drop-down menu to add an order to the workflow.

    Image Modified

  2. When clicking Add Order a popup window will appear.
  3. You can add an Order ID or leave the Order ID value empty, it will then use a default Order ID. Click the Submit button.
  4. With the Modify Variable link, you can edit the value of variables assigned to the workflow.

    Image Modified

  5. Click the Modify Variable link and from the drop-down menu select the name of the variable that you want to modify. In the

...

  1. screenshot below the variable run_job1

...

  1. has been selected and the default value is false. The variable is declared with the workflow definition, you can modify its value by selecting it from the drop-down menu. Click the Submit button to add the order to the workflow.

    Image Modified


  2. To check the status of the order click the name of the workflow to make the Order History panel appear.

    Image Modified


  3. From the Order History panel, you can verify if the order is successful and

...

  1. hasfinished. Click the Order ID to see the log output created by jobs executed for this order.

    Image Modified


  2. A log window will open and the order log will be displayed. The order log contains the output of all jobs executed by the order.
  3. You can download the log file by clicking the Download button

...

  1. in the upper right-hand corner of the log view window. Also, you can expand and collapse

...

  1. all job output using the chevron icons

...

  1. in the upper left

...

  1. -hand corner of the log view window.

    Image Modified