You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Introduction 

This example configures a job chain which is made up of three other job chains. The check_day job shows how to skip the middle job chain (on certain days).

Downloads


This example configures a job chain which is made up of three other job chains. The check_day job shows how to skip the middle job chain (on certain days).

Instructions

  • Unzip all files into the ./config/live folder of your JobScheduler installation.
  • Open the JobScheduler Operating Center, JOC, in your browser using http://scheduler_host:scheduler_port
  • Open the JOB CHAINS tab and enable "Show orders".
  • Find the job chain samples/meta_chains_skip/big_chain.
  • Click on that chain. In the right window you will see that this job chain consists of 3 other chains: chain_a, chain_b and chain_c
  • On the left side click on samples/meta_chains_skip/chain_a
  • Find the order my_order and press "Start order now" in the Order menu.

The order will now move through the 3 job chains. If today is the 12th day of the month, only the first job (check_day) of the chain_b will be executed and the rest of the job chain will be skipped.

Click on samples/meta_chains_skip/chain_b and enable show_order_history on the right side and view the log of the order that just passed through the chain. If it's not the 12th day of the month you should see that the order has moved through both jobs check_day and read_param.

  • Edit ./config/live/samples/meta_chains_skip/check_day.job.xml
  • Change day_of_month == 12 to check for the current day and save

Once JobScheduler has noticed the change in the configuration file, it will update the job definition. This may take up to one minute on non-Windows machines and may be accelerated by enabling "incl. hot folders" and pressing update on the web interface.

  • Start the order again as described above
  • Check the new log in the history of samples/meta_chains_skip/chain_b to see that the order skipped the rest of the chain.

How it works:

By setting the state field of the order to the end state of the current job chain, JobScheduler is forced to skip the jobs in between and to ignore the return value of the job and the next_state and error_state configuration of the job chain node.

  • No labels