and three jobs job1, job2, job3 where job1 uses the testLock exclusive and the other jobs use lock non exclusive.
You can download this Example here.
We start the jobs in different orders to see what happens:
We assume a lock maintain with an unlimited number of non-exclusive jobs and we assume the jobs job1 and job2 to have acquired the lock maintain in non-exclusive mode.
See above how to create the lock in JOE and how to assign the lock to a job in non-exclusive mode.
Both jobs start in the same way as without the lock because they use it non-exclusively and the maximum number of non-exclusive jobs is unlimited as the lock is configured for unlimited non-exclusive use.
In this example a job chain is added with a job that modifies the maximum number of non-exclusive jobs. This job chain has two orders:
If the maximum number of non-exclusive jobs equals zero then no job will start that uses this lock.
Therefore with the sample you receive one order is used to to lock both jobs and another order is used to release the jobs.
If a job uses a schedule that is configured to start the job while it is locked then the job is moved to a task queue for later execution.
As soon as the job is released then all planned starts from the task queue are executed.
We assume that you have jobs that required the same resources, e.g. a database table or the same remote host for SSH jobs, and that you would assign them the same lock.
If this resource is not available for a specific time then this example shows a way how to lock these jobs.
This example is further a possible method for a planned maintenance.