Versions Compared

Key

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

...

  • The solution implements a job expect that can be added to the top of any job chain.
    • This job implements a spooler_process() function that checks if an order matches the expected value and that suspends non-matching orders.
      • Expected values can be provided by incoming orders
        • by use of parameters:
          • each incoming order is assumed to provide a parameter that contains the expected value. 
            • Example for use with oder parameter: business_date = 2015-11-01
          • the name of the incoming orders' parameter is specified as the value of the control_order_expected_parameter parameter to the expect job.
            • Example for use with expect job parameter: control_order_expected_parameter= business_date
        • without parameters: 
          • the job will expect a numeric order id to be provided and increments the order id to calculcate the next expected value.
      • For expected values a function has to be provided that calculates the next expected value:
        • the function is specified by use of the conctrol_order_expected_value_function parameter to the expect job. The function is implemented with some JavaScript code that returns the next expected value:
          • Example for numeric calculation: 
            • parseInt(currentValue) + 1
            • Explanation: the function parses the current expected numeric value and returns the incremented value
          • Example for date calculcation:
            • (new Date( (new Date(currentValue)).setDate( (new Date(currentValue)).getDate()+1 ) )).toISOString().substring(0,10);
            • Explanation: the function accepts the current date value, adds one day and returns the date in ISO format, e.g. 2015-11-01
      • For expected values a default value can be provided that is used to check the expected value of the first incoming order:
        • the default value can be specified by use of the control_order_expected_default_value parameter to the expect job.
          • Example for use with numeric default value: control_order_expected_default_value = 1
          • Example for use with date default value: control_order_expected_default_value = 2015-11-01
        • without specification of a default value the value of the first order processed by the expect job will be used as a default.
    • This job is configured for a single task, i.e. it executes incoming orders sequentually.
    • Having received an order with the expected value this job moves that order to the next job node in the job chain and activates any suspended orders to be re-evaluated checked to provide the next expected value.
  • The solution automatically creates a control order that is used to store the next expected value.
    • The name of the control order is created from the prefix "control_order_" and the job node state that the expect job is assigned.
    • The control order is suspended and not processed by subsequent job nodes. Its only purpose is to carry the next expected value for use of the solution with JobScheduler Agents and cluster members idle timeout is configured by <job idle_timeout="10"> with the sorter job definition.With the idle timeout being expired this job will execute its spooler_exit() function and will 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 sample makes use of a job chain job_chain_exoectedexpected_orders that includes the job nodes for the expect job and a hello job. The job chain accepts Ad Hoc orders that are added by use of JOC and the job chain can easily be modified to watch for incoming files and to create one order for each file.

...