Close popover

Table of Contents

Enabling online-only features in offline mode

Version:

Expand the functionality of your offline-enabled mobile app by enabling online-only features, such as flow processing.

To use online-only features, you configure your app to call the server directly.

When you design an application that users can access with an offline-enabled mobile app, you can, for example, let users work with cases whose flows contain shapes that are absent from the offline-supported flow processing list. You can also build a user interface that contains online-only controls, or invoke actions that require a connection with the server.

  • Use any combination of the following methods to enable online-only features in your offline-enabled app:

    Choices Actions
    Process an online-only case
    1. Create a new case type in the application and do not add it to the list of offline-supported case types in the mobile channel.

    For example, you can add a case type that contains a utility flow shape for sending an e-mail.

    Online-only cases use all the features that are available to online-only mobile apps. Users can work on such cases only when the app is connected to a network.

    Display online-only layouts, controls and actions in a page
    1. In the user interface for an offline-enabled case type, create an actionable control, for example, a button.

    2. On the Actions tab of the control, add a Launch > Harness action.

    3. Configure the action as online-only by selecting Always display harness from the server.

    For example, you can display a chart control to see a report in a graphical form.

    When the mobile app is connected to a network and the user interacts with the control, the app displays a page that supports all layouts, controls and actions that are available to online-only mobile apps. In offline mode, instead of showing the page, the mobile app displays an alert that users can dismiss to continue their work.

    Display online-only layouts, controls and actions in a user interface page
    1. In the Navigation section of the mobile channel page, add an item to the menu bar, for example, Documents, Reports, or Pulse.

    2. Next to the name of the page that you want to modify, click Configure, and then select Display online version of the page.

    For example, you can display a Pulse page to let users communicate with other stakeholders.

    A fully-functional user interface page is available to users only when the mobile app is connected to a network. In offline mode, when the user taps an icon on the bottom bar, instead of showing the user page, the mobile app displays an alert that users can dismiss to continue their work.

    Immediately run any online-only activity
    1. Create and open a text file rule of js type, for example, department_expenses_api.

    2. In the File source field, add JavaScript code that performs the following actions:

      • Loads an empty data page, for example D_Departments, to the client cache.
      • Defines a function that calls the executeBreakoutCall method, for example fetchData, and populates the D_Departments data page with data from the server.
    3. Check out the pypega_ui_userscripts_offline Static Content Bundle rule to the branch for your application.

    4. In the pypega_ui_userscripts_offline Static Content Bundle rule for your application, add the department_expenses_api text file to the list of included files.

    5. In the user interface for an offline-enabled case type, add and configure a drop-down control:

      1. In the Cell properties window, on the General, in the List source section, in the Type field, select Data page, and in the Data page field, select D_Departments.
      2. In the Load behavior field, select After screen renders.
    6. In the section that contains the drop-down control, add an embedded section:

      1. In the Section Include window, in the Page context field, select Use current page context.
      2. In the Section field, select or create an empty page, for example Script_page.
    7. Configure the Script_page page:

      1. In the configuration page of the Script_page page, on the HTML tab, clear the Auto-generated HTML field.
      2. In the HTML source field, add HTML code and a script that calls the fetchData function.
    For example, you can populate a drop-down control with filtered properties from a large, frequently updated workpage that is not packaged and is not stored in the client store, such as a list of departments and their current budgets.

    A JavaScript method runs the activity and receives a callback that can be a success or a failure, and that you can handle in your code. For more information, see JavaScript API for running any activity in offline mode.

    Schedule any online-only activity
    1. In the user interface for an offline-enabled case type, create an actionable control, for example, a button.

    2. On the Actions tab of the control, add a Run script action.

    3. In the parameters of the Run script action, create a JavaScript function, which contains the code that you create to add the callActivity action to the action queue.

    For example, you can send a notification to the originator of a case, to provide additional attachments.

    A JavaScript method schedules the activity to be run on the server when the offline-enabled mobile app regains network connectivity. For more information, see JavaScript API for scheduling any activity in offline mode.

  • JavaScript API for running any activity in offline mode

    The API for running activities helps you handle use cases that are unsupported in offline mode, by calling a JavaScript method from the custom code that immediately initiates an activity on the server.

  • JavaScript API for scheduling any activity in offline mode

    The API for scheduling activities helps you handle use cases that are unsupported in offline mode, by calling a JavaScript method that places any activity in the action queue. The actions are then run when the mobile app comes back online.

  • Creating a case type

    Save time when processing similar business operations by defining case types that are the templates for work in your application. By creating case types, you automate business processes and support the different paths that case workers can follow to resolve a case.

  • Available actions and conditions

    Choose an action from the list, see which options are available for the action and when you can use it. Learn which conditions you can apply.

  • Adding items to the menu bar

    Create effective navigation experience in your mobile app by adding pages and actions to the menu bar. For example, you can add a custom profile page to the menu bar of your Expenses app so that users can conveniently access the screen with their basic contact information.

  • Keystores

    A keystore is a file that contains keys and certificates that you use for encryption, authentication, and serving content over HTTPS. In Pega Platform, you create a keystore data instance that points to a keystore file.

  • Creating sections

    Use sections to build a modular user interface that promotes reusability and design consistency. By populating your sections with content, you can create a functional chunk of interface that has a specific purpose, and can be used in many contexts.

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.