Utilizing SnapStart module outside of the Pega Mobile SDK

When you develop a custom mobile app in the Pega Platform, you can also use the SnapStart activity, pyMobileSnapStart, outside of the Pega Mobile SDK.

You can use the SnapStart activity to do any of the following in the app:

This is accomplished by entering an appropriate URL in the address field of the mobile browser or a desktop browser.

URL composition

To use the SnapStart module outside of the Pega Mobile SDK you must construct and enter a URL in a browser that directly launches a user into a given screen with the Pega Platform application. The URL has the following format:

[protocol]://[domain]:[port]/[path]?[query]

URL part Usage
protocol Specifies the protocol. Use 'HTTPS' for most cases. You can only use 'HTTP' for prototyping, never in a production environment.
domain The IP address or a domain name to use, for instance: "pega.com".
port The port number that the web server is listening on. The default value is 80.
path The path to the PRPC servlet. The default value is "/prweb/PRServlet".
query Set of parameters to be sent to the Pega Platform server that allows you to create a case, open a case by ID, show a harness, open an assignment or run an activity. See Query string construction below for further information.

Query string construction

You must construct the query string that is part of the URL in the following way:

Parameter Usage
UserIdentifier=[username] Optional. The user name or operator identifier of the user. If this parameter is not supplied along with a password, the authentication process will start.
Password=[password] Optional. A Base64 encoded version of the user's password. If this parameter is not supplied along with a user identifier, the authentication process will start.
pyActivity=pyMobileSnapStart Required. The activity that will launch Pega Mobile SDK after authenticating the user. This should always be pyMobileSnapStart. Any other value will very likely cause undesired results.
Action=[action name]
Required. The Pega Platform application action to invoke. The action name value must be one on the following and must contain additional parameters:
Action Additional parameters
createWork See Create Work parameters for details.
openWorkByHandle See Open Case By ID parameters for details.
showHarness See Show Harness parameters for details.
openAssignment See Open Assignment parameters for details.
runActivity See Run Activity parameters for details.
[name]=[value] Optional. A list of additional parameters. For a complete list, see Optional parameters.

Example

The following is a sample of properly constructed URL string used to open an assignment:

https://pega.test.com:8080/prweb?UserIdentifier=MobileDev&Password=Secret==&pyActivity=pyMobileSnapStart&Action=openAssignment&InsHandle=ASSIGN-WORKLIST%20WB-WBTEST-WORK%20T-17!OPEN&InsClass=Assign-&pyShowFullPortal=true&pyPhoneNavRuleMainVisible=true

Create Work parameters

When using the createWork action to create a case, you must also pass the following parameters:

Parameter Description
InsClass Required. Class name of the work type (case type).
FlowType Required. Name of the flow to run.

Example

The following is a sample Action part of URL string used to create a case:

Action=createWork&InsClass=Wb-WBTest-Work-TestCase&FlowType=pyStartCase

Open Case By ID parameters

When using the openWorkByHandle action to open a case using an identifier, you must pass the following parameter:

Parameter Description
InsHandle Required. The identifier of the case ( pzInsKey ).

Example

The following is a sample Action part of URL string used to open a case by ID:

Action=openWorkByHandle&InsHandle=Wb-Wbtest-Work%20T-1

Show Harness parameters

When using the showHarness action to open a harness, you must pass the following required and optional parameters:

Parameter Description
HarnessTarget Optional. The destination of the harness. By default, the destination is set to " newDocument ", so you do not have to use this parameter.
ClassName Required. The class that the harness belongs to.

If you use pzMobileInitActivity, then:

  • This is the class of that activity.
  • The class of the harness will be the class of the page ( pzMobileContextPageName ) that is created by this activity.
Purpose Required. The name of the harness.
ReadOnly Optional. Makes the harness read-only. Default value is 'false'.
pzMobileInitActivity Optional. The name of the activity to be called to initialize data. Keep in mind that:
  • This is only the activity name.
  • The class is defined in the className parameter.
pzMobileInitActivityParams Optional. A URL-encoded query string of parameters to go to the initialization activity.
pzMobileContextPageName Optional. The name of the page that the activity will work on and on which the showHarness will be opened against. Keep in mind that:
  • This parameter is required if also using pzMobileInitActivity parameter in the call.
  • For example, if you want your harness to show report data, you could name your page "reportPage" and:
    • In your activity, you would create "reportPage" and fill it out with report data.
    • The harness will then be displayed using "reportPage".

Example

The following is a sample Action part of URL string used to show harness:

Action=showHarness&ClassName=Wb-WBTEST-WORK-TESTCASE&Purpose=UserDetails&ReadOnly=true

Open Assignment parameters

When using the openAssignment action to open an assignment, you must pass the following required parameters:

Parameter Description
InsHandle Required. The assignment instance handle ( pzInsKey ).
InsClass Required. The class of the assignment. It often consists of "Assign-".

Example

The following is sample Action part of URL string used to open an assignmet:

Action=openAssignment&InsHandle=ASSIGN-WORKLIST%20WB-WBTEST-WORK%20T-17!OPEN&InsClass=Assign-

Run Activity parameters

When using the runActivity action to run an activity, you must pass the following required and optional parameters:

Parameter Description
pzActivity Required. The name of the activity to run. Keep in mind that:
  • It uses the "activityName" or "className.activityName" form.
  • With no class, it will be either "@baseclass" or the class of the pzPrimaryPageName.
pzActivityParams Required. A URL-encoded query string of parameters to go to the activity.
pzPrimaryPageName Optional. The name of the page for the activity to work on.

Example

The following is a sample Action part of URL string used to run an activity:

Action=runActivity&pzActivity=TestActivity&pzActivityParams=%26test%3DHelloDeveloper%26

Optional parameters

You can also include any of the following optional parameters in the URL string:

Parameter Description
pyShowFullPortal=[true|false] Optional. If set to 'true', the target content is loaded with the surrounding portal navigation. If set to 'false' it is not.
pyPhoneNavRuleMainVisible=[true|false] Optional. If set to 'true', the main navigation is visible on a phone device. If set to 'false' it is not.
pyTabletNavRuleMainVisible=[true|false] Optional. If set to 'true', the main navigation is visible on a tablet device. If set to 'false' it is not.
pyPhoneNavRuleToolbarVisible=[true|false] Optional. If set to 'true', the toolbar is visible on a phone device. If set to 'false' it is not.
pyTabletRuleToolbarVisible=[true|false] Optional. If set to 'true', the toolbar is visible on a tablet device. If set to 'false' it is not.