Support Article
Dynamic container not loading when switch to interaction portal
SA-33574
Summary
Users work with two portals. One portal uses a dynamic container in its screen layout with multi-document mode. The other portal uses a dynamic container in its screen layout with single-document mode.
When users open the portal with the single-document dynamic container and open one document, the portal works as expected. When they switch to the other portal, the one with the multiple-document dynamic container, the dynamic container is not loaded.
Error Messages
Not Applicable
Steps to Reproduce
- Log in to the application.
- Open the portal with the single-document dynamic container.
- Open any document in this portal.
- Open the portal with the multiple-document dynamic container, for example, the Case Manager or Customer Service interaction portal.
Root Cause
A defect in Pegasystems’ code or rules
Analysis shows that the clipboard thread is not getting removed for the respective portals; therefore, the JavaScript APIs are not loaded when users switch from the portal with the single-document dynamic container to the portal with the multiple-document dynamic container, for example, the Case Manager interaction portal.
Resolution
Update or upgrade to Pega 7.2.2, which resolves Issue-272011.
Update or upgrade to Pega Customer Service 7.31.
Best Practice: Update or upgrade to the latest Pega Platform release or Application product release.
If you cannot update or upgrade and must continue using Pega 7.2, perform the following local-change:
- Before the function changePortal, call an activity that clears the thread, for example, RemoveThread.
- In the RemoveThread activity, specify the Java code shown below.
/* java code in remove thread activity*/
String portalName="";
ClipboardPage threadPage = tools.findPage("pxThread");
if(threadPage != null){
portalName = threadPage.getString("pxPortal");
ClipboardPage pg_dec_PyDisplay = tools.findPage("Declare_pyDisplay");
ClipboardProperty cp_pyDisplay = pg_dec_PyDisplay.getIfPresent("pyDisplay");
if(cp_pyDisplay != null){
ClipboardPage cp_pyDisplay_portal=cp_pyDisplay.getPageValue(portalName);
if(cp_pyDisplay_portal!=null){
cp_pyDisplay_portal.getParentProperty().removeFromClipboard();
}
}
}
String currThreadName = tools.getThread().getName();
Set threads = tools.getThread().getRequestor().getThreadNames();
Iterator it = threads.iterator();
while (it.hasNext()) {
String strThread = (String) it.next();
// Do not delete openPortal and Standard threads
if(!strThread.equalsIgnoreCase("openportal") && !strThread.equalsIgnoreCase("standard")) {
// Delete thread if
// current thread is openPortal and thread starts with PS_1 OR
// Current thread is Standard
if((currThreadName.equalsIgnoreCase("openportal") && strThread.startsWith("PS1_")) || currThreadName.equalsIgnoreCase("standard")) {
((com.pega.pegarules.priv.context.PegaRequestor)tools.getThread().getRequestor()).removeInactiveThread(strThread);
}
}else {
ClipboardPage actionInfo = tools.findPage("pyActionInfo", true);
if(actionInfo != null){
actionInfo.removeFromClipboard();
}
// Populate param to clear clipboard from current thread
tools.putParamValue("bPurgeTargetThread",true);
}
}
String portalName="";
ClipboardPage threadPage = tools.findPage("pxThread");
if(threadPage != null){
portalName = threadPage.getString("pxPortal");
ClipboardPage pg_dec_PyDisplay = tools.findPage("Declare_pyDisplay");
ClipboardProperty cp_pyDisplay = pg_dec_PyDisplay.getIfPresent("pyDisplay");
if(cp_pyDisplay != null){
ClipboardPage cp_pyDisplay_portal=cp_pyDisplay.getPageValue(portalName);
if(cp_pyDisplay_portal!=null){
cp_pyDisplay_portal.getParentProperty().removeFromClipboard();
}
}
}
String currThreadName = tools.getThread().getName();
Set threads = tools.getThread().getRequestor().getThreadNames();
Iterator it = threads.iterator();
while (it.hasNext()) {
String strThread = (String) it.next();
// Do not delete openPortal and Standard threads
if(!strThread.equalsIgnoreCase("openportal") && !strThread.equalsIgnoreCase("standard")) {
// Delete thread if
// current thread is openPortal and thread starts with PS_1 OR
// Current thread is Standard
if((currThreadName.equalsIgnoreCase("openportal") && strThread.startsWith("PS1_")) || currThreadName.equalsIgnoreCase("standard")) {
((com.pega.pegarules.priv.context.PegaRequestor)tools.getThread().getRequestor()).removeInactiveThread(strThread);
}
}else {
ClipboardPage actionInfo = tools.findPage("pyActionInfo", true);
if(actionInfo != null){
actionInfo.removeFromClipboard();
}
// Populate param to clear clipboard from current thread
tools.putParamValue("bPurgeTargetThread",true);
}
}
Published March 1, 2018 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.