Knowledge Center

202 - Entering an Archive Rule Safely

Updated on

Entering an Archive Rule Safely

The column pattern, how multi-condition rules are assembled, and the mistake that archives an entire client.

All three rules tables share the same column pattern: RuleName, ColumnName, CompareOperator, LogicalOperator, Value, Disable and TableName.

Disable

Disable = 1 means the rule is disabled. Disable = 0 means it is live. Every safe procedure below depends on having this the right way round.

How a multi-condition rule is assembled

Each condition is its own row. Rows sharing a RuleName are assembled into a single criteria filter and run against the table named in TableName. The first row's LogicalOperator must be AND.

A rule matching one matter looks like this:

RuleName
ColumnName

CompareOperator

Value

TableName

Carnival
Custom1=107Workspaces
CarnivalCustom2=010Workspaces

Warning The service polls every 20 to 25 seconds. A rule entered one row at a time will be picked up half-finished. With only the first row present, the criteria filter reads “every workspace where Custom1 is 107” — every matter for that client.

The two safe procedures

  1. Set Disable = 1 on every row as you enter it, then clear it once the whole rule is in place. This is the usual choice.
  2. Or stop GDSI.DMSyncArchiveService before you start typing, and start it again afterwards.

Either works. Doing neither is how firms archive a client by accident.

The columns only ArchiveRules has

Column
Purpose

Ongoing
Re-evaluate the rule as new content appears
DefaultSecurityPrivate, Public or View, applied to the workspace after a successful export
ArchiveAfterDtUtcWhen the archive should occur
ArchiveLocationIdWhich registered destination to use — the only enforced foreign key in the schema

DisableArchiveRuleWhenDone in appsettings.json makes a completed rule disable itself so it does not re-run. Confirm the setting before assuming a rule is finished with.

Checking what is live right now

SELECT * FROM ArchiveRules WHERE Disable = 0;

The full sequence

A document archived by an ArchiveRule

A workspace archived by an ArchiveRule

Previous Article 201 - Two Ways an Archive Starts
Next Article 203 - Archiving from Work 10