Screen flows in offline mode

You can use screen flows to perform back-to-back assignments when working in offline mode.

Building a flow that can be processed offline, use only the following types of shapes:

  • Assignment shapes
  • Question shapes
  • Decision shapes with when rules and simple Boolean expressions that are run on the client
  • Decision shapes that are the first shape of a screen flow
  • Utility shapes at the end of the screen flow. The utility does not run when offline, but becomes available online when the completed assignments are synced to the server.

If any other shape is reached, the flow processing stops when offline.

Additional considerations:

  • Use the default Back button in the screen flow harness. The Back button returns you to the previous assignment as defined in your screen flow.
  • Data transforms automatically run in offline mode for preprocessing and postprocessing. Otherwise, you can include custom JavaScript code to execute some basic business logic before and after a flow action is rendered in offline mode. This is accomplished by adding your own JavaScript code into a custom user scripts bundle called pypega_ui_userscripts_offline. Its functions must be called within a try/catch clause. The JavaScript code to be executed before a flow action is rendered is always called after ClientCache and before the DisplayHarness is called. Pre-activities and post-activities can also run when the flow is syncing to the server.
  • To set a flow result, use the JavaScript pega.process.flow.setFlowEndStatus() method. This method overrides the status set using a property in the subflow's end shape. The offline process engine takes into account the likelihood setting if the flow result is conflicting or is absent, provided it is not in a subflow.
  • The completed datetime stamp in the audit trail is the datetime recorded on the server when the item is synced when back online.