addListener


Purpose

Adds a listener to the Client Store service.

Signature

addListener( callbacks )

Returns

This method does not return anything.

Parameters

Name Description Type Use
callbacks An object where all the callbacks are defined. object required

The addListener method's callbacks object is structured as follows:

{
  onStatusUpdate: function( status ), {...}
  onProgress: function( progress, phase ) {...}
}

The onStatusUpdate callback receives the status JSON object as its call parameter representing the current Store and Forward process status, consisting of:

Name Description Type
busy Represents the Client Store service's state: "true" if synchronization is running and "false" if it is idle. boolean
event Defines event that caused the Client Store's status update as defined in the Constants table in the Client Store article. Undefined if no status update has occurred. constant
upsertedItems A map of types registered with "reportChangesForTypes" vs. arrays of handles of all inserted or updated synchronization items. Undefined for events other than SUCCEEDED. object
deletedItems A map of types registered with "reportChangesForTypes" vs. arrays of handles of all deleted synchronization items. Undefined for events other than SUCCEEDED. object
modifiedCustomTables An array of custom tables that were modified as a result of the delta synchronization. If there are no modified custom tables or the full synchronization command was invoked, an empty array is returned. Undefined for events other than SUCCEEDED. object
wasFullSync A value that is set to true if full synchronization operation was performed. This indicates that all items and custom tables were modified. boolean
lastErrorCode Specifies the type of error of last failure as defined in the Constants table in the Client Store article. Undefined if no error has occurred. Updated accordingly by SUCCEEDED or FAILED events. constant
lastErrorMessage Represents a human-readable description of the type of failure. Updated accordingly by SUCCEEDED or FAILED events. string

The onProgress callback receives the following properties as its call parameters:

Name Description Type
progress A number from the 0 - 100 range, indicating the synchronisation progress. number
phase Specifies the data synchronization status, as defined in the Progress table of the Constants section in the Client Store article. Undefined if no phase change occurred. constant

Related topics

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