Creating and Managing Temporary Work Objects in PEGA

Creating and Managing Temporary Work Objects in PEGA

Summary:

This article explains about when to use Temporary Work Objects in PEGA and how to manage them based on the business needs.

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.

Settings in Case Design for a temporary case

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.

Enabling temporary object in case design enables Temporary object setting in the corresponding starter flow

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.

Select Persist Case as a step in the desired stage after which work object needs to be stored in the Database
In our scenario, case is persisted after Duplicate check

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.

Case ID is not generated since the work object is temporary

Let us open the clipboard and observe work page and assignment page.

In the work page, pyID and pzInsKey are blank and pyTemporaryObject is true
In assign page, reference object related properties and pzInsKey are blank

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.

Candidate details which is not a potential duplicate.
Case ID is generated after the execution of PersistCase shape

Let us create another Candidate Onboarding case with same details as the case which we had just created.

Duplicate search has determined this as a Duplicate of previous case

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.

Parameter page of createWorkObject activity
pyTemporaryObject is set to true in createWorkPage activity

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.

Steps in AddWork where work object ID gets generated. These are skipped due to pre-condition in step 11.
Step 11 pre-condition checks for temporary work object and jumps to step 16 – resulting in case ID not being generated for temporary work objects

RecalculateAndSave activity exits when pyTemporaryObject is true.

RecalculateAndSave activity steps

At the backend, whenever case passes through Persist Case shape, pxPersistCase activity runs.

Steps in pxPersistCase activity

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.

Case Level SLA is set, an existing OOTB SLA is used for demo purpose

Let us run the Candidate Onboarding case and observe what happens when the case is not persisted.

Overall SLA is not set on a temporary case

Let us observe what happens when the case crosses Persist Case shape and becomes permanent.

Tracer showing the execution of pxPersistCase activity

We can notice that pxPersistCase calls pzLaunchInternalFlows which calls DefineSLATimes and after which OverallSLA gets set on the case.

Overall SLA is 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.

OSP TEAM
Written by
OSP Editorial Team

Recent Jobs from our community

loading
View more Jobs on OSP Forum
Join the discussion

Feel free to post your questions here about this topic if any. We will definitely get back to you ASAP !!!
If you have any off-topic questions, Let's discuss at OSP Forum

28 comments
  • 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 !!

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

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

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

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

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

  • 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?

  • 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?

  • 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