WorkZone PDF with policies
Prerequisite:
- A separate license is required to use the WorkZone PDF Crawler with policies.
- You must enable the policies functionality in WorkZone Configurator.
About policies
After installing WorkZone PDF Crawler, you can configure policies to define which documents are to be converted and in which priority.
You can specify which documents to convert based on the following criteria:
- Document state (for example, Draft, Locked, Archived)
- Document type (for example, Incoming, Outgoing)
- Document group (for example, Decision, Hearing, Complaint, Minutes)
- Case class
- Date of last change
You create and maintain policies in the dvs_policy table that you access through the ScanSQL program, adjusting the policies to the requirements and work flow of your organization, for example, setting up Crawler policies to convert documents based on their date:
- Convert all documents for the last year
- Convert all older documents – meaning documents older than one year.
You can also set up policies to convert documents based on:
- The on-going production of documents, for example the
changed date > installation date
so that users do not have to wait for the PDFs that they have requested. - All archived documents (
State=ARK|AFS
) as a batch process for the purpose of delivery.
Policy priority
The highest priority is 0. You can assign as many priority values to the policies as you need, for example, 0, 1, 2,... 10, 11 and so on.
Setting policy priorities enables converting of important (high priority) policies first and relegates converting of less important (lower priority) policies later, when there may be vacant machine resources to convert documents of these policies - for example, certain document types (WorkZone Document types: DOK, EMBED, I and such) could be assigned a lower priority policy to ensure there are sufficient resources to convert more important documents from a higher prioritized policy.
Create a policy
To create a new policy, execute SQL similar to the following on the database that you want the policy to cover:
Example:
The policy converts all documents of the type DOKUMENT and with the document group REF that are not personal drafts and have been changed since May 4, 2017.
insert into dvs_policy (policy_key, name, enabled, state, record_type, record_grp, cutoff_date, renderer, priority, case_class)
values(1, 'FixedPDFPolicy', 'J', 'UÅ|UL|ARK|AFS', 'DOKUMENT', 'REF', '>20170504', 'PDF', '0', '')
If the single quotes are empty '', there will be no restrictions as to which documents will be converted:
Example:
insert into dvs_policy (policy_key, name, enabled, state, record_type, record_grp, cutoff_date, renderer, priority, case_class)
values(1, 'FixedPDFPolicy', 'J', '', '', '', '>20110504', 'PDF', '0', '')
Example:
The policy results in rendition of all documents after a specific date, for example the last 3 years. For example, today's date is January 1, 2015 and the policy results in rendition of all documents 3 years back, that is January 1, 2012.
insert into dvs_policy (policy_key, name, enabled, state, record_type, record_grp, cutoff_date, renderer, priority, case_class)
values(1, 'FixedPDFPolicy', 'J', '', '', '', '>20120101', 'PDF', '0', '')
Field descriptions
You can add several values for state
, record_type
, record_grp
, and case_class
fields using the "|
" symbol, for example, "DO|I
".
Error-checking
In the current version, there is no error-checking at the SQL level, which means that errors in, for example, the search criteria will only be revealed at run-time. Furthermore, there is no error checking on the stated requirements. For more information, see Troubleshooting policies and Troubleshooting and tips.
Change a policy
You can update a policy through SQL. For example, you can disable the 'FixedPDFPolicy
' policy by executing the following SQL:
update dvs_policy set enabled='N'
where name='FixedPDFPolicy'
Schedule a policy
You can schedule when to run policy-based conversions by adding weekday and time filters to a policy, see the days
and hours
in the Field descriptions. For example you may want to run policy-based conversions outside work hours to avoid extra load on the servers.
Create a policy that converts documents of the record type UÅ and the record group DOK. The policy runs on Saturdays and Sundays from 8:00 to 24:00.
insert into dvs_policy (policy_key, name, enabled, renderer, state, record_type, record_grp, days, hours) values('1', 'Policy_1', 'J', 'PDF', 'UÅ', 'DOK', 'DO', '6|7', '8-24')
Update a policy named policy_1 to run on weekdays from 8:00 to 14:00.
update dvs_policy set days='1|2|3|4|5', hours='8-14' where name='Policy_1'
Create policies that ensure conversion during the night and early morning the next day, for example Sunday night and Monday early morning. It requires two policies.
The first policy ensures conversion from Sunday evening till midnight.
insert into dvs_policy (policy_key, name, enabled, renderer, state, record_type, record_grp, days, hours) values('2', 'NightPolicy_1', 'J', 'PDF', 'UÅ', 'DOK', 'DO', '7', '19-24')
The second policy ensures conversion from midnight till early Monday morning.
insert into dvs_policy (policy_key, name, enabled, renderer, state, record_type, record_grp, days, hours) values('3', 'NightPolicy_2', 'J', 'PDF', 'UÅ', 'DOK', 'DO', '1', '0-6')
Policy types
There are two types of policies:
- Event-driven
- Batch-driven
Policies are aimed at the daily production requirements.
Policies are aimed at catching up in the database where you want to impose new rules and produce new renditions. Batch-driven policies are also convenient when you want to start using WorkZone PDF in a running installation in the middle of a filing period and you want to prepare the existing document archive for transfer or distribution.
Event-driven policies
Event-driven policies convert all documents to PDF as they are produced to facilitate distribution.
Field |
Value |
---|---|
Document State
|
All |
Record Type
|
All |
Record Groups
|
All except |
Class |
All |
Priority
|
|
Cut-off date
|
|
SQL:
insert into dvs_policy (policy_key, name, enabled, state, record_type, record_grp, case_class, cutoff_date, renderer, priority)
values(1, 'PDF-Event', 'J', '', '', '<>DOPE', '', '>20110915', 'PDF', '2')
Batch-driven policies
Batch-driven policies convert all existing documents to PDF to facilitate distribution.
Field |
Value |
---|---|
Document State
|
All |
Record Type
|
All |
Record Groups
|
All except |
Class
|
All |
Priority
|
|
Cut-off date
|
None |
SQL:
insert into dvs_policy (policy_key, name, enabled, state, record_type, record_grp, case_class, cutoff_date, renderer, priority)
values(1, 'PDF-Batch', 'J', '', '', '<>DOPE', '','', 'PDF', '4')
Converts documents of the BIB type from the case class 10 to PDF.
Field |
Value |
---|---|
Document State
|
Empty |
Record Type
|
|
Record Groups
|
All |
Class
|
|
Priority
|
|
Cut-off date
|
|
SQL:
insert into dvs_policy (policy_key, name, enabled, state, record_type, record_grp, cutoff_date, renderer, priority, case_class)
values(1, 'p1', 'J', 'UÅ', 'BIB', '=""', '>20110504', 'PDF', '3', '10')
Converts documents of the BIB type from any class.
Field |
Value |
---|---|
Document State
|
Empty |
Record Type
|
|
Record Groups
|
All |
Class
|
All |
Priority
|
|
Cut-off date
|
|
SQL:
insert into dvs_policy (policy_key, name, enabled, state, record_type, record_grp, cutoff_date, renderer, priority, case_class)
values(1, 'p1', 'J', 'UÅ', 'BIB', '=""', '>20110504', 'PDF', '3', '')
Troubleshooting policies
The current version of WorkZone PDF does not have a user interface for entering and maintaining policies, and there is only little error handling when editing policies in SQL. Errors will be handled only at runtime, when the WorkZone PDF Crawler tries to fetch and interpret the policies.
There are two possible types of errors:
- One or more of the fields in a policy are not in a format which the WorkZone PDF Crawler can interpret.
- The WorkZone PDF Crawler interprets the policy but not in the way you intended it to.
If you write M&M*
as a criterion, it matches all documents with an M
in the corresponding field because &
is a SOM operator. This is probably not what you intended.
The last type of error is revealed only by the number of documents that are converted. You may experience that too few or too many documents are converted.
See issues and workarounds in Troubleshooting and tips.