Use Locking Configurations

Default locking locks the case when an operator opens the case. If a second operator tries to open the same case, they get a message that the case is locked by the first operator. The second operator is able to open the case in review mode only. The lock is acquired when the case was opened by the first operator. No actions can be taken.

Optimistic locking enables both the operators to open the case. No lock is obtained when the case is opened. The lock occurs when the user clicks Submit. When two operators are working on the same case, the changes to the case are made by whoever submits the case first. The second operator receives a message with the first operator’s name and the time of the change. Also there is a refresh button that allows the second operator to get the new changes made by the first operator. The second operator’s changes are not applied until they click refresh and submit their action after the refresh.
In the Case Designer of the parent case, we can use the Locking option to set locking on the top most parent case. If the subcases are instantiated as part of the parent case, they have the same locking settings as the parent. The Locking option can be found on the Details tab of the Case Designer.

The Default locking timeout is 30 minutes but can easily be changed to a custom timeout as shown below.
we can change the custom timeout for the subcase, irrespective of the timeout settings in the parent case, for default locking configuration.
We can also set parent case locking in the subcase locking configuration. The default option is to lock the parent case when the subcase is being worked on. We can change this but the recommended approach for most use cases is to lock the parent when the subcase is being worked on. If the “Do not lock” option is selected, the parent case is not locked when the subcase is being worked on. The advantage of using the “Do not lock” option, both the parent and subcases can be processed simultaneously. The main disadvantage of using the “Do not lock’” option  is that  since the parent case is not locked, any properties related to the subcases, such as count of open subcases is not updated in the parent case. If this is not important and simultaneous processing is preferred, then select the “Do not lock” check box.
Any time we change to optimistic locking or change the lock timeout in default locking, we are using custom lock settings.  These locking settings are persisted on the Case Type record in the following properties, pyLockingMode, and pyLockTimeout. If the locking mode is default locking without a custom timeout specified, then the lock timeout is obtained by the Data-SystemAdmin setting
pxCoveredInskeys – This property holds the handles or pzInskeys of the subcases that are linked to the parent case. If needed, we can reference this value list property in our application. This might be useful if there is a need to list or identify all the subcases instances of a specific parent case.
pxCoveredCount – This property indicates the number of subcases linked to the parent. Anytime, a subcase is added or removed from the parent, the system automatically updates the value of this property. PRPC uses this property to indicate whether a parent case contains subcase instances and behaves accordingly.
pxCoveredCountOpen – A standard property that holds the number of subcase instances within a parent that are not resolved yet. As the subcases are being resolved, PRPC keeps this count updated automatically. This property value is used to ensure that there are no open subcases within the parent case. 

CREATING AND EDITING FLOWS

ADVANCED FLOW PROCESSING

SCREEN FLOWS

WORK STATUS

Every case instance must have a status, which changes as the case instance progresses through stages and flows associated with the steps. PRPC provides several standard work status values. We can also create our own statuses.There are four broad categories of work status values:
  • New  (a green Flag)
    • A “New” work status indicates that the case instance has just been created and has not been reviewed or qualified for processing.
  • Open(a blue Flag)
    • The “Open” status indicates that the case instance is being processed by the organization which is supposed to process it.
  • Pending(a red Flag)
    • The “Pending” status indicates that the responsibility of processing the case instance is currently with an external organization. So the processing of the case instance is suspended until the external organization or group has done its part.
  • Resolved (a checkered Flag - finish)
    • A “Resolved” status is generally the final status for a case instance as it indicates the completion of the work. Usually, a case instance in a “resolved” status is not modified by any later processing. Resolved items are stored in the database and no longer appear on a work list or in a workbasket. Users can work on a resolved work item; but first it must be reopened.
A few standard values are defined in each category. To access them, click Designer Studio > Process & Rules > Processes > Status Values. 
We can also define more status values through Field Value rules(pyWorkStatus). When doing so, we need to make sure that we start each value with one of the words New, Open, Pending and Resolved (using the initial capital). From any of the explorers, create a new rule instance under Data Model > Field Value.

Use PRPC Standards to Update Work Status

Most flow shapes, including Start, Assignment, End and Smart shapes, provide a means to set or update work status. To set or update the property Work-.pyStatusWork value, do not use the “property-set” activity method or use a data transform rule to set a value for this property, but instead, use the Properties panel of the flow shapes. The “Status” tab on the panel allows us to define the new work status value by providing a value in the “Work Status” field. This is the preferred way.

As a best practice, the status for an assignment shape should never be set to “Resolved” because the work item’s status is updated when the assignment is reached. If the status is resolved, the user is unable to perform any additional work on it.

When the work status is set on a shape, we will see the status flag indicator on the connector leading to that shape in the flow rule.
The flow “End” shape provides two fields: “Flow Result” and “Work Status.” Make sure to use “Work Status” for this purpose.  If the flow belongs to the last step of the “resolution” stage, work status is one of the “Resolved” status field values, such as “Resolved-Completed,” “Resolved-Withdrawn,” “Resolved-Canceled” etc.
When we set the work status of a case, PRPC uses the standard activity Work-.UpdateStatus to update the value of the property Work-.pyStatusWork.
An activity is a sequence of structured steps, designed to automate some aspect of case processing. The activity Work-.UpdateStatus, which can also be called from a flow utility shape, changes the property directly and calls some standard activities such as Work-.Resolve if the status value is one that started with the word “Resolved”.
There are also a few standard rules which call the Work-.UpdateStatus activity. Activities such as Work-.WorkBasket and Work-.Worklist which place an assignment in a workbasket or worklist respectively, also call Work-UpdateStatus.

