Configure scheduled jobs
This page explains how to configure the recurring jobs in Signing Workflow.
Se also Configuration reference
Reconfigure without restart
Configurations mentioned on this page can be reconfigured at runtime. I.e. you don't have to restart Signing workflow after modifying the config.json file.
Schedule syntax
When scheduling a job (setting schedule
) you can choose between two styles.
- Quartz Cron Expression
- ISO-8601 Duration
Quartz Cron Expression
Use this if you need a job-firing schedule that recurs based on calendar-like notions such as “every Friday at noon”, “every weekday and 9:30 am”, or even “every 5 minutes between 9:00 am and 10:00 am on every Monday, Wednesday, and Friday during January”.
Example: "0 15 22 * * ?"
means at 10:15 pm daily.
More info can be found in the official documentation for Quartz.
The first execution will happen at the scheduled time. The delay
configuration is only used to delay the scheduling. You can set this to PT0S
to schedule immediately.
ISO-8601 Duration
Sets the delay between job executions. The first execution will happen after given delay
from booting Signing Workflow and repeating every schedule
duration.
Examples:
PT30S
Every 30 secondsP1DT1H
Every 1 day and 1 hour (i.e. every 25 hours)
More info can be found at Wikipedia.
Document Retention
The documents stored in the file area can automatically be removed by activating the document retention job. As documents are permanently deleted from the file area it is very important to have a backup scheme in place for recovery and rollback.
The metadata about the document in the database is not removed by this job.
The function can be activated by setting the configuration parameter documentRetention.enabled
to true.
Note that if the file area contains many documents the initial time for a full clean-up can take some time. Activation is best done outside office hours and the file area and log files should be monitored for any problems.
<p>"documentRetention": {
"batchSize": 100,
"completedDocumentAge": "P30D",
"delay": "PT0S",
"enabled": true,
"inactiveDocumentAge": "PT12H",
"schedule": "0 0 2 * * ?",
"unconsumedDocumentAge": "PT12H"
},</p>
Retention age policy
The document age policy can be configured for three types:
Configuration parameters:
completedDocumentAge
: Max age for all documents that are active and the corresponding order are in state ACCEPTED, REJECTED, CANCELED, or EXPIRED.
inactiveDocumentAge
: Max age for all documents that are inactive or in the corresponding order are in state REJECTED, CANCELED, or EXPIRED.
unconsumedDocumentAge
: Max age for all documents that are not attached to a signing order. This happens when you upload a document but don't add any signers to it.
Note that ongoing (PENDING) documents are never deleted by this job.
Recovery and rollback
In the case of file area, database corruption, or change in retention age policy to retrieve old documents, the documents can be rolled back by the following procedure:
- Stop the application
- Restore the document files from the backup to the file area.
- Optionally change or disable document retention while investigating root causes.
- Run SQL command:
UPDATE documents SET file_state = 0
- Start the application
When the periodic schedule is activated again the documents will be deleted according to (new) settings.
THIS WILL NOT WORK IF YOU HAVE ACTIVATED deleteOrdersJob
. Because that will delete data about the documents from the database. You could also restore the database from a backup.
Delete old signing orders
Enable this job to delete old signing orders from the database.
The statusFilter
selects what kind of orders to delete.
A default value for maximum age is set using defaultAgeLimit
. Which can be overridden by setting one of the status-specific age limits. E.g. acceptedAgeLimit
, cancelledAgeLimit
, etc.
Documents that are attached to the order will be deleted from storage and from the database.
<p>"deleteOrdersJob": {
"acceptedAgeLimit": "",
"batchSize": 100,
"cancelledAgeLimit": "",
"defaultAgeLimit": "P50Y",
"delay": "PT0S",
"enabled": false,
"expiredAgeLimit": "",
"failedAgeLimit": "",
"pendingAgeLimit": "",
"rejectedAgeLimit": "",
"schedule": "0 0 0,1,2,3,4,5 * * ?",
"statusFilter": "REJECTED, CANCELLED, EXPIRED, FAILED"
}</p>
Notifications
The system can be configured to send out email notifications to order solicitors and signers.
Notifications, reminders, and warning emails are sent in batches.
<p>"orderReminder": {
"batchSize": 25,
"beforeExpiration": "P2D",
"delay": "PT3S",
"enabled": true,
"schedule": "PT35S"
}</p>
Link type
Notifications contains some informational message and a link, pointing to the Workflow server.
Each order has the property linkType
, which determines the link action.
Link type | Link action |
---|---|
0 |
After authentication, the user will be directed to the Workflow UI, where she can choose an order to sign or reject. |
1 |
After authentication, the user will be directed directly to the Signing Service, where the document is displayed and the user can choose to sign. After signing the document, the user will be directed back to the Workflow UI. |
Note: the property linkType has default value 0. Currently, linkType can only be set when using the Automation API to create orders.
Downloading files
When an order has been signed by all selected signers, the order solicitor is notified with an email. The email contains a link that can be configured in two different ways.
This feature is governed by the configuration parameter notifications.downloadLink
(true/false). By default, the direct download option is enabled.
downloadLink | Link action |
---|---|
false |
Link to the order view in the Workflow app. This means that the solicitor, after login, is redirected to the web application app where she can choose to click a button to download the file |
true (default) |
Link directly to file download. This means that the solicitor will be prompted to log in, after which the file will be downloaded directly, without presenting the web application |
<p>"notifications": {
"downloadLink": true
},</p>