Data persistence

When you create your business automation applications, you can enable data persistence on your data object variables. With data persistence enabled, data object variables are persisted in the server and are not lost between sessions.

You can choose to persist data at the user level, or the application level.

User level

Data is persisted to an individual user within the application. For example, you are designing an automation application that spans multiple pages with many fields a customer must complete. Perhaps the user is creating an account with multiple fields. The account form would have fields that are configured as individual data objects. If you enable data persistence at the user level for any field, the information the customer enters in those fields is persisted. If a user starts to complete the account form, but exits the application, their progress is saved for when they return to complete the form.

Persisting data at the user level is different than persisting data at the user profile level. Persisting data to a user profile applies across all applications and is configured outside of Application Designer. For user level data persistence, the data is persisted per application and configured within Application Designer.

Application level

Data is persisted across all users within the application. For example, your creating an application that uses a comment text box, where users can submit comments. You can set the data for this comment box to persist across the application. Any user comment that is submitted to the application is viewable by all users within the application.

Prerequisite

If you want to use the default data persistence storage for your application, you must enable the Data persistence option in your Business Automation Application deployment. Otherwise, errors might occur when your application is running and trying to persist data. After the Data persistence option is enabled in your deployment, the Content Platform Engine is deployed and preconfigured for data persistence. Any data that as been persisted by the Content Platform Engine, can be administered from the IBM Administrative Console for Content Platform Engine.

For more information about setting the Data persistence option in your deployment, see Configuring Application Engine with data persistence.

Enabling data persistence on data variables

By default, data persistence is disabled for data variables in your application.

  1. From Application Designer, switch Variables tab for your application.
  2. Select a data variable from your list. If the list is empty, create a data variable that you want to persist.
  3. For the Persist data to value, set to User or Application.

    Tip: Only persist data for fields that are necessary for your business application. This limits unnecessary network calls to your server. When your application is running, every change a user makes to a persisted data field results in a network call to the server to save the data.
  4. Preview your application and interact with your persisted data to ensure that the application is behaving as expected.

    Note: When you preview your application in the designer, or the data persistence option is not enabled in your runtime deployment, the persisted data is stored in server memory and lasts until the server is restarted.

Supported data types

Currently, only data types that can be serialized out as string are supported for data persistence.

Data lifecycle

Persisted data remains until the administrator clears the data. If the application is deleted, the persisted data remains in the Content Platform Engine. Inside the IBM Administrative Console for Content Platform Engine, the application State is set to Deleted, but the data is left intact. That way, if the application is imported again, the persisted data is not lost. This allows you to clear the data based on your company data retention policy.