Versions Compared

Key

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

Introduction

The JS7 - Lock Instruction specifies the number of jobs for mutual exclusion to prevent such jobs from parallel execution. Exclusive Locks in the workflow block the resource and wait before executing another job until the locks are not released by the processmutually exclusive jobs, i.e. it limits parallel execution of jobs. Resource Locks in a workflow are used to limit job access to resources and to force orders to wait before executing a job. Orders wait until the Resource Lock is released by other jobs holding the Resource Lock. There are two types of locks Resource Locks available in the with JS7:

  • Exclusive Resource Lock: only one Lock Instruction can hold the Resource Lock at any given time. Any further Lock Instructions that try to acquire the same Resource Lock have to wait.
  • Shared Resource Lock: the Resource Lock is assigned a limit that can be shared by a number of Lock Instructions. Each Lock Instruction carries a weight that counts towards the Resource Lock's limit.

Workflow

In the jdExclusiveLockSerial workflow exclusive lock an Exclusive Resource Lock is used. In the workflow, lock instruction this workflow the Lock Instruction holds the lock, Resource Lock and other jobs with the lock instruction who acquire the same lock trying to acquire this Resource Lock need to wait until the lock Resource Lock is not released. 

To execute the workflow in the folder 06_MutualExclusion please follow the steps described below steps:

  1. Click on the folder 06_MutualExclusion from the and expand any of the workflows. Here I am using and expand the jdExclusiveLockSerial workflow.




  2. To add the Order in an order to the workflow . Click on click the action menu of the workflow and click on use Add Order button from the drop-down menu.




  3. On clicking the When clicking Add Order. A  a popup window will appear. 
  4. You can add the an Order ID or leave the Order Id ID value blank empty, it will take the then use a default Order Id to process the OrderID. Click on the Submit button to add the Order. Add the Two Orders in the workflow to see how the lock acquires the process and hold until it does not release the process.
  5. If you add a second order to the workflow, you can see that the Resource Locks are acquired and retained by the jobs executing the first order and that any jobs for the second order have to wait until the Resource Locks are released..



  6. To check the status of the Order order click on the Workflow name with this new Order history panel will appear. name of the workflow. This will make the Order History panel appear.




  7. From the Order history History panel , you can see verify if the Order order is successful and  hasfinished. Click on the Order ID to open the detail logs of executionsee log output created by jobs executed for this order.



  8. A log view window will open and the Order order log will be displayed. The Order log This log contains log output to stdout/stderr from all jobs executed by the Orderorder. 
  9. You can download the log file by clicking the Download button from in the upper right-hand corner of the log view window. Also, you can expand and collapse the individual all job output using the arrow button from the left chevron icons in the upper left-hand corner of the log view window.