Skip to main content
LinkedIn
Copied!

Table of Contents

JavaScript API for scheduling any activity in offline mode

Version:

Only available versions of this content are shown in the dropdown

The API for scheduling activities helps you handle use cases that are unsupported in offline mode, by calling a JavaScript method that places any activity in the action queue. The actions are then run when the mobile app comes back online.

The app does not wait for a response from the scheduled activity.

You can use the activity scheduling feature, for example, to send a request for additional attachments to the originator of a case.

You can combine features from different APIs. For example, you can use data synchronization API methods to send the queue to the server immediately. For more information, see Data synchronization JavaScript APIs.

Example

You can use the Run script action and create a JavaScript function that contains your code, similarly to the following sample code. In the example, you call the callActivity activity through the addAction() method for the window.pms.plugins.clientstore object. 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) );
You cannot use any of the currently-loaded clipboard pages in the main user session. If you open a work object on the server, the callActivity action cannot access the current workpage. You must load any required clipboard pages before applying the changes, for example, you can use the pyWorkPage, newAssignPage, pxRequestor pages and data pages.
Suggest Edit
Did you find this content helpful?

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Ready to crush complexity?

Experience the benefits of Pega Community when you log in.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us