Key standard functionalities which leverage the Work Status
When a case instance/work item status is first updated to a “Resolved” status, PRPC calls the Resolve activity automatically. This activity activates the “Status-Resolved” ticket.  Another particular standard ticket is “AllCoveredResolved.” If a subcase status becomes Resolved, the immediate parent case is checked. These standard tickets are covered in the “Tickets” lesson. 

PRPC also automatically maintains three standard properties in Work-class. They are pyElapsedStatusNew, pyElapsedStatusOpen and pyElapsedStatusPending. These properties contain cumulative time in seconds that a case instance has had a status value that started with the word “New”, “Open” or “Pending” respectively.

WORK PARTIES

A work party represents an entity that needs to be notified about the progress or status of work.
When a case is created as part of a new application through the Application Express wizard or added to an existing application through the case addition menu in the case explorer, the system creates a default Work Parties rule for the newly created case. This rule can easily be configured from the Details tab of the Case Designer.
edit link displays the “Parties”
 By default, PRPC adds three roles, Customer, Owner, and Interested with the appropriate default properties values in the Work Parties rule instance for the case on which we are working.
Each row defined represents a person or an entity that can participate or be interested in the case instance progress. Each row concisely describes a role and their part in the process.
  • role can be standard roles such as Owner, Customer etc., or we can create more specific roles such as LoanOfficer.
  • The Description is the unique name for each of the roles we see displayed in the user interface.
  • The Party Type field references the data class that contains the properties we’ll use to store the work party information. We will see the details of the Party Type later in this lesson.
  • The Model field is optional and is a data transform rule that defines the initial properties of our work party when adding the work party to a case instance.. It causes the system to set initial values for some properties of the work party. We will learn more about this later in this lesson.
  • The “Display on Creation” checkbox can be selected to if we want the work party to appear at runtime when the case instance/work item entry form first appears.
  • The “Required” field indicates that this party must be present in every new case instance/work item.
  • The “Allow Multiple” check box, when selected, allows for the addition of multiple instances of a single work party role. Simply specify the role you want to repeat in the field. This, for example, is useful if we want to add dependents to an auto or life insurance policy.
When we open the case type rule, we notice that it references a work parties rule named “pyCaseManagementDefault”.
Work Party Data Structure
The Party Type on the configuration form of the Case Designer, can be one of the following: Party/Company, Party/Government, Party/Operator, Party/Non-profit, Party/Person or it can be any other custom party that you create.
Party Types are defined in PRPC as instances of the Data-Party class or one of its sub-classes. Process Commander organizes the Data-Party data into meaningful categories.
  • Data-Party-Com for business organizations, and the Party/Company Party Type roles are instances of this class.
  • Data-Party-Gov for Government organizations, and the Party/Government Party Type roles are instances of this class.
  • Data-Party-Operator for PRPC application users with an Operator ID record, and the Party/Operator Party Type roles are instances of this class.
  • Data-Party-Org is reserved for the non-profit organizations, and the Party/Non-profit Party Type roles are instances of this class.
  • Data-Party-Person is designed for any person who is not however a PRPC application user, and the Party/Person Party Type roles are instances of this class.
We can create our own sub-classes (either direct or pattern inherited from Data-Party) if we need to expand more categories of work parties for our application, like Employee, Manager or Dependent as shown below.
The drop down for the model shows the data transform rules. The data transform rules defined in the class related “Party Type” field or in one of its parent class show up as entries in the Model drop down

A substantial set of Work party properties are delivered with PRPC. A few properties are required, such as:
  • pxPartyRole, which identifies the role of the party.
  • pyWorkPartyUri, which uniquely identifies the party.
  • pyEmail1, which Pega 7 uses to send notifications to the party. If we don’t provide a value for pyWorkPartyUri, Pega 7 uses pyEmail1 to determine a value when validating the work party using the standard activity Data-Party-.Validate. 
Some commonly used – though not required – properties include pyLastName, pyFullName, and pyAddress.
Add a Work Party to a Case Instance
In the parties configuration of the Case Designer, if we marked a Party Role as “Display on Creation,” (or “Required,” which automatically marks “Display on Creation”) the work party is created when the case instance is created.
We can see the Work Parties information in the standard perform harnesses on the right hand side at runtime of the case instance creation.
We can click the “Edit” button to add more work parties or update existing work parties to the case instance at runtime.
Flow has reference to work parties rule
The Work Parties rule listed in the case type rule takes precedence if a different rule is referenced in flow.
If we uncheck the “Skip create harness”, then when the case instance is instantiated, the new harness displays first, before the actual case is instantiated.
In New harness - We can edit existing work party or add new work parties in this new harness as well, such as the perform harness.
If the perform harness is customized or some other harness is used and if we don’t have the capability to add a work party at runtime, we can either include the “Work- • pyWorkPartiesWrapper” section rule wherever we want or we can use the “AddParty” flow action as local action at the assignment level,the flow level, the stage level or the case level. Below is the configuration at the assignment level local action.
At runtime, from other actions menu, we can click on the “Add a party” link and this brings the same section to edit existing parties or to add new parties just as we saw before in the new harness and the perform harness.
Once the work parties are added to a case instance, we can send correspondence or route an assignment to the parties. Correspondence and routing are covered in other lessons in this course.