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

...

:

  1. Click

...

  1. the folder 06_MutualExclusion 

...

  1. and expand the jdExclusiveLockSerial workflow.

    Image Modified


  2. To add

...

  1. an order

...

  1. to the workflow

...

  1. click the action menu of the workflow and

...

  1. use Add

...

  1. Order 

...

  1. from the drop-down menu.

    Image Modified

...



  1. When clicking Add Order

...

  1.  a popup window will appear.

...

  1. You can add

...

  1. an Order ID or leave the Order

...

  1. ID value

...

  1. empty, it will

...

  1. then use a default Order

...

  1. ID. Click

...

  1. the Submit button

...

  1. .
  2. 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..

    Image Modified

  3. To check the status of the

...

  1. order click

...

  1. the

...

  1. name of the workflow. This will make the Order History panel appear.

    Image Modified


  2. From the Order

...

  1. History panel

...

  1. you can

...

  1. verify if the

...

  1. order is successful and

...

  1. hasfinished. Click

...

  1. the Order ID to

...

  1. see log output created by jobs executed for this order.

    Image Modified

  2. A log view window will open and the order log will be displayed.

...

  1. This log contains

...

  1. output to stdout/stderr from all jobs executed by the order.

...

  1. You can download the log file by clicking the Download button

...

  1. in the upper right-hand corner of the log view window. Also, you can expand and collapse

...

  1. all job output using the

...

  1. chevron icons in the upper left-hand corner of the log view window.

    Image Modified