Versions Compared

Key

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

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

If you want to avoid prevent that two oders are running at the same time in different job chains then you have two options.:

  1. Merging the two job chains into one and set setting the attribute max_orders=1. See jobchain34 in  from the below example file. Please start order part3 and then try to start order part4 while part3 is running.
  2. Using semaphores
    Achiving To achieve this you have to create a job for entering the critical section. This job sets a semaphore. If free Should the semaphore be available then the job sets the semaphore and enters the critical section (the job chain). If not, a wair wait interval will be invoked. This job is the first job in the job chain.

Then you need a job for leaving the critical section. This job unsets frees the semaphore.

As a semaphore you can use a file (then setting is the semaphore maps to creating the file, checking is file existing and leaving is maps to verifying if the file exists and leaving the semaphore maps to deleting the file) or a an event or someting else.

Please note that it is important to execute the leave_critical_section job To unset the semaphore also in case of an error the error node should not only be an endstate end state but a node with the leave_critical_section job.
You will find an example in with the example file attached archive with jobchain3 and jobchain4. This example creates files to set/unset the semaphore for the critical section.
Here is Use the download link for the semaphore example. Please note that the scripts are running with windows os.
semaphore.zipthe Windows OS.