Discussion

Pegasystems Inc.
BR
Last activity: 20 May 2025 17:00 EDT
How to Add Current Operator as a Case Stakeholder
Introduction
In Pega case management, stakeholders are individuals or entities with a vested interest in a case. They can receive updates, track progress, and participate in the case lifecycle based on their assigned roles. Adding the current operator as a stakeholder is a common requirement when you want to ensure that the person working on a case remains informed about its progress, even when they're not actively processing it.
This article demonstrates how to programmatically add the current operator as a case stakeholder by calling the Work-PartyAddOperator activity from a data transform. This approach is particularly useful for automating stakeholder management and ensuring consistent application of your case participation rules.
Calling Work-PartyAddOperator from a Data Transform
You can call the Work-PartyAddOperator activity from a data transform to add the current operator as a case stakeholder. This method leverages the current operator's information to establish them as a participant in the case.
1. Create a Data Transform
First, create a new data transform or open an existing one in Dev Studio.
2. Add Steps to Set Parameters
The Work-PartyAddOperator activity requires specific parameters to identify which operator to add and what role they should have in the case. Setting these parameters correctly ensures the operator is added with the appropriate permissions and visibility.
Add steps to set the parameters for the Work-PartyAddOperator activity:
/* Set the pxRequestor in Pages & Classes */ Page Name: pxRequestor => Class: Code-Pega-Requestor /* Set the operatorID parameter to the current operator's ID */ SET param.operatorID = pxRequestor.pyUserIdentifier /* Set the role parameter to the desired role */ SET param.role = "Interested" // set the role you want to see in the case
3. Call the Activity
After setting up all the required parameters, you need to execute the Work-PartyAddOperator activity to actually add the operator as a stakeholder. This is done using the @pxExecuteAnActivity function.
After setting the parameters, add a step to call the Work-PartyAddOperator activity:
/* Call the Activity PartyAddOperator*/ Param.Success = @pxExecuteAnActivity("Primary","PartyAddOperator")
4 - Apply your data transform in the case type.
Add a Run data transform utility shape to your case flow and specify the data transform you created.
Conclusion
Adding the current operator as a case stakeholder programmatically through a data transform is an efficient way to ensure that operators remain connected to cases they work on. This approach can be particularly useful in complex case management scenarios where multiple operators may need to stay informed about case progress.
By leveraging the Work-PartyAddOperator activity and the current operator's information from the pxRequestor page, you can automate stakeholder management and create a more streamlined case handling experience. This technique can be extended to add other operators or to assign different roles based on your specific business requirements.
References
1. https://academy.pega.com/topic/case-participants-and-routing/v4)
2. https://academy.pega.com/topic/data-transforms/v6
3. https://academy.pega.com/topic/manipulate-application-data/v2)
4. https://docs.pega.com/bundle/platform-241/page/platform/case-management…)