Using the ScanJour.AutoPurge.exe program
You can set up WorkZone to automatically send cases and documents with expired retention dates to the trash bin as well as automatically empty the trash bin after a predefined grace period, permanently deleting them. During the grace period (called purge period in WorkZone), users can retrieve any erroneously trashed cases or documents from the trash bin before they are permanently deleted.
To set up automatic deletion of expired cases and documents in WorkZone, you must:
- Enable Automatic purging for the relevant retention policies in WorkZone Configurator
- Enable Automatic soft deletion for each retention policy in WorkZone Configurator
- Define the Purge period for each retention policy in WorkZone Configurator
- Set up and configure the ScanJour.AutoPurge.exe program as a scheduled task on the WorkZone Content Server
The ScanJour.AutoPurge.exe
The ScanJour.AutoPurge.exe program is used to traverse the database, select the cases and documents to be deleted, and send them to the trash bin as well as delete cases and documents that are no longer to be retained from the trash bin.
The program will only delete case and documents where the retention date has expired. A document with the same retention date as the day the ScanJour.AutoPurge.exe program is executed will not be affected as the retention date has not expired when the program was run.
Location
The ScanJour.AutoPurge.exe program is part of the normal WorkZone installation and is found on the WorkZone Content Server in the installation default installation folder C: > Program Files (x86) > KMD > WorkZone > Program.
The ScanJour.AutoPurge.exe program is dependent WorkZone components and architecture and cannot be run without WorkZone.
Running the ScanJour.AutoPurge.exe progam
The ScanJour.AutoPurge.exe program can be executed on the WorkZone Content Server, either manually in a command prompt, or as a scheduled task in the Windows Task Scheduler. You can for example schedule the ScanJour.AutoPurge.exe program to run every night to minimize impacting daily operations.
Parameters and arguments
ScanJour.AutoPurge.exe has one parameter and two arguments. These must be defined when setting up the scheduled task and when running the program manually.
Parameter |
Description |
---|---|
/db:<database> |
Specify the database where <database> is the name of database the ScanJour.AutoPurge.exe program job is to traverse and automatically delete cases and documents from. |
/trash |
Send any cases or documents with expired retention periods1 to the trash bin2. |
/purge |
Empty the trash bin of any cases or documents that satisfy the purge requirements defined for the retention period of each case or document in the trash bin2. The Purge date field on a deleted case or document is used to determine if a case or document is eligible for permanent deletion. |
/help |
Display on-screen help for the parameters and options. |
1 Only cases and documents with retention policies with automatic deletion enabled will be affected.
2 Retention policies are defined in WorkZone Configurator > Retention.
Status and errors
When the ScanJour.AutoPurge.exe program is executed and cases and documents are deleted, you can view the status of the deletions and any potential errors that may have occurred in the Windows Event Viewer or directly by using the WorkZone QueryBuilder to generate OData queries. Additionally, You can see which cases or documents have been deleted in the Deletion log.
The Windows Event Viewer
If the ScanJour.AutoPurge.exe program is run as a scheduled task, you can see the status of the task and any errors in the Windows Event Viewer. There will be two entries for the task. The first entry displays when the ScanJour.AutoPurge.exe program was started and the last entry displays when the program ended as well as the results of the task.
For each option (/trash and /purge), supplementary documents are searched first, then main documents and finally cases (called files in the Microsoft Event Viewer).
Completed: /db:db01 /purge /trash
Supplemental documents trash result (Found, Trashed, Skipped, Errors): (11,10,0,1)
Main documents trash result (Found, Trashed, Skipped, Errors): (4,4,0,0)
Files trash result (Found, Trashed, Skipped, Errors): (2,2,0,0)
Supplemental documents purge result (Found, Trashed, Skipped, Errors): (6,6,0,0)
Main documents purge result (Found, Trashed, Skipped, Errors): (3,3,0,0)
Files purge result (Found, Trashed, Skipped, Errors): (1,1,0,0)
In the example above, 11 supplemental documents, 4 main documents and 2 cases were found and sent to the trash bin (/trash). One document contained an error which prevented the document from being sent to the trash bin. Thereafter, 6 supplemental documents, 3 main documents and 1 case were permanently deleted from the trash bin (/purge).
WorkZone Deletion Log
The Deletion log lists all cases and documents that have been permanently deleted, including cases (files) and documents (records) automatically deleted by the ScanJour.AutoPurge.exe. There are two fields that can be used to determine which cases and documents were deleted by the the ScanJour.AutoPurge.exe program:
- Trashed by: Displays the user who sent the case or document to the trash bin.
- Deleted by: Displays the user who emptied the case or document from the trash bin - effectively deleting it permanently.
The SJPURGEUSER is used to indicate that a case or document has been deleted (sent to the trash bin or permanently deleted) by the ScanJour.AutoPurge.exe program.
The Deletion log is accessed through WorkZone Configurator.
OData queries and WorkZone QueryBuilder
OData queries can be created in the WorkZone QueryBuilder and can be used to display the number of deletion errors and their corresponding error texts from the ScanJour.AutoPurge.exe program.
There are two entities (Cases and Documents) you can query:
For documents:
In the WorkZone QueryBuilder, select the following values:
Entity |
Documents(Records) |
Filter |
Trashed by(ThrashedBy_Value) | in (;separated) | "";<>"" Record retention policy(RetentionPolicy) | Error description(ErrorText) | is not empty |
Select |
Id(ID) | Summary(Summary) |
Expand |
Record retention policy (RetentionPolicy) | select Error description(ErrorText) |
For cases:
In the WorkZone QueryBuilder, select the following values:
Entity |
Cases(Files) |
Filter |
Trashed by(TrashedBy_Value) | in (;separated) | "";<>"" Case retention policy(RetentionPolicy) | Error description(ErrorText) | is not empty |
Select |
Id(ID) | Summary(Summary) |
Expand |
Case retention policy(RetentionPolicy) | select Error description(ErrorText) |