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

Split For Each shape in pega

Parallel processing in Pega

We can allow users to perform multiple tasks independently to complete the work, in pega we can this as parallel processing. In a stage or flow rule we can add smart shapes to achieve this parallel processing.

Smart shapes in pega

Pega has defined some smart shapes like Split JoinSplit-For-Each and Spin-Off. We have to use these smart shapes in sub process shape. Each shape can call one or more processes to proceed in parallel.

Split For Each shape in pega
Split for each allows us to run single process multiple times by looping though a Page List or Page Group.
Main flow continues when processes on the PageList/PageGroup processed.
split for each shape in pega
Will explain with an example: In a Service Request case type when the user submits a request it should be going for the inspection process. Used Split Join shape to fulfill this requirement with two sub processes. When all sub-processes are complete, main Service Request application process can continue to Review stage where the management team will review the inspection report. In the Review stage, Inspection report will be reviewed and approved by various Reviewers. To fulfill this requirement we are using Split For Each shape and providing Reviewer details in a PageList. Pega will use this PageList and iterate the process. We can define join conditions for main flow to resume.

split for each in case type

How to configure Split For Each in pega

From the Diagram tab of flow rule - Advanced Shapes, we can choose Split For Each shape.
split for each shape in flow rule


Configure split for each shape properties by selecting PageList/PageGroup property, sub-process and join type.
split for each shape properties

ReviewOfficers is the PageList it is formed before executing this shape. Pega will loop the page list and creates sub-processes (assignments) and assign them accordingly. 
We have three Reviewers in the PageList (ReviewOfficers ) Split For Each shape will create "ReviewInspectionReport" process and send to each reviewer on the list.

Join Type:
All      -     Main flow waits for each sub-processes to complete.
            Ex: Main flow (Service Request main flow) resumes after ALL the reviewers in the PageList completes their review.

 Any    -     Main flow waits for any one of the sub-process to complete. At that time, processing of the other sub-processes that have not completed is stopped. Open assignments for these sub-processes are cancelled.
           Ex: Service Request case type will resumes and moves to next step, if any of the Reviewers completes their review. In this case, other reviewers assignments will be cancelled and process will be stopped.

Some   - Waits for a when condition to return a true value, or a specific number of flows to return a status value that you provide.
Ex: If you want to resume main flow based on a WHEN condition OR based on the Count.
On WHEN - Main flow resumes on the true result of a when rule.
On Count   - Main flow resumes after specified number of processes completes with a specific status.
We need to define the Number and status.
Ex: If you want the main flow to resume after two Reviewers Approve the assignments with a status of "Review-Approved".

Iterate - SplitForEach will loop PageList/PageGroup results one by one and creates items one by one.
         Ex: ReviewOfficers PageList have 3 reviewers (results), pega will create an assignment for First reviewer and once the First reviewer completes the assignment, it will iterate the page list and creates an assignment for second reviewer and so on. To stop the loop (iteration) we can give the WHEN condition in "Exit iteration when" field.

Note: Pega uses MaxFlowLoopCount Rule System Setting (RSS) to control the maximum number of iterations/loops to stop infinite loops. 

Let's create a Service Request case and send the inspection report to Reviewers for their review and approval. Join Type is ALL.

split for each case creation in pega

By using split for each shape, pega has created three processes (assignments) by looping PageList results. After ALL the assignments completes, main flow will resume and proceed further.

Related topics in parallel processing:





No comments:

Post a comment