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.

From the object general information, you can observe theses details about the pages.
Tip: To see the object general information with the rules for each page type within a document, lock the Document Hierarchy, right-click the page type, and select Manage variables.
  1. The rental agreement page is required (Min=1), and that it is always the first page (Order=1).
  2. There can be only one rental agreement page within each car rental document (Max=1).
  3. 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.