Archiving workflow instances

Facebooktwittergoogle_pluspinterestlinkedinmail
Applies to version 2017.1.x; Author: Wojciech Mleczko

The archiving mechanism allows to you automatically move workflow instances from the production database to an archive by using a convenient action executed by the system. The obvious benefit of this operation is that it allows you to manage the size of your content database (database retention), by removing chosen workflow instances from it.

There are three available archiving (aka. retention) modes:

  1. Moving data to an archive database – workflow instances will be saved in a separate database. The advantage of this solution is that it is possible to browse archived information using an appropriately configured Show Workflow Elements Web Part. Using this option, users will be able to look up all historic data and related attachments.
  2. Moving to an external network location – workflow instances will be saved on a selected network drive as .zip files with a PDF file containing metadata from the form, and an XML file containing the history of the workflow instances and attachments (with the option to save only their latest version)
  3. Deletion from the content database – chosen workflow instances will be completely deleted from the operating database. Their copies will not be saved anywhere.

Mechanisms for managing archived data are available and executed via “Archive workflow instances” and “Archived instances retention” actions – found under the “Database retention” action group.


 

1. Preparing the database

In order to archive workflow instances to a separate database archive, first prepare the database through the installer.

Launch the installer and then choose option Tools for application management:

 

Next click on Database creation:

 

Then choose Archive databases, and next click on Create archive database:

 

Input database name and click Create:

 

After a short while, a summary window of the database creator will be displayed. The database was created and is ready to use – you can close the installer.


 

2. Preparing the service

For the service to be able to process the archiving queue, it is required to turn on the ‘Workflow instance archiving’ role in the service configuration.

 

After selecting the role and saving the settings it is needed to load service configuration again.


 

3. Configuring archiving actions

Depending on the used archiving type, it is needed to define the archive base location or network location in process settings:

 

The archiving action can be placed somewhere in the workflow configuration, or as an action executed cyclically.

These examples present the usage of a cyclical action.

 

3.1. Retention mode 1 – Move to archive database

The first archiving mode allows you to move workflow instances to an external database – also called an archive. The Archive database used for each process is defined in the process settings (or globally in system settings):

 

IMPORTANT: Regardless of chosen mode, the archiving process is irreversible and causes permanent data deletion from the content database – for archived instances, data will be saved only in the archive database.

 

The action configuration allows to set archiving mode, priority, archiving only in night hours, and query definition returning ID’s of instances to archive.

 

Action configured in this manner is ready to be used, and executing it adds instances directly to the archive queue.

 

3.1.1. Data presentation

Access to archived instances is granted via SWE Web Part. Configure it so it displays data from archived processes and then choose the process from which data is to be displayed:

 

As with a normal SWE report – you can define columns which are going to be visible or set grouping and sorting.

Clicking on selected instance loads the form preview. Available are also buttons to download XML files which contain data of the last version, as well as all historic versions. Note: In this view, you can also see all form fields, including technical ones.

 

3.2. Retention mode 2 – Move to an external network location

The second arching mode allows you to move instances to a location chosen in the process configuration:

 

As stated previously, the archiving process is irreversible and causes permanent data deletion from the content database – in this case, instances will be saved only in the chosen network location.

The action configuration allows to set archiving mode, priority, archiving only in night hours, and query definition returning ID’s of instances to archive.

 

3.2.1. Data presentation

Archived data is stored in ZIP files in provided network location:

 

ZIP archive contains XML files with instance data – the last version, all historic versions, a PDF file showing the last known view of instance data, and any attached files.

 

3.3. Retention mode 3 – Remove from content database

The final archiving mode deletes the selected instances.

The action configuration allows to set archiving mode, priority, archiving only in night hours, and query definition returning ID’s of instances to delete.

It goes without saying, that this mode permanently deletes instances from the cotent database (however instance numbers still cannot be reused!). The instance data will no longer be available anywhere.

 


 

4. Verifying correct execution and troubleshooting

The instance archiving process is asynchronous – which means that the archiving actions add instances to the queue, which are then processed by the service.

The WFActionExecutions table stores information for specific archiving action executions, and which instances (WFD_ID) were added to the archiving queue during each action:

 

To view your current archiving queue, in WEBCON BPS Designer Studio, go to the Reports section – and find Archive workflow instances queue.

Leave a Reply

Your email address will not be published. Required fields are marked *