In this post we will see in detail about Get Next Work functionality.
Why Get Next Work?
- Imagine I am an employee working for a bank. The bank uses Pega application to service the customer.
Let me take the loan request scenario, which I used in my previous post.
Please go through the below link to know more about the scenario.
- So my role is bank employee.
- I have to pick the cases from the loan request workbasket and process the cases.
- Here I may not know the urgency of any cases. I can pick some random cases and start processing. I can also process my relative loan request 😛
In order to avoid this, Get Next Work was introduced.
Get Next Work pulls the assignment from either workbasket or worklist and sends to employees to work on.
Advantages of GetNextWork?
- Most appropriate assignment will be selected to work upon.
- Promotes user productivity and increases customer satisfaction.
- Automated support of work processing
Usually the order of work processing in important factor in many organizations. Get Next work gives you the solution.
So a bank employee comes to office, login his system , Open pega application and click GetNextWork. He will get the assignment to work on.
As I mentioned the assignment can be from any workbasket or even from this worklist 🙂
What are the deciding factors in GetNextWork?
Configuration in Operator rule form
- As I mentioned, GetNextWork can pull cases from workbasket or worklist, but who gets priority?!
- This is decided in the operator rule form – Work tab.
Get from workbaskets first – This is the key configuration.
True – GetNextWork searches assignment from workbasket, If none matches criteria then it goes to check in worklist.
False – GetNextWork gives first priority to worklist.
Now, we need to decide on which work baskets should GetNextWork search?
You can do in 2 ways.
1. Specify the workbaskets in the workbasket array and leave Merge workbaskets unselected.
It means GetNextWork searches the assignment in the workbaskets in the order mentioned in the above array.
2. Merge workbaskets
If you select Merge workbaskets then there is no priority for any workbasket. GetNextWork consolidates all the assignments from the workbasket array and choose the appropriate assignment.
There is one more configuration available regarding workbaskets.
Use all workbasket assignments in user’s workgroup
- You can avoid the workbasket array in Operator form. Instead you can make use of all the workbaskets that come under user workgroup.
For example: bank employee belongs to Employee work group. There are 2 workbaskets tagged to Employee work group. Then GetNextWork behaves like merge workbaskets and choose the appropriate assignment from any one workbasket.
You can see the workbasket array disappeared on selecting this option.
I hope, you know that we can specify the workgroup in user (operator) form and workbasket form
- So GetNextWork first gets the operator workgroup, then searches for all the workbaskets that come under the operator workgroup and then chooses one assignment.
- Also in Operator form you have an option to specify the skills.
- This is used in skill based routing.
Say for example, some loan request has to be processed by set of skilled employees. In such case you can specify the skill for the employee in Operator rule form.
Note: Skill is a separate rule in pega. You can create one.
Then you can use ToSkilledWorkbasket router activity to set the skills with the assignments. So operators who possess those skills can only work on those assignments
First let’s test the priority between workbasket and worklist
Pre-requisites: Have some assignments in your worklist and any workbasket.
Check if worklist gets priority
Step 1: Open your operator rule form and uncheck ‘Get from workbasket first’
Save the operator form.
Step 2: Launch the user portal and find the ‘GetNextWork’ button.
Note: The position of GetNextWork button varies between Pega versions.
Step 3: Click on the Get Next Work. I get L-5.
Step 4: let’s see if this assignment is in my worklist already.
Close this case and Open my work.
There it is :). So GetNextWork pulled it rightly giving worklist the priority over workbasket
Check if workbasket gets priority
Step 1: Check Get from workbaskets first and specify the workbasket name.
Save the form.
Step 2: Now click on Get Next Work.
It will not work 😛 Still Get Next work fetches from workbasket.
This is because Requestor page is not updated. You have to logout and login 🙂
pxRequestor.pyWorkbasketFirst – determines the priority between workbasket and worklist
Here you see a new case 🙂
Step 3: It must be from Loan processing queue. If you try to verify, It will not be in workbasket, because Get Next work pulls it from workbasket and pushes it to your worklist 🙂
There is a system settings rule control this.
Imagine a situation, where you can accept or reject the assignment from GetNextWork. If you rejected, it must stay in the workbasket so that others can pick it up. In such case, You don’t want to move the assignment from workbasket to worklist as soon as you click Get next Work.
Open GetNextWork_MoveAssignmentToWorklist system settings rule.
- You have to override this rule in your application ruleset and set the values to false.
So unless you submit the GetNextWork assignment, it will not be removed from the workbasket 🙂
Now you know how GetNextWork prioritize the assignment between workbasket and worklist.
Let’s go one level deeper.
How GetNextWork prioritize the assignments within a workbasket or worklist?
I will start with worklist.
First we need to know how Get Next work is built by Pega.
- Update the operator rule form. Get from workbasket first – Uncheck
- start the tracer and click on GetNextWork
I will give you the sequence of steps for GetNextWork
Step 1: Work-.GetNextWork is called. This in turn calls getNextWorkObject
Step 2: GetNextWorkObject
- In step 2, the activity check if pxRequestor.pyWorkbasketFirst=true. So this determines the priority.
Step 3: based on the priority, the order of execution of activities varies
findAssignmentInWorklist – Fetches the assignments from worklist
findAssignmentInWorkbasket – Fetches the assignment from workbasket
This activity calls list-view to get the list of assignments.
- Let’s open the listview – GetNextWork in Assign-Worklist class.
- You can update the list view to introduce your own business logic 🙂 I will explain it with example at the end of this post.
Okay from this list view, we get a list of eligible assignments.
The next java step calls a function ‘pzOpenAssignmentForGetNextWork’
- Open the function ‘pzOpenAssignmentForGetNextWork’
- The job of this funtion is to select the good candidate (assignment).
I hope this will be difficult for Pega Amateurs, but still you need to know how Get Next work is built 🙂
My presonal tip – The best way to learn Pega is, first learn how Pegasystems built the Pega product. Whatever you do, trace and check what is happening at the back end. Slowly you will find the way to untie the knots 🙂
- You see the function calls a decision tree ‘GetNextWorkCriteria’ .
This is responsible for filtering out the assignments.
Decision tree – GetNextWorkCriteria.
You can override this decision tree and enter your own criteria 🙂
So finally the activity returns you a eligible assignment which will be presented to the operator.
- This activity is used to find the assignments from workbaskets.
- Certain configurations like ‘merge workbaskets’ are considered in this activity.
- The main difference is it used List view – GetNextwork from Assign-Workbasket class!
It’s time to do some customization in GetNextWork
- I have a requirement like loan request should be processed on first come first served basis.
Remember, by default GetNextWork prioritize assignments based on their urgency .
Here in our scenario, we need to prioritize based on pxCreateDateTime. Also note that, we should consider the case creation date time not the assignment created date time.
Step 1: open the listview – GetNextWork in Assign-Worklist class
Step 2: Save the rule in your application ruleset.
Step 3: Go to Join tab and specify the join condition with the workclass.
It means we are joining pc_assign_worklist table with pc_work table.
Step 4: After the change, save and run the list view once.
You can see 4 cases in my worklist – L-11, L-5, L-1, L-2 (Note the order)
Step 5: Now just try clicking on GetNextWork from user portal. (remember to uncheck get from workbasket first from operator rule)
- It is returning L-11. You can see this comes in first place in listview run results.
So, you have to modify the listview sort order based on work -.pxCreateDateTime
Step 6: In the content tab, add the A.pxCreateDateTime with Ascending sort order.
Note: The order of sorting is important, If you want to use more than one field sorting.
Step 7: Now Save and run the rule.
You can see case L-1 is returned as a first eligible candidate.
Step 8: Now go to user portal and click Get Next work.
Important note: Not always the list view first result will be returned from Get Next Work. There are certain other filtering criteria like if it is locked by someone else or urgency filtering, so don’t just always expect list view first result will be your Get Next Work assignment 🙂
End of Get Next Work!! I am pressing Get Next Work to switch to my next Post!! 😛