addActionWithItemReference


Purpose

Adds an action with reference to an offline storage item to the action queue. This method is not supported on Android.

Signature

addActionWithItemReference( type, handle, metadata, data, onSuccess, onFailure, options )

Returns

This method does not return anything.

Parameters

Name Description Type Use
itemType Type of item that the action refers to. string required
itemHandle Type of item that the action refers to. string required
metadata Meta data of the action to be passed to the server. string required
data Data of the action to be passed to the server. string required
onSuccess A callback function, informs that the operation completed successfully. The onSuccess function takes an id parameter that is used to identify the action that was just added. function required
onFailure A callback function, called when the operation fails. Passes a JSON object that consists of an error code, as defined in the Constants table in the Client Store article, and an error message. function required
options A JavaScript object containing optional flags. object optional

The options object contains flags that enable action filtering in the getQueuedActionsCount and listActions methods. It is structured as follows:

{
  silent,
  lax,
  negligible
}
Name Description Type Use
silent

By setting this flag to "true" you can filter out actions from the results of the getQueuedActionsCount and listActions methods.

boolean optional
lax By setting this flag to "true" you can filter out actions from the results of the getQueuedActionsCount and listActions methods. boolean optional
negligible By setting this flag to "true" you can filter out actions from the results of the getQueuedActionsCount and listActions methods. boolean optional

Caution

For the synchronization process to execute as designed, both metadata and data strings must contain a proper JSON object.

Related topics

Client Store
Legal notice | Copyright © 2017 and Confidential to Pegasystems Inc. All rights reserved
PDN | Feedback
Advanced...