WorkZone PDF with policies

Prerequisite:

  • Enable the WorkZone PDF Crawler feature in WorkZone Configurator.

About policies

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

The dvs_policy table

You create and maintain policies in the dvs_policy table, adjusting the policies to the requirements and work flow of your organization, for example, setting up 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.

Accessing the dvs_policy table

The dvs_policy table can be accessed through an SQL productivity tool such as Oracle’s SQL Developer or ScanSql, both of which are included in a standard WorkZone installation and available on the WorkZone server.

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

Field Description

policy_key

A key for the policy, for example, 1, 2, 3, and so on. The policy_key must be unique.

name

Name of policy, for example, PDF_of_Everything.

enabled

Enable or disable the policy. Possible values are J (yes) and N (no).

state

Indicates the state of the documents to convert. Possible values are UP, , UL, ARK, and AFS.

record_type

Defines the type of documents to convert. Possible values depend on the database setup, but typically include, for example, DOKUMENT (Document), I (Incoming), U (Outgoing), and so on.

record_grp

Defines which documents from which document groups to convert. Possible values depend on the database setup but typically include, for example, AFG (Decision), HØR (Hearing), KLA (Complaint), REF (Minutes), and so on.

Note: To include only documents where record_grp has not been filled out, set the record_grp field to ‘=””’, that is an equal sign and two double quotes.

cutoff_date

Date and time expression to limit the amount of documents covered in a policy based on the date the document last was updated.

The format is YYYYMMDD where

  • YYYY: Year
  • MM: Month
  • DD: Day

To cut off at May 4th 2015, use >20150504 (8 digits) as the cut-off or >=20150504 if you want to include the date. If you only want to convert the newest documents, insert today's date.

renderer

Indicates the format you want to convert to. Possible value is PDF.

priority

Defines which renditions to prioritize first.

case_class

Defines which documents from which case class (Danish: “sagsgruppe”) to convert. Possible values are the classes defined in the case classification scheme (Danish: “Journalplan”).

The table below gives an overview of how you can use the case_class field.

days

Defines on which weekdays to run a policy. You specify weekdays by a list of numbers (Monday = 1,...., Sunday = 7) separated by a pipe "|", for example:

1|2|3|4|5 - Monday - Friday
6|7 - Weekend

hours

Defines the time to run a policy. You specify start and end time in 24 hours format with or without a leading zero and separated by "-". Allowed values are: [0-23] or [1-24]. You cannot set values to "0-0", or "24-24", and the value on the "right" must be greater than the value on the "left".

Example: Working Hours

08-17 - Working hours
00-05 - Night hours
12-13 - Lunch

Note: Start and end times are exclusive. In the Working hours example above, the policy will start at 8:00 and finish at 16:59.

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
  • Policies are aimed at the daily production requirements.

  • Batch-driven
  • 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 DOPE (Agenda Module)

Class

All

Priority

2

Cut-off date

15th September 2011

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 DOPE

Class

All

Priority

4

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

BIB

Record Groups

All

Class

10

Priority

3

Cut-off date

4th May 2011

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

BIB

Record Groups

All

Class

All

Priority

3

Cut-off date

4th May 2011

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.
  • 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 WorkZone PDF Crawler interprets the policy but not in the way you intended it to.
  • 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.