Launching Theme Cosmos pages from Cosmos React portals
Give your users access to Theme Cosmos pages from Cosmos React portals. This approach helps you maintain application continuity while you rebuild your existing pages in Cosmos React.
For example, your business owns a Pega mortgage application that is designed in Theme Cosmos. You want to rebuild the application in Cosmos React. To save time to minimum viable product, you incorporate the existing Theme Cosmos documents landing page in the new application instead of building a new page.Creating an openHarness activity
Create an activity that opens a harness in a new browser tab to use for integration of Theme Cosmos pages with Cosmos React applications.
- Open the Theme Cosmos application whose pages you want to display in Cosmos React.
- In the Work- class, create a
openHarness activity.For more information, see Creating an activity.
- Click Add a step, and then, in Step
1, define the thread of the activity:
- In the Method field, enter Property-Set.
- In the Step page field, enter pxThread.
- Click the Expand to see the method parameters arrow.
- In the PropertiesName field, enter Param.ThreadName.
- In the PropertiesValue field, enter .pxThreadName.
- Click Add a step, and then, in Step
2, define the action:
- In the Method field, enter Property-Set.
- Click the Expand to see the method parameters arrow.
- In the PropertiesName field, enter Param.actionName.
- In the PropertiesValue field, enter showHarness.
- Click Add a step, and then, in Step
3, set the portal name to default:
- In the Method field, enter Property-Set.
- Click the Expand to see the method parameters arrow.
- In the PropertiesName field, enter Param.PortalName.
- In the PropertiesValue field, enter "UserPortal".
- Click Add a step, and then, in Step 4, in the Method field, enter call pxOpenWorkItemNewTab.
- In the Method Parameters section, select the Pass current parameter page checkbox.
- On the Parameters tab of the activity, add the following
parameters:
- tabName
- className
- ruleName
- preActivityName
- preActivityParams
- preDataTransform
- In the rule form, click Save.
Configuring URL mapping in the Theme Cosmos application
Set URL mapping in your Theme Cosmos application to create a URL address that you can reference from the Cosmos React application.
- Open the Theme Cosmos application whose pages you want to display in Cosmos React.
- In the navigation pane of Dev Studio, click Records.
- Expand the Technical category, and then click URL Mappings.
- In the list of mapping instances , click pyDefault.
- On the rule form, in the Landing pages section, click Add URL alias.
- In the Define URL mapping dialog box, configure the URL
path:
- In the Identifier field, enter a label for your resource.
- Clear the Map path elements for URL generation checkbox.
- In the Path element type list, select Constant.
- In the Value field, enter the URL extension that you want to associate with the page.
- Click Next.
- In the Edit processing activity dialog box, configure the
activity that starts when the user opens the URL:
- In the Class field, enter Work-.
- In the Activity field, enter openHarness.
- In the Parameter section, provide the parameters for your activity.
- Click Finish.
- On the rule form, click Save as.
- On the New tab, ensure that the context points to the application ruleset, and then click Create and open.
Overriding the pyIsAutoGenThread
Ensure that the mapped URL address of the target Theme Cosmos landing page opens correctly in a portal by adjusting the pyIsAutoGenThread when rule.
- In the ">Theme Cosmos application, in the header of Dev Studio, search for and open the pyIsAutoGenThread when rule.
- On the Advanced tab of the rule form, define the new
logic for the when rule:
- To the right of the row A of the condition, click the Configure advanced conditions here arrow.
- In the list of logic structures, select [condition evaluates to true].
- In row A, enter @String.contains(@toUpperCase(pxThread.pxThreadName),@toUpperCase("autothread")).
- On the rule form, click Save as.
- On the New tab, ensure that the context points to the application ruleset and the @base class, and then click Create and open.
Previous topic Integrating Cosmos React applications Next topic Using PCore and PConnect Public APIs