Question
Lanit
RU
Last activity: 11 Dec 2015 7:58 EST
How open link in new Thread?
When I press to link it opens in Thread = STANDART.
Example: we have link http://sbld-sup.bpm.lanit:8080/prweb/SUDIRServlet?pyActivity=Work-.Open&Action=Review&HarnessPurpose=pyCmReview&InsHandle=SBERBANK-GBL-LEGAL-WORK+CP-RQST-765, after I press it the link becomes http://sbld-sup.bpm.lanit:8080/prweb/SUDIRServlet/mZA9d9zS0F3ufbkQh7I2rQ%5B%5B*/!STANDARD?pyActivity=Work-.Open&Action=Review&HarnessPurpose=pyCmReview&InsHandle=SBERBANK-GBL-LEGAL-WORK+CP-RQST-765.
How to open this link in other Thread?
-
Likes (1)
Guangri Liang -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 10 Dec 2015 18:01 EST
GovCIO
US
Hi Igor,
As Mike pointed rightly, activity: @baseclass.RedirectAndRun is used to redirect the URL/location in a specified thread.There is an OOTB activity:LaunchRedirectAndRun under RS:PegaSCM. This activity sets the request type and the new thread name paramerets and calls Redirect and Run to create a new thread. Here is the screenshot of this activity. Not sure whether this RS is present in your application stack or not. There is a function:getNewThreadName() used to get the new Thread from the same activity. If you have these rules in your system, may be you can play around and get the solution for your issue. Or, you can just see the referencing rules for RedirectAndRun activity from your version and build the logic.
Java code used for the above function: Check this code and give a try
java.util.Set threadSet = tools.getThread().getRequestor().getThreadNames();
int count = 0;
String threadName="";
String currentThread = "";
java.util.TreeSet sortedSet = new java.util.TreeSet();
java.util.Iterator it = threadSet.iterator();
Hi Igor,
As Mike pointed rightly, activity: @baseclass.RedirectAndRun is used to redirect the URL/location in a specified thread.There is an OOTB activity:LaunchRedirectAndRun under RS:PegaSCM. This activity sets the request type and the new thread name paramerets and calls Redirect and Run to create a new thread. Here is the screenshot of this activity. Not sure whether this RS is present in your application stack or not. There is a function:getNewThreadName() used to get the new Thread from the same activity. If you have these rules in your system, may be you can play around and get the solution for your issue. Or, you can just see the referencing rules for RedirectAndRun activity from your version and build the logic.
Java code used for the above function: Check this code and give a try
java.util.Set threadSet = tools.getThread().getRequestor().getThreadNames();
int count = 0;
String threadName="";
String currentThread = "";
java.util.TreeSet sortedSet = new java.util.TreeSet();
java.util.Iterator it = threadSet.iterator();
while (it.hasNext()) {
currentThread = (String)it.next();
if(currentThread.startsWith(tools.findPage("pxThread").getString("pxCurrentApplicationName")))
sortedSet.add(currentThread);
}
String lastThread = "";
String newThread = tools.findPage("pxThread").getString("pxCurrentApplicationName");
newThread+="/$TABTHREAD";
boolean doWhile = true;
if(sortedSet.size()>0){
do{
if(sortedSet.contains(newThread+count))
count++;
else{
newThread+=count;
doWhile = false;}
} while(doWhile);
}
else{
newThread+="0";
}
threadName = newThread;
return threadName;
Thanks,
Ravi Kumar Pisupati.
Pegasystems Inc.
US
Hello Igor,
Have you tried using the activity redirectAndRun? That should allow you to name the new thread you want to use.
Thanks,
Mike
Lanit
RU
Hi Mike,
Thank you.
Accepted Solution
Updated: 10 Dec 2015 18:01 EST
GovCIO
US
Hi Igor,
As Mike pointed rightly, activity: @baseclass.RedirectAndRun is used to redirect the URL/location in a specified thread.There is an OOTB activity:LaunchRedirectAndRun under RS:PegaSCM. This activity sets the request type and the new thread name paramerets and calls Redirect and Run to create a new thread. Here is the screenshot of this activity. Not sure whether this RS is present in your application stack or not. There is a function:getNewThreadName() used to get the new Thread from the same activity. If you have these rules in your system, may be you can play around and get the solution for your issue. Or, you can just see the referencing rules for RedirectAndRun activity from your version and build the logic.
Java code used for the above function: Check this code and give a try
java.util.Set threadSet = tools.getThread().getRequestor().getThreadNames();
int count = 0;
String threadName="";
String currentThread = "";
java.util.TreeSet sortedSet = new java.util.TreeSet();
java.util.Iterator it = threadSet.iterator();
Hi Igor,
As Mike pointed rightly, activity: @baseclass.RedirectAndRun is used to redirect the URL/location in a specified thread.There is an OOTB activity:LaunchRedirectAndRun under RS:PegaSCM. This activity sets the request type and the new thread name paramerets and calls Redirect and Run to create a new thread. Here is the screenshot of this activity. Not sure whether this RS is present in your application stack or not. There is a function:getNewThreadName() used to get the new Thread from the same activity. If you have these rules in your system, may be you can play around and get the solution for your issue. Or, you can just see the referencing rules for RedirectAndRun activity from your version and build the logic.
Java code used for the above function: Check this code and give a try
java.util.Set threadSet = tools.getThread().getRequestor().getThreadNames();
int count = 0;
String threadName="";
String currentThread = "";
java.util.TreeSet sortedSet = new java.util.TreeSet();
java.util.Iterator it = threadSet.iterator();
while (it.hasNext()) {
currentThread = (String)it.next();
if(currentThread.startsWith(tools.findPage("pxThread").getString("pxCurrentApplicationName")))
sortedSet.add(currentThread);
}
String lastThread = "";
String newThread = tools.findPage("pxThread").getString("pxCurrentApplicationName");
newThread+="/$TABTHREAD";
boolean doWhile = true;
if(sortedSet.size()>0){
do{
if(sortedSet.contains(newThread+count))
count++;
else{
newThread+=count;
doWhile = false;}
} while(doWhile);
}
else{
newThread+="0";
}
threadName = newThread;
return threadName;
Thanks,
Ravi Kumar Pisupati.
Lanit
RU
Hi Ravi,
Thank you.