Grooper Help - Version 25.0
25.0.0017 2,127
  • Overview
  • Help Status

Apply Rules

Code Activity Grooper.Activities

Applies one or more Data Rules to a document and updates the document metadata if changes are made.

Remarks

The ApplyRules activity performs rules-based manipulation and normalization of data extracted from documents, ensuring that extracted data meets business requirements before downstream processing.


Purpose

  • Use ApplyRules to apply a set of Data Rules to each document in a batch or folder.
  • This activity is typically used after the Extract process to perform additional normalization, validation, or transformation of data.
  • It helps keep extraction logic simple by separating data location (extraction) from data normalization and business rule enforcement.

How it works

  1. For each document, the activity determines the applicable Content Type.
  2. The 'Rules' property specifies a list of Data Rules to consider.
  3. Only rules that apply to the current content type are executed.
  4. Each rule may perform actions such as parsing, copying, validating, or transforming field values using Data Actions.
  5. If any rule raises issues (e.g., missing required values, validation errors), these can be flagged for review if 'FlagIssues' is enabled.
  6. If any rule makes changes to the document data, the document metadata is updated and saved.

When to use

  • Use Apply Rules when you need to enforce business rules, normalize data, or perform post-extraction validation that is too complex or context-dependent for extractors alone.
  • Common scenarios include splitting composite fields, enforcing required values, or applying conditional logic based on extracted data.

Example

Suppose you extract a "Full Name" field but need to split it into "First Name", "Last Name", and "MI" for export:

  • Use a Data Rule with a Parse Value action to split the full name after extraction.
  • Add this rule to the 'Rules' property of ApplyRules.
  • Run ApplyRules after extraction to populate the individual fields.

Best Practices

  • Keep extraction logic focused on locating data; use rules for normalization and validation.
  • Group related rules together and use descriptive names for maintainability.
  • Use 'FlagIssues' to ensure documents with data issues are flagged for human review.

Related Concepts

  • Data Rule: Defines the logic to be applied to document data.
  • Data Action: The operation performed by each rule.
  • Review, Export: Downstream activities that benefit from normalized and validated data.

For more information, see the documentation for Data Rule, Data Action, and related data extraction and processing objects.

Properties

NameTypeDescription
General
Processing Options

See Also

Used By

Notification