Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Minor corrections to text

...

  • The solution implements a job named sorter that can be added at the start of any job chain.
    • This job implements a spooler_process() function that suspends all incoming orders.
    • This job is configured for a single task and with an idle timeout attribute. This means that it will execute incoming orders sequentially.
    • Having received the last available order this job will wait for the duration specified with the idle_timeout attribute for new orders. 
      • The idle timeout is configured using, for example <job idle_timeout="10"> with the sorter job definition.
      • Once the idle timeout has expired this job will execute its spooler_exit() function and then sort and move all orders that have previously been suspended.
        • Sorting is done in alphabetical order.
        • The orders are moved to the next job chain node that follows the sorter job in the job chain.
  • The download example uses a job chain named job_chain1 that includes the job nodes for the sorter job and a hello job. This job chain accepts ad hoc orders that are added by JOC and it can easily be modified to watch for incoming files and to create an order for each file.
  • Hint: to re-use the sorter job you can:
    • store the job in a central folder and reference the job in individual job chains.
    • move the job's JavaScript code to a central location and use a corresponding an appropriate <include> element for individual job scripts.

...

  • Add two orders to the job_chain1 job chain. 
    • Use an order id ID in descending alphabetical order, e.g. "cba" for the order id order ID of the first order and "abc" for the order id order ID of the second order.
  • Both orders will be suspended in at the first node of the job chain.
  • After an idle timeout of 10s both orders are will be moved to the next job node in the job chain. 
    • This time the orders are will be processed in ascending alphabetical order.

...