Introduction

  • The AddOrder Instruction is used in a workflow to create a new order for a different workflow.
  • By default added orders run asynchronously and in parallel to the current order in a separate workflow, i.e. their execution result is not synchronized and does not have an impact on the current order.
  • If the execution of the added order is to be synchronized then JS7 - Notice Boards can be used, see JS7 - How to make a job wait for completion of a workflow.
  • Strong Dependencies: Consider the example of Workflow 2 which should always be executed after Workflow 1 and which can be executed independently of Workflow 1. In this situation the AddOrder Instruction represents a strong dependency that guarantees execution of Workflow 2 for any execution of Workflow 1.
  • Weak Dependencies: Users who are looking for workflow dependencies that will apply under certain conditions only, can check the JS7 - PostNotices Instruction and JS7 - ExpectNotices Instruction for use with JS7 - Schedulable Notice Boards.

Workflow Instruction: AddOrder

Configuration of the calling Workflow

Workflow Variables

A workflow can include an AddOrder Instruction. Consider the workflow properties for holding, for example, two variables booking_code and flight_destination.


AddOrder Instruction Properties

The AddOrder Instruction can be added from the panel icon and can be added to any position in the workflow as shown here:


Explanation:

  • In the workflow job1 and job2 are executed and finally an order is added for the jduSequenceReceiveOrder workflow.
  • The Boolean flag Remain When Terminated can be used to suppress the default behavior where an order is made leaving the workflow on completion. This does not change the order's behavior of processing the workflow and making its execution history available. It simply means that the order remains in the completed state and has to be manually forced to leave the workflow. The latter operation is available from the JS7 - Dashboard and JS7 - Workflows views.
  • Arguments can be passed to order when being added. These have to be specified with the receiving workflow's variables (see the next section).
    • Individual arguments (names and values) can be added. Constant argument values can be used such as strings and numbers.
    • All variables of the current workflow can be added by using the Add All Arguments function.
    • If argument names of the calling workflow and of the receiving workflow do not match then arguments can be added as follows:
      • Assume the calling workflow uses a variable booking_code and the receiving workflow uses a variable bookingCode
      • For the assignment use the argument name bookingCode with a value $booking_code.

AddOrder Instruction Position

The AddOrder Instruction can be located at any position in a workflow.


Explanation:

  • This example makes use of an AddOrder Instruction in the middle of the workflow. This translates to the fact that the receiving workflow will be started in parallel to the current workflow after job1 has been executed.
  • The AddOrder Instruction can be used within any other block instructions such as JS7 - If InstructionJS7 - Fork-Join Instruction, etc.

Configuration of the receiving Workflow

The receiving workflow can be specified as shown:


Explanation:

  • This workflow specifies two variables booking_code and flight_destination.
  • As neither variable specifies a default value it is necessary for the calling workflow to add both arguments when using the AddOrder Instruction.

Resources

How To ... Instructions


  • No labels