Data persistence

When you create your business 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 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 the low-code designer. For user level data persistence, the data is persisted per application and configured within the low-code 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 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.

Enabling data persistence on data variables

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

  1. When creating your business application in the low-code designer, switch to the 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, or when 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.

Deleting persisted data

You can remove persisted data from Content Platform Engine. The entries that you remove from the console are not deleted from the system.
  1. Log in to IBM Administration Console for Content Platform Engine.
  2. In the navigation pane, go to Object stores > AEOS. In the AEOS tab that opens, click Search in the navigation pane.
  3. Select the entries that you want to delete. Click on one of the Actions drop-down, select Batch Operations, and select the delete checkbox. Click OK.

Managing data access

You can configure user access to application data in Content Platform Engine.

  1. Log in to IBM Administration Console for Content Platform Engine.
  2. In the navigation pane, go to Object stores > AEOS. In the AEOS tab that opens, go to Data Design > Classes > Other Classes > Abstract Persistable > BO Persistence.
  3. In the class view, go to the Default Instance Security tab. In this tab you will see the default security users and permissions:
    • AUTHENTICATED-USERS is read only.
    • CREATOR-OWNER has all permissions.
    • cp4admin is for the Content Platform Engine administrator and has all permissions.
  4. To update permissions, select the entry and click Edit.... To add new permissions, click Add Permissions... and search Lightweight Directory Access Protocol (LDAP) to add a user or group. Updated and new permissions will only apply to new objects.
  5. To update or view permissions on existing items, you can use the Search option in the navigation pane.
    1. Click New Object Store Search and select BO Persistence under the class drop-down.
      Configure a search to find the data that you want to delete.
      1. Click New Object Store Search.
      2. In the class drop-down list, select BO Persistence.
      3. Enter properties to filter your search. If you want to search for user data, select the Creator property, select Equal To in the condition field, and enter the user's ID in the value field. You can also filter by the application ID or scope.
      4. Click Run to run the search.
      Object search interface
    2. Select the objects with permissions that you want to change. Click the Actions drop-down and select Batch operation.
    3. In the Batch operation window that opens, select the Security tab. Using the Add ... drop down, add your desired users and groups. Then, select your desired permissions in the list below.
      Batch operation user interface