Time-limited persistent storage in workflows

Time-limited persistent storage in workflows

Introduction

Some customers are using the file system or the library to store input XML documents, in case they need to be re-processed later due to an error. Other customers use the file system or the library to temporarily store inputs that need to be combined with other inputs that arrive later.
While this data is usually meant to be temporary, it is often never deleted, as the deletion procedure requires a somewhat complex workflow action.

This can cause a number of problems:

  1. When saving to the file system with the “append version” conflict resolution, the time to save the file will increase with the number of same-name files that already exist.

  2. Getting a full listing of the files in a folder/resource library takes a long time and uses a lot of memory when a huge number of files exist in the same folder.

  3. The storage usage keeps growing.

The time-limited persistent storage is an application-managed storage with automatic expiry and compression. This conserves storage space by compressing the stored data, ensures near-constant time saving and re-uses storage space from expired items to limit the storage usage growth.

Settings

To be able to use the time-limited store, an instance must be created in tenant settings.
In the settings section “Time-limited store” create a new instance as below:



As “name” specify a unique name for this store.
As “expire items after days” specify the number of days that items should be kept in the store. The related workflow components are referenced below:

Payload to time-limited store

This component can store the current workflow payload in a time-limited store. The stored payload is identified by a unique key. If an item with the same key already exists in the store, the item will be overwritten.
As “Time-limited store” select a storage instance that has been defined in settings.
As “Unique key” specify the unique key identifying this item. The same key can be used to read the item from the store.

Time-limited store to payload

This component can read a previously stored item from a time-limited store and make it the payload.
As “Time-limited store” select a storage instance that has been defined in settings.
As “Output type“ select the data type of the item that is read from the store.
As “Unique key” specify the unique key of the item to read. If no key is specified, then the “first” item in the store will be read. The item order is unspecified. Leaving this field blank can be used to iterates through all items in the store in a repeat loop.
The workflow variable “interformng.persistentStore.key” will afterwards contain the key of the item that was read.

Delete from time-limited store

This component will delete a previously stored item from a time-limited store.
As “Time-limited store” select a storage instance that has been defined in settings.
As “Unique key” specify the unique key of the item to delete.
Note that this component will always succeed even if the key does not exist in the store.

Example of this can be used

One way to use the time-limited store is to save the initial payload when the workflow starts with the component, Payload to time-limited store and then delete this again as the last thing in the workflow with the component, Delete from time-limited store. In this way the payload will be kept for a few days if the workflow should happen to fail.
    • Related Articles

    • Payload to time-limited store

      The Advanced, other workflow component, Payload to time-limited store is related to the tenant setting, Time-limited persistent storage. With this component you can temporarily store the current payload into a time-limited storage, that you have ...
    • Delete from time-limited store

      The Advanced, other workflow component, Delete from time-limited store is related to the tenant setting, Time-limited persistent storage. With this component you can delete a document from the time-limited store, that you have previously saved into ...
    • Date & Time Operations

      Handling dates and times in XPath is essential for printing timestamps, performing date arithmetic, formatting output, and conditioning elements based on time-based rules. This section covers these functions in depth. Printing the current date/time ...
    • Export workflows

      It is possible to export one or multiple workflows in InterFormNG2 into a zip file. The zip file can then be imported in another installation (or tenant) of InterFormNG2. In order to export one or more workflows, you first need to select the workflow ...
    • Import workflows

      It is possible to import workflows, that previously has been exported. To import one or more workflows you need to select the workflow tab in the top ribbon and then import workflows: Then you will see this window: In the window you have these ...