Data synchronization in offline mode
When an offline-enabled mobile app is not connected to a network, an action queue
stores local user actions. When network connectivity is restored, the contents of the action
queue are pushed to the server, and Pega Platform processes them. At the same time, all
modified data pages and work objects are synchronized to the mobile device.
When you design
an application that users can access with an offline-enabled mobile app, consider the
following information with regard to data synchronization.
- Full synchronization
- Sends all queued user actions to the server and synchronizes the application
model and all data items and work objects to the mobile device. Full
synchronization happens in the following situations:
- When the user starts the offline-enabled mobile app for the first time, and you do not prepackage the access group data in the mobile app executable files.
- When you force full synchronization for all users that belong to an access group.
- When the user clears the local storage on a mobile device for debugging purposes.
- Delta synchronization
- Sends all queued user actions to the server and synchronizes only the
changed data items and work objects to the mobile device. Delta
synchronization can happen in the following situations:
- When the user starts the offline-enabled mobile app for the first time, and you prepackage the access group data in the mobile app executable files.
- Each next time the user logs in to the offline-enabled mobile app.
- After a single user's action appears in the action queue, for example, when the user completes a transaction by submitting an assignment.
- When the user taps the connection status indicator in the offline-enabled mobile app.
- During a periodic syncing operation: every 5 minutes, if the server was last accessible, or every 1 minute, if the server was not accessible.
- When the device goes from offline mode to online mode or a new hardware network interface is attached.
- When you call a JavaScript API method that starts data synchronization.
Note: When the mobile app initiates synchronization, the server determines if it is
delta synchronization or full synchronization. You can synchronize mobile data even
after you suspend or terminate an app. However, system settings and status, such as
battery life or network connection, can limit or delay the synchronization process.