Question

Create a new case and display it in a new tab when Portal loads

Hello everyone!

Just wanted to know if there are any general suggestions on how to create a case automatically when a specific portal loads. I'm using the Interaction Portal from Customer Service framework, so I have done the following development:

  1. Copied @baseclass.preDisplayHarness activity to the business layer.
  2. Added an activity on step 1 to create a case. This step is conditioned to be executed only when Param.harnessName=="CPMInteractionPortal".

This creates a case every time this particular portal loads. To accomplish my requirement, I will add other conditions to the execution of my activity inside preDisplayHarness, so there is no need to worry about too many cases getting created just by loading the portal.

So, this is the issue:

Even if I can create a case using @baseclass.doUIAction activity, this doesn't open the case on a different tab. This conversation is related to this other post, but I wanted to ask in this post if there is any other way apart from using doUIAction activity in order to create a case when portal loads, and then display it.

Once again, thank you so much!

***Edited by Moderator: Lochan to update platform capability tags***

Comments

Keep up to date on this post and subscribe to comments

May 23, 2019 - 1:25am

As suggested in the other post, you can use pxCreateTopCase activity to create a case.

We can call 'launchHarness' which is a Javascript API to launch a new harness on 'onload'.

Pega
May 23, 2019 - 5:05am

Hi,

In CS interaction portal If you want to create a new case and open in a new tab, the work object must be added to pxResults of D_CPMPortalRecents data page.

I think in your case (when you are using doUiaction) work object is not getting added to that page because of which it is not getting opened in new tab.

In OOTB we use 'pyAddRecentListItem' DT (work object corresponding class) to add the work object result to the  D_CPMPortalRecents datapage pxResults.

If your requirement is to create an interaction type of work object on load of the portal, then you can save as 'pyAddRecentListItem' DT of "PegaCA-Work-Interaction-Call" class into your class.

Regards,

Nishitha

May 23, 2019 - 1:15pm
Response to chinn2

Hello Nishitha!
Thank you so much for your reply. I was able to find the pyAddRecentListItem data transform, but I see it is withdrawn:

I created a Phone Call interaction via the OOTB navigation menu in the top of the screen and traced, and I see the two pyAddRecentListItem data transforms that get executed are:

  1. @baseclass.pyAddRecentListItem
  2. Work-.pyAddRecentListItem

I copied the one in the Work- class to my application class, and executed the following tests:

  1. Created a work object and executed the data transform alone with pyWorkPage as the context.
  2. Added the pyAddRecentListItem data transform at the end of my activity using doUIAction activity.

There was no tab for both tests, but I noticed this. The data page D_CPMPortalRecents is ALWAYS empty, there are no pxResults inside of it.

As you can see in the screenshot, there is a case already created, but the C_CPMPortalRecents data page has no items inside besides the pySourcePage. This also happens if I have multiple cases, and also if I advance the case until I reach the Composite.

This also happens in our sample Pega application, is this behavior normal?

I'm using Pega 8.1.0 with Customer Service Framework.

 

Thanks in advance.

Pega
May 27, 2019 - 6:55am
Response to IsraelC8602

Sorry,I have suggested the above solution with out knowing your CS version. Recents architecture has been changed in 8.1 CS . We are not using D_CPMPortalRecents data page now(till 7.4 this data page had been used).
I will check regarding your requirement at my end and get back to you.

 

May 28, 2019 - 9:49am
Response to chinn2

Alright, that sounds good! I'll be waiting for your response.

Thanks in advance.

Pega
May 31, 2019 - 5:01am
Response to IsraelC8602

Please check whether any entry is getting added to "D_CSRecents" datapage or not while performing the usecase.

May 31, 2019 - 9:55am
Response to chinn2

Yes, entries are getting added to D_CSRecents in the same way the would be added if I created a case normally via UI.

Pega
May 31, 2019 - 10:49am

Hi Israel, sorry for coming late to the conversation. "Hijacking" the portal load activities to invoke creation of a case is never a good idea. When a case is created using the CreateNewWork APIs, there are a number of processes that happen at the desktop prior the doUIAction activity getting invoked. If you do it in this manner, it will lead to issues later on. Even if you get the case to get created, trying to move between home tab and the case will likely be broken. The Interaction portal is not meant to be used like this, which sounds more like Mashup. The portal is built in a way that is supports creating of cases in an interaction context. The Data Transforms that are mentioned are very specifically built to handle these use cases. 

What exactly are you trying to achieve ? Perhaps there is a better way to achieve your business use case than the method you are trying here.