Offline Data Synchronization in Pega

Offline Data Synchronization in Pega

Article content

1. Introduction 

Pega supports mobile applications that can function in offline mode, enabling users to continue working even without internet connectivity. To ensure consistency and continuity of work, Offline Data Synchronization is a critical mechanism. It allows data created or modified on the client (mobile) to be synchronized with the Pega server once connectivity is restored. 

 

2. What Is Offline Data Synchronization? 

Offline data synchronization in Pega is the process of: 

  • Downloading necessary data and rulesets to the mobile device. 

  • Allowing work to be performed offline. 

  • Capturing all changes locally. 

  • Syncing all changes back to the server when online. 

 

3. Key Components Involved 

  • Pega Mobile Client: A hybrid app that allows offline processing. 

  • Offline-enabled Case Types: Case types configured to be available offline. 

  • Data Pages (D_ pages): Used to preload reference data. 

  • Work Queues and Worklists: Assignments downloaded for offline processing. 

  • Sync Engine: Responsible for data consistency between client and server. 

  • Storage: IndexedDB or WebSQL on mobile device for storing offline data. 

 

4. Types of Data in Offline Mode 

  • Static Reference Data: Used for dropdowns, picklists, etc. 

  • Assignments: Work items assigned to the user. 

  • Work Objects: Case information to be edited or created offline. 

  • Rules (UI, Validation, etc.): Needed to perform case actions offline. 

 

5. Data Synchronization Flow 

a. Initial Sync 

When a user logs in: 

  1. Client checks for rule/data updates. 
  2. Downloads:

Assignments 

Case type definitions 

Static reference data 

b. Working Offline 

  • User performs actions on cases. 

  • Data is stored locally. 

  • Actions are queued as delta updates. 

c. Sync When Online 

  • Client connects back to the server. 

  • Sends delta updates. 

  • Pega server processes updates and responds with: 

  • Updated assignments 

  • Resolved status 

  • Errors (if any) 

 

6. How to Configure Offline Sync 

1. Enable Offline Support 

  • Use the Pega Mobile configuration. 

  • Enable “Offline support” for the app in App Studio. 

2. Prepare Case Types 

  • Make case types offline-compatible. 

  • Design screens to use auto-generated UI (non-auto UI not supported offline). 

3. Use Offline-enabled Controls and Rules 

  • Use controls supported by offline. 

  • Use client-side validation where possible. 

4. Manage Data Pages 

  • Use Requestor-level or Thread-level data pages for offline. 

  • Pre-load reference data via "Preload Data Page" settings. 

5. Custom Synchronization Logic (Optional) 

  • You can write custom JavaScript to manage sync behavior or data preparation using pega.offline. 

 

6. Sync Strategies and Best Practices 

  • Minimize Data Volume: Send only necessary data. 

  • Use Pagination: Avoid large datasets in offline mode. 

  • Error Handling: Plan for partial sync or failure. 

  • Conflict Resolution: Handle concurrent updates carefully. 

  • Testing: Use device simulators and field testing to validate. 

 

7. Debugging and Monitoring 

  • Use Pega Mobile Offline Debug Tool (Browser-based). 

  • Use Developer Tools to inspect IndexedDB storage. 

  • Check logs in MobileSyncQueue, Data-WorkAttach-File for sync records. 

  • Monitor with Tracer and Mobile channel logs in Admin Studio. 


--TEAM ENIGMA

 

To view or add a comment, sign in

More articles by Enigma Metaverse

Others also viewed

Explore content categories