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:
- Create a case.
- Open a case by ID.
- Show a harness.
- Open an assignment.
- Run an activity.
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:
|
||||||||||||
[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 theopenWorkByHandle
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
|
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:
|
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:
|
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:
|
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. |