callActivity action as an extension
You can indirectly invoke any activity in the mobile app when it is offline to handle use cases that are not supported. For instance, to perform additional tasks such as updating the details of a work object. This is accomplished by calling the callActivity action as an extension using the local storage JavaScript API - you need to use the Run script action and create a JavaScript function that will contain some of the sample code shown below. The invoked action is packaged in the queue to be executed when the app comes back online.
datasyncStart()
function.
Example of calling an activity
The callActivity action is called via the addAction()
method for the window.pms.plugins.clientstore
object, as shown below. The
data represents the primary page against which the activity is executed and the parameters
JSON array represents the list of parameters to set on the Parameter page.
var metadata = {
"action":"callActivity",
"activityName":"TestActivity",
"className" :"PegaSample",
"parameters": [
{"param1":"foo"},
{"param2":"bar"}
]
};
var data = {
"pxCreateDateTime": "20140421T215505.976 GMT",
"LastName":"Smith",
"FirstName":"Joe",
"Language":"English",
"pxObjClass":"Data-"
};
window.pms.plugins.clientstore.addAction( JSON.stringify(metadata),
JSON.stringify(data) );
pyWorkPage
,
newAssignPage
,
pxRequestor
and data pages.