Delete from time-limited store

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 this store.

Prerequisites

  1. You first have created a time-limited persistent storage
  2. You need to have saved a document into the store with the component, Payload to time-limited store.
  3. You know the unique key of the document, that you want to delete.
Related workflow components are: Time-limited store to payload and Payload to time-limited store.

The component has these parameters:

  1. Time-limited store
    This is the time-limited store, that you have previously created in the tenant settings. You can select it via a drop down list or via an Xpath expression.
  2. Unique key
    This should be a unique key to identify the document, that has previously been saved into the store. 
Notes
Please notice, that the component, Delete from time-limited store will not fail with a message, if you refer to a unique key, that does not match a saved document.

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.

Example2 of how the Delete from time-limited store can be used

The workflow component, Delete from time-limited store can e.g. be used in a workflow, that can be triggered if it is time to re-run any documents, that have previously not been processed without an error. For that scenario it is assumed, that the normal production workflow has an on-error workflow, that saves the input payload (with a matching unique key) into the time-limited store. Notice however, that the store is time-limited, so this re-run must happen before the saved documents are automatically deleted.

In such a case we do not know the unique key of all of the stored documents, but we can get the key when we read a random document from the store with the workflow component, Time-limited store to payload.

Here is such a workflow for inspiration:


The idea of this workflow is to load all stored documents one at a time, process the actual document and delete it from the store.

Only less optimal detail is, that this workflow will always end with an error, when all stored documents has been processed.

Each of the components are described below:

Repeat

We setup the repeat to handle the worst-case scenario: What is the maximum number of documents, that might be waiting in the store? Here we choose 99.

Time-limited store to payload


Now we restore a random document (unique key is empty). We do not know which, but the unique key of the restored document is copied into the predefined variable, interformng.persistentStore.key.

To sub-workflow

Here we call another (generic) workflow which is to process the current payload. This workflow can use the predefined variable, interformng.persistentStore.key to identify the restored document. This value of this variable should not be changed.

Delete from time-limited store


Now we delete the document that has just been processed from the store and then the main workflow goes back to the repeat loop to restore another random document from the store.

This repeats until the Time-limited store to payload component stops with an error, when no more stored documents can be found:


    • 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 ...
    • 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 ...
    • 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 ...
    • Create/change/delete a user

      It is possible to create and delete other users, if you are signed on as either a tenant administrator or as a system administrator. Delete a user The delete of a user is covered in this video: To work with the users you select the SETTINGS icon in ...
    • Delete file

      The advanced utilities workflow component, Delete file can be used in order to delete a local file. A prerequisite for using this workflow component is, that the global setting, Allow direct file access has been enabled on the Global system settings. ...