Versions Compared

Key

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

The JS7 - If Instruction is used for the conditional processing. It evaluates the return code, return value of the previous job, and the order variable within the workflow. if-instruction allows using the else instruction optionally. If due to any reason the if-instruction fail the else will execute. 

In the workflow jdConditionalResult, two If-instruction is used first If-instruction has the expression $return_value_job1.toNumber == 0. With this, if job1 return value is equal to 0 then the If-instruction evaluates to true. The expression used in the second If-Instruction $return_value_job.toNumber > 0 with this if the return value from the job is greater than 0 then the if evaluates to true and continue the execution in the workflow.


To execute the workflow in folder 07_ConditionalExecution please follow the below steps:

  1. Click on the folder 07_ConditionalExecution from the and expand jdConditionalResult workflow.

    Image Added

  2. To add the order in the workflow. Click on the action menu of the workflow and click on Add order button from the drop-down menu.

    Image Added

  3. On clicking the Add Order. A popup window will appear. 
  4. You can add the Order ID or leave the Order Id value blank it will take the default Order Id to process the Order.
  5. With the help of Modify Variable button, you can edit the value of the variable assigned to the workflow.

    Image Added

  6. Click on the Modify Variable and select the variable name you want to modify from the drop-down menu. e.g; I have selected the variable return_value_job1 and the default value is 0. Here the variables are already declared you can change it according to you and click on Submit button to add the Order in a workflow.

    Image Added

  7. To check the status of the Order click on the Workflow name with this new Order history panel will appear. 

    Image Added

  8. From the Order history panel, you can see the Order is successful and finished. Click on the Order ID to open the detail logs of execution.

    Image Added

  9. A log window will open and the order log will be displayed. The order log contains log output from all jobs executed by the order. 
  10. You can download the log file by clicking the Download button from the upper right corner of the log window. Also, you can expand and collapse the individual job output using the arrow button from the left corner of the log window.

    Image Added