When you develop Pega® Platform applications such as mobile apps, you must follow certain guidelines and be aware of some special considerations to enable offline capability in applications.
For more information, see the following sections:
- Enable offline capability in your access groups and case types
- Use supported controls
- Use supported actions
- Flow processing considerations
- Other considerations
For background information about offline capability in applications, see Offline capability.
Consider the following information when enabling offline capability for your access groups and case types:
- You enable offline capability for an access group on the Advanced tab of the Edit Access Group form by selecting the Enable offline support check box.
- A single offline-ready application can support both online-only and offline-ready case types. The online-only case types are still available in the mobile app, but a user can create assignments or edit them only while online.
- The following restrictions apply while working offline:
- Case stage transitions are not supported.
- Subcases are not supported.
- Circumstance application rules are not supported.
- You must enable offline capability for each case type that you want to support in offline mode. On the Advanced tab of the Edit Case Type form, select the Enable offline support check box.
- After you log in to a custom mobile app on a device and enable or disable the offline capability in Designer Studio (for example, for the application's case types and access groups), for the settings to take effect, you need to reinstall the mobile app or clear its data.
- After offline capability is enabled, you can create individual assignments within that case type while working offline. Screen flows that are a part of the case type can also be run while offline. For more information, see Flow processing considerations.
- If you create a case type, it uses dynamic views by default, which will not work in offline mode. However, you can disable dynamic views on the Views tab of the case type so that the case type uses regular harnesses and sections.
- The login rule for all offline-enabled applications must be based on the Web-Login rule in the Pega-EndUserUI ruleset. This rule contains all the required user interface items and references to scripts that are used by the offline-enabled applications.
By default, you use a portal in the UI-Kit-7 (09-01-01) ruleset to build applications. You can create your own portal for offline capability, as long as it uses some of the key principles and design of the pyCaseWorker portal. For more information, see Composite portal and Creating a composite portal. A portal that is based on the Case Worker portal (such as pyCaseWorker) has the following requirements:
- It must be set as the default portal for every access group whose users access the offline-enabled application.
- It must use an iFrame-less dynamic container.
- The harness in the portal must be defined in the Data-Portal class.
- The cases must use stages and use pyStartCase as the starting flow on a case.
When developing a mobile app for offline capability, you must build every screen by using modern layouts and lists. For a complete list of supported controls that you can use while creating the user interface, see Supported controls when working offline.
Buttons, links, icons, and menu items must use only the supported set of actions. For a complete list of actions that are supported while working offline, see Supported actions when working offline.
You must use flows in case types. For more information, see Flow processing in offline mode.
The following information is important to know while developing Pega Platform applications with offline capability:
- You configure and build an Android or iOS offline-enabled custom mobile app as a channel interface. For more information, see Configuring a custom mobile app.
- Case objects are available in offline mode:
- All cases are available from the worklist.
- When a case is marked for offline use, a field for adding a data page lists the case objects to send to the client for offline use. Any case in this list that is synced will be available offline.
However, if this data page misses a case that a user needs, when the user goes to online mode and attempts to open a case that is marked for offline, and that case is not available locally on the device, the client retrieves the case from the server. The case then remains available on the client even after the user goes offline.
- A landing page lists various configurations that must be performed for the offline mobile app. To access this landing page, click > > .
- To force a full synchronization of your offline-enabled application, click Advanced tab of the Edit Access Group form or the Offline Configuration landing page. This action is required if any rules change because the changed rules are then only synchronized when full synchronization takes place. on the
- To display a worklist for an offline-enabled application:
- Use the D_pyUserWorkList data page in the UI-Kit-7 (09-01-01) rule, as an example for how to configure your data page.
- The data page must be of Code-Pega-List type and of Assign-Worklist or Assign-Workbasket object class type.
- To be able to open an assignment, make sure that the following properties are in the data page:
- Make sure that pyCompletedOffline is set to true when the synchronization has finished, so that you can remove the work object from the worklist by using a client-side when rule.
- If the worklist is displayed on the home section, for example, the section that is initialized in the dynamic container, this section is automatically refreshed after data synchronization.
- To prevent data synchronization issues, review the settings on the Context tab of the offlinehttp service package rule, and make sure that Use service session cookie (REST/HTTP only) is selected.
- To improve performance, large data pages are supported for storing reference data for offline use. For a large data page, only the changed records are synchronized when the application goes online. For more information, see Tutorial: How to use large data pages to store large reference data in offline mobile apps.
- For regular data pages, the following data synchronization limitation applies:
- The data page size cannot be larger than 10 million characters.
- Because the string is UTF-8 encoded, this size represents approximately 7.6 MB if all the character codes are between 1 and 128 (for languages such as English, German, or French).
- You can extend the app by using a CallActivity extension point during each synchronization to handle use cases that are not supported. For example, you can perform additional tasks such as updating the details of a work object. For more information, see callActivity action as an extension.
- If the Pega Platform was installed on an Oracle WebLogic application web server, make sure to manually enable preemptive authentication, because it is disabled by default. Set the following Oracle SOA 11g partnerlink binding property to true:
- Add a custom script by saving the pypega_ui_userscripts_offline script bundle to the application ruleset, and then add your script files to this bundle.
pega.offline.DataSync.setIntervalBetweenSynchronizationsWhenServerAccessible– Sets the interval (in milliseconds) between subsequent synchronization sessions when the server is available. By default, it is set to 5 minutes.
pega.offline.DataSync.setIntervalBetweenSynchronizationsWhenServerInaccessible– Sets the interval (in milliseconds) between subsequent synchronization sessions when the server is not available. By default, it is set to 1 minute.
pega.offline.Indicator.setDeferDurationTime– Sets the time (in milliseconds) that must pass from the start of the synchronization session before the Syncing/Synced label is displayed on the screen. By default, it is set to 4 seconds.
pega.offline.Indicator.setHideSyncedAfterTime– Sets the time (in milliseconds) that must pass from the end of the synchronization session before the Synced label is no longer displayed on the screen. By default, it is set to 5 seconds.
- When using the defer load option:
- The defer load sections or layouts are loaded on the initial load, and the defer load preactivity is always ignored. This behavior affects the performance of loading screens.
- Defer load is not supported in tabs. You must use a layout group instead.