Skip to main content

Validate

Category: Processing

The Validate activity runs the project's business rules against the extracted data, producing warnings and errors that a reviewer can act on.

Settings​

The Validate step's panel has two blocks, both folded when it opens. Folded, each block says what it holds, in grey where a value is what a new step starts with and in black where someone changed it. The switch in the panel's header turns the step off.

Rules (a project setting). Folded, it shows how many rules the project has and how many are off ("14 rules · 2 off"). Open, a card counts the rules that are on by what they report: Can report errors (a rule's errors stay errors, the default), Warnings only (its errors are reported as warnings) and Silent (it reports nothing, such as a rule that only replaces values). Manage rules opens Validation Rules, where you add, edit, and turn on or off the business rules. The rules belong to the project: every Validate step runs every rule that is on, and a change there reaches every step at once.

Options.

SettingWhat it doesA new step starts with
When rules find errorsContinue: the transaction goes on, and a Human Review step shows the errors to a reviewer. Fail the step: the step fails, as a failure in any step does: the transaction takes the step's Failed exit, or fails when none is connected. A rule that cannot run fails the step either way (below).Continue

Exits. Where the transaction goes after the step, and the failure exit.

When the project has no rules to run, the step does nothing and is reported as skipped.

Validation errors and failures​

A validation error is what a rule found: a value that does not match, a total that does not add up. The step ran successfully, and the error goes to the Human Review step for a person to act on. When rules find errors applies only to these.

With Fail the step, the step first saves what the rules found and the values they changed or confirmed, then fails at once, without trying again, since the same rules would find the same errors; the transaction's cause reads Rules found errors. So the transaction's validation results and its documents are those of this run, and a person opening the failed transaction sees which rules found errors, unlike a step that failed for the reasons below. A document re-run (Re-extract, Re-classify) never fails on these errors: there they are review issues, as with Continue, so the re-run completes and a person sees what is left.

A rule that cannot run is different: it throws an error, runs past its time limit, makes a call that is not allowed, or is a table lookup whose lookup table no longer exists. The step then fails, as a failure in any other step does. The transaction takes the step's Failed exit if one is connected (Handling failures), and otherwise fails. The Activity Log names the rule, the document and the error. A rule that ran out of time, or whose web request timed out or could not connect, is tried again before the step fails. The others fail at once, because running the same rule again gives the same result.

The same applies when the step cannot run its rules at all, for example when the rule service stops responding: the step is retried, then fails.

A step that fails for one of these reasons saves nothing: the documents and the validation results stay as they were before the step, including what the rules that did run would have changed. A Human Review step reached through the Failed exit always pauses for a reviewer, whatever its policy, and the step's error is in the Activity Log.

Notes​

  • Validation results feed the Human Review step's accept policy, which can block acceptance when errors are present.
  • Later steps read the results the same way. In an If or Switch condition and in a Data Transform script they are the validation_results variable: overall_status, document_results and stats. The step's own output in workflow_context (validate_output) is a summary with overall_status and stats; it points at the results file instead of repeating it.