Question

Creation of new tab to display new work object in portal using snapstart URL

I am trying to achieve a functionality using snapstrart URL.

My requirement is 'To launch a portal using snapstart URL and to create a workobject and to display it in new tab in a user portal'.

I have tried with RedirectandRun activity and no luck with it. Could anyone suggest me with some idea to achieve this requirement?

***Updated by moderator: Lochan to add Categories***

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Correct Answer
July 12, 2017 - 9:03am

Hi,

We were able to achieve the requirement of "Creating of new tab to display new work object in portal using snapstart URL".

Step 1:

We used the below snapstart URL to invoke a custom activity "LaunchPortal"

http://serverX/prweb/PRServlet?UserIdentifier=userX@companyY.com&Password=cGVnYQ==&pyActivity=SampleClass-Work.New

Application URL:  http://serverX/prweb/PRServlet?

Operator ID:  UserIdentifier=userX@companyY.com

Password:  Password=cGVnYQ== (default, no need to modify)

Activity to be invoked: pyActivity=SampleClass-Work.New (We created a new activity "LaunchPoral" in Data-Portal and used it here)

Step 2:

In the LaunchPortal activity, we called ShowDesktop activity in Step 1 and in Step 2 we set "SnapFlag" Property in pyDisplayHarness page to true.

Step 3:

We then created a new section "LaunchCase" in Data-Portal Class, and unchecked the Auto-Generated HTM check box in HTML tab and entered the below code in HTML Source,

<script>
    var testFlag = "<%=tools.findPage("pyDisplayHarness").getProperty(".SnapFlag").getStringValue()%>";
  if(testFlag=="true"){
    pega.desktop.createNewWork("ClassName",1, "FlowName");
    <%tools.findPage("pyDisplayHarness").getProperty(".SnapFlag").setValue("false");%>;
  }
</script>

Step 4:

We added the "LaunchCase" section in the default tab of the portal and finally we checked the "Defer load content" checkbox in the default tab configuration.

Comments

Keep up to date on this post and subscribe to comments

June 19, 2017 - 7:03am

Hello Sangeetha,

Please refer below article for SnapStart URLs for desktop integration

https://pdn.pega.com/how-create-snapstart-urls-desktop-integration

Regards,

Praveen

June 19, 2017 - 8:58am

Hi Praveen,

Thanks for you prompt reply. I have  referred that mentioned link and that helps me to open a harness in a new tab. But I just want to know how to launch a portal and create a new tab to display my created workobject using snapstart URL.

June 21, 2017 - 2:30am
Response to PSANGEETHA

Hello Sangeetha,

Configure the portal harness to display the created workobjects, now launch the portal harness by using the SNAPSTART url and verify the behavior.

 

Regards,

Praveen

June 22, 2017 - 8:54am

Hi Praveen,

We were able to create a workobject but we are unable to launch a new tab. We have tried customising activity to pass params explicitly to create a new thread. We are able to view the dynamic continer Id generated in tracer but it has not created any threads. So can I ask you, Is there any API/explicit code available to create a new thread?

July 10, 2017 - 11:46am
Response to PSANGEETHA

Hi Sangeetha,

Did you get any solution ?

 

July 12, 2017 - 9:03am

Hi,

We were able to achieve the requirement of "Creating of new tab to display new work object in portal using snapstart URL".

Step 1:

We used the below snapstart URL to invoke a custom activity "LaunchPortal"

http://serverX/prweb/PRServlet?UserIdentifier=userX@companyY.com&Password=cGVnYQ==&pyActivity=SampleClass-Work.New

Application URL:  http://serverX/prweb/PRServlet?

Operator ID:  UserIdentifier=userX@companyY.com

Password:  Password=cGVnYQ== (default, no need to modify)

Activity to be invoked: pyActivity=SampleClass-Work.New (We created a new activity "LaunchPoral" in Data-Portal and used it here)

Step 2:

In the LaunchPortal activity, we called ShowDesktop activity in Step 1 and in Step 2 we set "SnapFlag" Property in pyDisplayHarness page to true.

Step 3:

We then created a new section "LaunchCase" in Data-Portal Class, and unchecked the Auto-Generated HTM check box in HTML tab and entered the below code in HTML Source,

<script>
    var testFlag = "<%=tools.findPage("pyDisplayHarness").getProperty(".SnapFlag").getStringValue()%>";
  if(testFlag=="true"){
    pega.desktop.createNewWork("ClassName",1, "FlowName");
    <%tools.findPage("pyDisplayHarness").getProperty(".SnapFlag").setValue("false");%>;
  }
</script>

Step 4:

We added the "LaunchCase" section in the default tab of the portal and finally we checked the "Defer load content" checkbox in the default tab configuration.