Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Text revised to improve readability

Table of Contents
outlinh1. trueoutlinh1. true1printablefalse
2stylh1. none
3indent20px

...

This example shows the synchronization of tasks within separate job chains (crossover)

...

The following scenario is givenas shown in the following diagram:

  • First Job-Chain-1 is started with a start node and 8 tasks, some of them running in parallel.
  • Somewhat later Job-Chain-2 is started, also with a start node and 8 tasks, some of them also running in parallel.
  • Processing of both these job chains is also synchronized in a way that a task in one chain (Task 2 in Job-Chain-2) is waiting waits for the end of a task in the other chain (Task 6 in Job-Chain-1)
  • Both chains have to end successfully before Job-Chain-3 will start starts.

Creating job chains

Job-Chain-1, Job-Chain-2 und and Job-Chain-3 are implemented in JobScheduler as job chains by using editor JOE (, the JobScheduler Object Editor).

For the implementation the The following names are used in this example:

  • JobChain1: JobChain-Interlink-1 with the jobs JobInterlink-1-<n> , <n>=1-8
  • JobChain2: JobChain-Interlink-2 with the jobs JobInterlink-2-<n> , <n>=1-8
  • JobChain3: JobChain-Interlink-3 with job JobInterlink-3-1

The job chains appear as follows in JOE's Job Chain Steps /Nodes list:

 

 

Under Best Practice you may find some useful informations Detailed instructions for creating jobs and job chains can be found in Chapters 2 -4 of our JobScheduler Quickstart guide.

Parallel processing within the job chains

...

Synchronization of the JobInterlink1 and JobInterlink2 job chains

According to request the The job jobInterlink-2-2 starts should only start when the job jobInterlink-1-6 is has been successfully completed. Therefore we need This is achieved by adding a sync state after the job jobInterlink-1-6 and one before the job jobInterlink-2-2 with the identical state name and giving both states identical names: Sync_Interlink1_Interlink2.
As soon as the job jobInterlink-1-6 has finished, the synchronization is will be activated, the subsequent follow-on job jobInterlink-2-2 starts running will start and the branch of the parallel processing branch - including job the jobInterlink-1-6 comes job - come to its sync state.

Synchronization before the start of the third job chain

The third job chain is to be started only when both predecessor job chains JobInterlink1 and JobInterlink2 are finished successfully. This dependency is also realized with a sync job. We define the sync job Sync_Interlink12_Interlink3 and inserted the node after the jobs jobInterlink-1-8 and jobInterlink-2-8 in the predecessor job chains and before jobInterlink-3-1 in the job chain which is to be started.

Parameter for sync job 

Sync job parameters

The functions of  the Since JobScheduler version 1.7  the functionality of  the JAVA class com.sos.jitl.sync.JobSchedulerSynchronizeJobChainsJSAdapterClass has been extended in a manner Java class were extended with release 1.7 of the JobScheduler so that it is possible now  now possible to define a context for a sync job , i.e. . This means that the synchronization job is only valid within the job chain where the sync node is defined. For synchronization in parallel  processing (Split/Sync-combination)   the context is automatically restricted to the job chain automatically. Therefore  for a synchronization between job chains defined within  parallel processing this restriction has to be ignored by using the paramater  . However, this can be disabled using the disable_sync_context=true. parameter to allow synchronization accross job chains, as in the current example.

The disable_sync_context parameter is set to true in the In the example here the jobs Sync_Interlin1-Interlink2 and Sync_Interlink12_Interlink3 need this parameter set to true. jobs in JOE as shown in the following screen shot:


Graphic of the implemented job chains

...

Each of the three job chains requires an order to start. In this example we have a starter job chain with one job for each chain with this job generating is used to generate the order.

In these jobs the order command is used as paramter parameter with the name of the job chain as shown in the listings below. If necessary the path under the JobScheduler's LIVE folder could be included.

...