Featured post

GetNextWork functionality in pega

What is GetNextWork in pega? Pega provided a functionality to get the most urgent assignment(task) for user to work on. This is configured o...

Case locking in pega

What is case locking mechanism in pega?

Pega case locking prevents conflicts when a user attempts to submit cases that are already updated, this is "Default locking" strategy in pega. Allowing only one user to open the case and work while second user tries to open the same case pega displays a locking message saying that case is being locked by first user. However second user still can open the case in read only mode.When first user opens the case, case acquires the lock and by default pega locks the case for 30 mins or until user close the case or submit the case whichever comes first.

locking cases in Pega

In this situation, if we want to allow more than one user to open the case and work on "Allow multiple users"(Optimistic locking) option provides access to both the users. Lock occurs only when the user submits the case. When two users are working on the case, whoever submits first those changes will saved into system when other user tries to submit the changes pega displays a message with first user name and time. Second user has to refresh the case to reflect the first user changes and submit his changes.

Pega Case locking:

When you configure locking strategy on top-level parent case, if there are any child cases under it all the child cases adhere the lock setting from the parent case. If parent case has "Allow one user" locking setting and all child cases will have the same setting at runtime. 

For example: Service Request is the parent case and it has child cases "Parking" and "Roads".Both use the Allow one user locking option. When a user opens a Parking case, the case and the parent Service Request case are locked, you can override the locking setting at the child case level. This lets users make concurrent updates to parent case and their child cases without conflict.
If you set default locking mode (allow one user) at parent level and all the child cases will have the same locking mode but you can change locking modes in child cases.

If you set optimistic locking mode (Allow multiple users) mode on the parent case then all the child cases will have the same optimistic locking mode and you can not change/override the settings at child case levels.

Recommended approach is to lock the parent when some one is working on child case in all possible scenarios.
Choosing locking strategy depends on the business and requirements, if the case needs to be updated by multiple people we can go for optimistic locking knowing the risk of conflicts and need to accept and manage them.
How to configure case locking ?: Settings tab of Case type rule or case type rule (pyDefault) advanced tab in Locking section.

How to lock standalone cases: When a case is instantiated as a child case which is not actually a child case (standalone case) it doesn't inherit parent case locking options, we have to set the locking options on the case type rule advance tab of child case.


Where can we see the locking information: class is System-Locks points a table pr_sys_locks in PegaDATA.

case locking will not be there on  Pega Temporary case


4 comments:

  1. very interesting topic on case locking.

    ReplyDelete
  2. can we hardly unlock a case which belongs to another requester session ?

    ReplyDelete
    Replies
    1. We can unlock a case with OOTB activities like "System-Locks.Releaselock", it will release the lock on work item. We need to pass InsHandle to this activity.

      Delete
  3. If we have two independent case types. How can we control locking so that only one user can work on a case at a time?

    ReplyDelete