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

Compare with Current View Page History

« Previous Version 2 Next »

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

  1. Merging the two job chains into one and set the attribute max_orders=1. See jobchain34 in the example file. Please start order part3 and then try to start order part4 while part3 is running.
  2. Using semaphores
    Achiving this you have to create a job for entering the critical section. This job sets a semaphore. If free sets the semaphore and enters the critical section (the job chain). If not, a wair 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 the semaphore.

As a semaphore you can use a file (then setting is creating the file, checking is file existing and leaving is deleting the file) or a 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 but a node with the leave job.
You find an example in the example file with jobchain3 and jobchain4. This example creates files to set/unset the semaphore for the critical section.
Here is the download link for the semaphore example. Please note that the scripts are running with windows os.
semaphore.zip

  • No labels