Example 1: Batch-level rule execution
When a rule assembles individual pages into different document types, the rule must run at the batch level.
In the default Profiler task profile, the CreateDocs ruleset includes a rule that is called Create Docs. This rule assembles individual pages into documents that are based on the structure in the document hierarchy. For example, the TravelDocs car rental document type has a rental agreement page and an insurance coverage page.
- The rental agreement page is required (Min=1), and that it is always the first page (Order=1).
- There can be only one rental agreement page within each car rental document (Max=1).
- The insurance page is optional (Min=0).
The Create Docs rule must run at the batch level because it assembles multiple document types.
When the Create Docs rule encounters a page of type Rental_Agreement, it creates a new document in the runtime batch hierarchy. If a rental agreement page is followed immediately in the batch by an Optional_Insurance page, Datacap adds the insurance page to the same car rental document. Otherwise, Datacap creates a new document.