“Hey!  A notification popped-up!!

Notification is a common term we all have come across in our daily life through email notification, whatsapp notification etc. Let’s narrow down our view to email notification. Notifying a single participant is usual but have you ever thought about how the same notification is being sent to different participants at the same time? In google  world it’s possible by adding participants to” TO CC and BCC” . What about in pega world ? Let’s explore how pega handles this…

This article illustrates how multiple work parties can be created in pega.

Example Scenario

 Imagine, you are a college student who decided to take part as a team  in a technical event conducted by an external college.They want you to complete your registration prior to the event. One representing the team registers for the event along with team member details.Once the registration done, sending the confirmation mail to the representative is easily achieved through workparty. Now, the question is, how can we send the same confirmation mail that has to be sent to all team members registered?.Pega handles this scenario using multiple workparty.

Let’s explore how pega creates this magic using multiple workparty.


 Step 1: 

Create a case type (Eg: Multiple Workparty) and provide a stage name as “New Request”. Add a collect info step name it as Provide Team Details. Add another step by following the path: add step—-> More—->Automation—>Send email—-> click Select. Hurray! We are done desigining our case life cycle.

 Step 2 : 

Create a datatype “Personal Detail” via clicking Data explorer—> add datatype—->give the label as Personal Detail—>Submit.Once done with creating datatype create the necessary fields as shown below.

Step 3:

 Configure the provide team detail section by adding pagelist  property as “Team members” and adda drop down control as “event”(optional)

 Finally the section resembles as below

Also create  one integer property called Index for iterating over the pagelist and set it value to 1 in pyDefault Data transform

Now it’s time to configure the need of an hour!!! Guess What ? It’s  Workparties.

Step 4 :

Go to  app explorer—>under case type(Eg: Multiple Workparty) class—->Process—->pyCaseMangement Default.

Under the valid parties tab provide

Party Label : Student

Role: Student

Party Class: Data-Party-Person

Data Transform :CopyStudentDetail –>click gear icon —> Create and Open.

Step  5:

    Create the CopyStudentDetail data transform as below:

                         TARGET                  SOURCE
              pyWorkPage.IndexpyWorkPage.Index +1

Once done with creating Data Transform check whether it resembles as below:

How this data transform Functions:

We are setting the role of a Student in the  pxPartyRole property.We define “primary”  in the front to indicate that pxPartyRole is from the current class(i.e data-party-person class).

We are referring to the Page name as pyWorkPage and Class name as”MyOrg-Demo-Work-MultipleWorkparty” under the pages and classes tab in order to retrieve the property from the work class.

The second step sets the subscript to the student workparty in clipboard as (Student_01, Student_02 etc…). These will be used as subscripts for the page group property called pyWorkParty under pyWorkPage.

pyWorkPage.TeamMembers(pyWorkPage.Index).FirstName –  This is used to retrieve the value of First name  under Team member pagelist property  from work class. Since it’s a pagelist property we are providing the subscript by using the value setted in Index property.

Similarly it iterates for every team member to set first name, last name,and email.

Index+1 -, Index value is incremented by 1 after every iteration in the last step

Hurray!! We have successfully configured Workparty!!

Step 6

 Now, We have to call this work party in an activity, Go to Records—->Technical –>Activity. Provide label as “CreateStudentParty” then click create and open.

Use Obj-save method to save pagelist property. In the loop use “for each embedded page” and provide the data class. This is for saving every page in the list of pages in the data class. Expand the arrow and “Enable the Write Now” checkbox. In the step page provide the pagelist property which you want you save (Eg: Team member)

Thus,we have saved the pagelist.Now we will proceed with calling the student workparty.

Use the call method to call the OOTB addWorkObejectParty.Expand the when bar and specify party role ,class ,data transform name.

The Key Difference: Do not forget to “Enable PartyRepeatable Checkbox”. This will create the multiple parties for the same role.

Call this activity in the Post Processing of flow action of Provide Team Details and Save it.

Call the Student Party in the case type as mentioned in image.

Hurray!!! The implementation part is done!!! Let’s run and check it.

Run the Multiple Workparty case type and enter first name, last name, email & phone number then click on submit.

Felas!!! Under the stakeholder tab , you will be able to see multiple parties created.

Go to clipboard —->pyWorkPage—> pyWorkparty you will be able to see the list of three parties created and you can also see the team member pagelist for 3 people is also created.

Happy Learning!!!