Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Diagram improved

...

Flowchart
main [label="Order:main_order",fillcolor="green"]
generate [label="generate",fillcolor="lightskyblue"]
add [label="Order:main_order_add-order",fillcolor="green"]
wait100 [label="waitJob A",fillcolor="lightskyblue"]
150 [label="150",fillcolor="lightskyblue"]
160 [label="160",fillcolor="lightskyblue"]
join [label="join orders",fillcolor="lightskyblue"]
200 [label="200",fillcolor="lightskyblue"]
success [label="success",fillcolor="orange"]

main -> generate
generate -> wait100 
wait100  -> 150 
150 -> join 
add -> 160 
160 -> join 
join -> 200 
200 -> success 

...

  • The required_orders parameter is read immediately by the Join Orders Job, which will then wait until the number of Orders specified in the parameter (here it is 12) have been processed.
    • Note that the Join Orders Job only counts orders that have the state of the Join Orders Job as their end state (here join).
  • The main_order moves to the generate_orders Job, which generates a total of 10 Child Orders.
    • This number is specified in a second parameter for the main_order - generate_orders.
    • 5 of these child orders start processing at node 150 and 5 will start at node 160. All the Child Orders will end at the Join Job.
      • The branch of the Job Chain the Child Orders are executed on is not important for the Join Orders Job.
    • All these Child Orders will be counted towards the required_orders parameter.
    • Child Orders are given an Id based on the Parent Order ID plus a string.
      • For example, the first generated Child Order in the example will be given the ID main_order_0.
  • The main_order itself then moves to the Wait Job A where it waits for a time specified in the main_order's wait_time duration_job_a parameter (here 35 seconds).
    • The sole purpose of this delay is to demonstrate that the main_order can reach the Join Orders Job after the other Orders.
    • This delay is not necessary for the functioning of the Join Orders Job and the example will work with the wait_time the duration_job_a parameter set to its minimum value of 1 (0 will cause an error).
  • When the main_order reaches the Join Orders Job it will be counted towards the number of Orders specified in the required_orders parameter, making a total of 11 after all the generated Child Orders have been completed.
    • Note that the main_order is the only Order that will be counted that does not have to have the state of the Join Orders Job as its end state.
  • The main_order will now be suspended at the Join Orders Job (without the Job being processed) until:
    • a further Order that has the state of the Join Orders Job as its end state is completed. 

...

  • This Job contains a script that generates the Child Orders (see lines 20 - 31 of the listing).
    • The Orders are alternated between the two branches of the Job Chain (even numbered Orders start at the Job corresponding with the Order state 150 and odd numbered Orders at the Job corresponding with the Order state 160). All Child Orders terminate at the Join Orders Job.
    • The total number of orders generated is determined by the generate_orders parameter.

...

Job A

The Wait Job A is configured to read the waitduration_job_timea parameter and execute a simple script (i.e. ping local host). This script causes the Job to wait for the number of seconds specified in the parameter.

...

The Parent Order, in this example, with ID main_order has the following 3 parameters:

  • required_orders
    • This parameter (Default 12.)
    • This parameter is required for the Join Job.
  • waitduration_job_timea
    • this is the time in seconds that the Wait Job A will wait before the main Order moves to the Join Job. (Default 35 secs.)
    • The wait_time The duration_job_a parameter is used in the Wait Job A as part of this example and is not necessary for the functioning of the Join Job.
  • generate_orders
    • this is the number of Orders that are to be generated by the generate_orders Job. (Default 10.) 
    • The generate_orders parameter is used in the Generate Job as part of this example to specify the number of Child Orders that should be generated. This parameter is not necessary for the functioning of the Join Job as the Jobs counted by the Join Job could come from any number of sources..

...