Skip to main content

Handling flow changes for cases in flight


5 Tasks

30 mins

Visible to: All users
Advanced Pega Platform 8.5 English
This content is now archived and is no longer updated. Progress is not calculated. Pega Cloud instances are disabled, and badges are no longer awarded. Click here to continue your progress in the latest version.


Front Stage's Booking application has been in production for a while and the number of event approval requests has increased. Front Stage hired three executive officers to accommodate the increase. The First executive officer is authorized to review and approve requests for fewer than 5,000 attendees. The second executive officers approve requests for attendees between 5,000 and 10,000. The CEO approves requests for events with more than 10,000 attendees.

Front Stage wants any existing cases awaiting executive approval to be distributed according to the new requirement shortly after the new code is released into production.
The following table provides the credentials you need to complete the exercise.

Role User name Password
Admin admin@booking rules

Implement a change to satisfy the new requirement. Elaborate on solutions for identifying cases in flight affected by the new configuration, and reposition them to the appropriate location in the flow. Set up test cases to verify that the change works for cases in flight.

Detailed Tasks

1 Identify design options

If the number of attendees for an event is less than 5,000, then the case is routed to the first executive officer for approval. If the number of attendees is between 5,000 and 10,000, then the event case is routed to second the executive officer for approval. If the number of attendees is more than 10,000, the event case is routed to the CEO user.

Option 1: Three Single Approval flow type shapes

Add three approval flow shapes and fork the shape with a single-level approval flow type for each of the flow shapes.

Create three when rules IsFirstExecutiveApproval, IsSecondExecutiveApproval, and IsCEOApprovalRequired. Use the rules in the fork shape

In the first approval shape, the route to the specific user ExecutiveOfficer1@Booking if attendees are fewer than 5,000.

In the second approval shape, the route to the specific user ExecutiveOfficer2@Booking if attendees are between 5,000 and 10,000.

If the attendees are greater than 10,000, the route to the CEO.

It is required to reposition existing cases to the appropriate location in the flow using the below activity. This is a one-time activity that is part of the production ruleset and is executed manually after the latest flow rule is deployed into a production environment.

Maintenace activity helps identify in-flight cases that are positioned at the Executive Review flow step. The activity restarts the flow for those cases so that the cases are routed according to the new logic.

In this activity, leverage the D_Worklist out-of-the-box (OOTB) data page, which takes OperatorID as a parameter. By passing the CEO@Booking operator ID to this data page returns any existing cases that are awaiting executive approval. Iterate on the data page and open each awaiting case by using Obj-Open-byHandle. Call the pxRestartStage OOTB activity, and perform the Obj-Save method and call CommitWithErrorHandling OOTB activity.

Option 2: Update flow rules and leave old wait points (assignments, subprocess)

Drag old shapes off to one side and delete incoming connectors to the shapes. Keep outing connectors from the shapes intact. New work objects never reach the outdated shapes, but the work objects at older assignments still follow the same path.

You can later run a report that checks whether the old assignments are no longer in use. If so, you can then remove the flow wait points.

Option 3: Circumstance flow based on a date property

Create circumstancing flow rules based on date property rather than property. On the old flow rules, clear the Creates a new work object check box and on the new flow rules, select the Creates a new work object check box. New work objects are based only on the new flows.

You can clean old rules once you are certain that there are no inflight cases running with old flows.

2 Evaluate design options

Design Pros Cons
Three Single Approval flow type shapes
  • Leverage Single approval type and route to a specific user 
  • Difficult to maintain if the number of approvers increases
Update flow rules and leave old wait points
  • Easy to implement by adding new flow shapes to the same flow rule
  • Difficult to maintain if there are more dangling assignments
  • Need to be careful and don't delete old assignments.
Circumstance flow based on a date property
  • Straightforward to implement
  • Not recommended if there are deeply nested subflows

3 Recommend the best design option

Use Option 1, three Single Approval flow shapes, to route the case to appropriate executives based on the number of attendees.

4 Review solution details

To review the implemented solution, switch the application to Booking InFlight when you are logged in with the Admin@Booking operator.

Fsg approval flow
Executive Approval


Restart Stage From Worklist activity


5 Perform the following tasks

To complete the assignment, accomplish the following tasks.

  1. Create test cases with 3000, 6000, and 11,000 attendees and advance the cases to the executive approval stage.
  2. Log in as Admin@Booking.
  3. Create a new Executives@FSG workgroup and set the Manager IDs to CEO@FSG.
  4. Associate the new Executives@FSG workgroup with a new Executive@FSG work queue.
    Field Setting
    Short description Executive Officer 1
    Operator ID ExecutiveOfficer1@Booking
  5. Click Create and open to create the operator ID.
  6. On the Profile tab, change the Full Name to Executive Officer 1 and the Email to [email protected].
  7. On the Work tab, add Workgroup to Executives@FSG.
  8. Save the new ExecutiveOfficer1@Booking operator ID.
  9. Repeat steps 4-8 for ExecutiveOffice2.

Available in the following mission:

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice