Before We Begin
First let us understand what are temporary work objects in PEGA. As the name suggests, these are work objects which are not permanent, i.e. they are not stored in the Database. They just remain in memory [Clipboard] and do not have any case ID associated with them. They are created and managed by a single operator who has initiated the case and cannot be routed.
Why do we need Temporary Work Objects?
There may be situations where we need to store work objects in database only when certain conditions are met. We can make use of temporary work objects in these scenarios.
Few scenarios where Temporary Work Objects can be used:
- Consider that there is an insurance application where a customer can launch and get the quote. Based on the quote, customer might want to proceed or reject. We can use temporary work object to present the quote. Once customer approves, we can make it permanent. If the customer rejects, we need not store the details in the Database.
- Consider that in a reimbursement application there is a duplicate check to handle if the reimbursement claim is duplicate. In this scenario, we can initially create a temporary work object, perform duplicate search and then make it permanent only if it is a non-duplicate case.
Note: If system requires storing each and every case [irrespective of Resolved-Duplicate/Resolved-Rejected] for audit purpose or for future analysis, then temporary work object might not suffice.
Business Scenario
Let us extend our Candidate Onboarding process which we used in our previous Duplicate search post .
Our requirement is that we only need to store non-duplicate candidate profiles in our Database and do not need to store those cases that are identified as Duplicates.
We can implement this scenario using Temporary Objects and use Persist Case shape to store non-duplicate cases. Let us see this implementation in detail.
How to create Temporary Work objects in PEGA?
PEGA Case Management provides us with an option of creating temporary work objects. Using Case Design, follow below navigation to create temporary work objects.
Case Type (Candidate Onboarding in our scenario) -> Settings tab -> General category -> “Enable temporary case”
Enabling this will make the Candidate Onboarding case a temporary until we choose to make it permanent by using Persist Case shape.
Once this option is enabled and Saved, we can notice that the starter flow pyStartCase in Candidate Onboarding class has the settings for Temporary Object enabled.
How to make a temporary work object permanent?
We can use the Persist Case option in case management to make a temporary case permanent whenever it is desired to be persisted.
In our scenario of Candidate Onboarding, we intend to persist a case only when it is not a duplicate case. After the Duplicate Search step, we add Persist Case step so that only the non-duplicate cases are stored in the Database.
Execution of Temporary Work object
With the above changes, let us try to create a new Candidate Onboarding case. Here we can see that a case ID is not generated for the case when we are in the step of collecting candidate details.
Let us open the clipboard and observe work page and assignment page.
Let us fill the candidate details for a Candidate whose record doesn’t exist in the system. Duplicate Search determines this case as a non-duplicate. After this, case passes through Persist Case shape which will make the case as permanent. Case ID is generated and the case gets stored in the Database.
Let us create another Candidate Onboarding case with same details as the case which we had just created.
Let us close this case as Duplicate and Submit.
We can see that the case has got resolved as Duplicate and the case details are not persisted in the Database.
What is happening in the backend?🤔
To createWorkPage activity, parameter value for CreatesTemporaryObject is passed as true from pyStartCase flow settings. Due to this pyTemporaryObject property in work page is set to true.
Generation of work object ID is skipped in AddWork activity if pyTemporaryObject is true. Hence, work object ID is not generated when temporary object is enabled for a case type.
RecalculateAndSave activity exits when pyTemporaryObject is true.
At the backend, whenever case passes through Persist Case shape, pxPersistCase activity runs.
This activity does the following:
- Removes pyTemporaryWorkObject property.
- Gets the work object prefix and calls GenerateID to generate the work object ID.
- Updates work object reference properties in newAssignPage [pxRefObjectKey etc.]
Overall SLA
Let us set an overall SLA for the Candidate Onboarding case type and examine what happens when the case is temporary and after it becomes permanent.
Let us run the Candidate Onboarding case and observe what happens when the case is not persisted.
Let us observe what happens when the case crosses Persist Case shape and becomes permanent.
We can notice that pxPersistCase calls pzLaunchInternalFlows which calls DefineSLATimes and after which OverallSLA gets set on the case.
We can also notice that other Internal flows becomes available in pxFlow pagegroup when pxLaunchInternalFlows gets called from pxPersistCase.
Conclusion
Temporary work objects can help improve storage space as it eliminates unnecessary DB storage by not storing the case data which are not needed. It also helps improve performance.
Loved the explanation of managing temporary case. But one challenge where everyone face is attaching files to temporary case. It would be cherry on cake if that also explained 😛 .. great work guys. Keep rocking !!
Thanks @Ram kumar
Sure. We will analyze and publish that in the extension post of temporary work object.
Happy Learning 😊
Great explanation!! Especially the overall SLA part.
Thanks @Krishna kumar.
Happy Learning 😊
Nice, easy to understand. What is overall SLA? I am fresher so not able to get this concept. It is some extension of process>service level agreement? I want more reads on case management.
Thanks @Aditya Kunal.
SLA is a rule type in PEGA which can be used to set goal, deadline and passed deadline actions. SLA can be configured in more than one place and most commonly at case and assignment level.
Overall SLA is the SLA defined for your case. Let’s consider a Interview case type in PEGA as part of HR application and each interview case created should be resolved within 6 working days, which can be configured by using Overall SLA.
One more question. When wait post will be published? Want to learn that also guys
You can expect post on wait shape in a week from now 😊
Thanks for the quick reply. Please explain about SLA in some future post. I want to understand sla vs wait. Wait shape post I will check after you guys publish in the next week.
Sure will do @Aditya Kunal
Going forward make use of our “Suggest Topic” form to suggest new topics if any. We have separate process to track new articles request when it comes from the form and we don’t want to miss your suggestion anytime 🙂
Guys, came to check with the expectations that I can learn about wait shape usage. When can I expect that to come and check? I thought eta is today as I saw in previous comment that it would be available in a week. Please post it guys. I want to learn wait and sla. I am fresher and I am exploring your blog to learn. It is really helping me especially case management posts on duplicate and temporary. So please post soon about wait guys. It will be useful for many Pega fresher’s like me:-)
Aditya Kunal,
Your interest is much appreciated. Please do subscribe and make sure you receive updates through email instead of manually checking our blog for updates 🙂
We have already prioritized Wait article and you can see it soon in our blog 🙂
@OSP guys: sorry to keep asking you. I will get back once you guys post on wait. In my project, I need to use wait. That is why asked.
Aditya Kunal,
We are happy to see your interest in learning PEGA as a fresher. Now you can explore about wait shape from our article in OSP.
Happy learning 😊
This one is again excellent. Very neatly explained. That too since same example is used for 2 posts, it is helping to understand. It is a great plus that you have used same example. Fantastic job OSP team.
Thanks @Prasanna
Happy Learning 😊
Good explanation. Case Design topics always grabs all attention guys. I have a suggestion. It will be good if u guys post good articles like this to cover case management. Kudos to the composer of this article. U guys rock and are awesome 3 of u. Once again thanks Aditya for u to lead me to this.
Sure we will post more on Case Management @Chaitanya Pinnireddy
Happy Learning 😊
Guys this comment is misleading guys. I know you guys working on 2.0 but remove or modify guys as my lead is asking me where to go and search guys.
Done @Aditya Kunal
Nice post. Clear and easy to understand.
Thanks @Shashankey Pinnireddy
Happy Learning 😊
Nice post. My room and office Pega friend is Aditya Kunal. All is nice on temparary. Can you send post on class stricture next article?
Thanks & Nice to hear @Cowsick Pannipolamarasetty
Guys. Today I read about sla and Came to know that apart from assignment, I can set it in a specific flow, specific stage or for full case guys. I suppose sla for full case means overall sla. Does it get propogated to child case or I need to set it separately for child case guys? If flow wide sla is set, what happens? If stage wide sla is set what happens? How are entries managed guys? Overall sla means a flow is added at backend guys. Like that I want to know for flow and stage wide sla guys. Can you please help me with the answer?
We will post soon on SLA which will answer all your questions @Aditya Kunal
Stay Tuned 😎
very good explanation especillay OverAllSLA part…..just to understand, will be there any impact with Assignment level SLA with temperory object,….
OverAllSLA, Stage SLA, Step SLA, Flow SLA and Assignment SLA behaves the same when it comes to temporary work object.
All SLA entry in queue will have assignment key as reference which will be made up with Case ID. Since temporary Work Object will not have case IDs, entries will not be written to queue.
Hope this clarifies your question @Upender Reddy Palla