Versions Compared

Key

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

The JS7 - If Instruction is used for the conditional processing of orders. It evaluates can be used for example to evaluate the return code, return value of the a previous job , and and it can be used to check any variables of 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. . The If Instruction allows to use an Else Instruction that is executed in case that the condition will not match.

Workflow

In the workflow jdConditionalResult, two If-instruction is used first If-instruction has  two If Instructions are used:

  • the first If Instruction uses the expression $return_value_job1.toNumber == 0. With this predicate, 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 from the folder 07_ConditionalExecution please follow the below steps:

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




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



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



  6. Click on the the Modify Variable and  link and from the drop-down men select the name of the variable name that you want to modify from the drop-down menu. e.g; I have selected the variable . In the below screenshot the variable return_value_job1  is selected 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 The variable is declared with the workflow definition, you can modify its value and click the Submit button to add the order to the workflow.




  7. To check the status of the Order order click on the Workflow name with this new Order history panel will appear. name of the workflow to make the Order History panel appear.




  8. From the Order history History panel, you can see verify if the Order order is successful and finished. Click on the Order ID to open the detail logs of executionsee log output created by jobs executed for this order.




  9. A log window will open and the order log will be displayed. The order log contains log output from all contains output to stdout/stderr 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 view window. Also, you can expand and collapse the individual job output using the arrow button chevron icons from the left upper corner of the log view window.