Creating Rule Sets & Rules
Learn how to create and manage rule sets and rules, use built-in ISO 19650 validation lists, and apply rule sets to folders for automated compliance checks.
Rule Sets
A rule set is a named collection of rules that you apply to folders when running a check. Rule sets are tenant-scoped -- every user in your organisation can use them.
Built-in Rule Sets
Foreman ships with seven built-in rule sets (29 rules total) covering all 12 rule types, plus five built-in validation lists with ISO 19650 codes:
| Rule Set | Rules | Rule Types | Description |
|---|---|---|---|
| ISO 19650 Naming (Full) | 3 | NamingConvention | Full BS EN ISO 19650 naming with status (S0–S8) and revision (P/C) codes. |
| ISO 19650 Naming (Core) | 2 | NamingConvention | 7 core fields without status/revision — for teams using Forma versioning. |
| Basic Naming Hygiene | 6 | NamingConvention | No spaces, no special chars, valid extensions, no double separators, max length. |
| Document Register Compliance | 5 | ListValidation, NumericRange, RegisterCrossReference | Validates discipline/originator/form codes against ISO 19650 lists. Includes a disabled MIDP completeness demo — enable and replace the list with your real register. |
| Cross-Field Validation | 2 | SegmentConsistency | Conditional discipline-to-originator and form-to-discipline pairing rules. |
| Metadata Quality | 5 | RequiredMetadata, AllowedValues, Freshness | Required Document Status and Revision fields, valid status values, 30-day and 180-day staleness. |
| PDF Title Block Validation | 6 | ContentMatch, ContentRegex, ContentExtraction | Drawing number and revision cross-validation against metadata, date and number format checks, required zones, and full extraction for audit. |
Built-in Validation Lists
| List | Values | Description |
|---|---|---|
| ISO 19650 Discipline Codes | 24 | A through Z — standard discipline codes per BS EN ISO 19650. |
| ISO 19650 Suitability Codes | 23 | S0–S8, A1–A6, B1–B6, CR, AB. |
| ISO 19650 Form Codes | 26 | AF, CM, CP, CR, DB, DD, DR, FN, HS, etc. — document form/type codes. |
| Sample Originator Codes | 10 | ACE, BKR, CRN, DLT, etc. — fictional sample codes for demonstration. |
| Example MIDP Register (Demo) | 20 | ISO 19650-format document numbers (PROJ-ACE-ZZ-00-DR-S-0001, etc.) for testing. |
Built-in rule sets and validation lists appear with a Built-in badge and are read-only — you cannot edit or delete them. To customise:
- Rule sets: click Clone to customise on the rule set header. This creates an editable copy with all rules pre-populated.
- Validation lists: click the eye icon to view values, then click Clone to customise to create an editable copy. Replace the sample values with your project's approved codes.
Use the Show/Hide built-in toggle on both sections to declutter the list once you've cloned what you need.
All built-in naming patterns treat file extensions as optional, since Forma display names often omit them.
Creating a Rule Set
- Go to the Rules tab on the QA/QC page.
- Click Create Rule Set.
- Enter a name and optional description.
- Click Create.
The rule set is created empty. Add rules to it using the Add Rule button.
Deleting a Rule Set or Rule
To delete a rule set, click the trash icon on the rule set header row. A confirmation dialog warns that all rules within the set will also be deleted. Deleting individual rules from within a rule set also shows a confirmation dialog before proceeding.
Built-in rule sets cannot be deleted.
Enabling and Disabling
- Toggle a rule set on or off using the enable switch. Disabled rule sets do not appear in the Run Check tab.
- Individual rules within a rule set can also be toggled on or off. Disabled rules are skipped during checks.
- When starting a check, you can select multiple rule sets at once. Rules from all selected sets are combined and evaluated together against each file.
- Checking a rule set enables all its rules; unchecking a rule set disables all its rules for that run.
- Within any selected rule set, you can still expand it and toggle individual rules on or off. If you uncheck every rule in a set, the set itself is automatically unchecked.
Copying Rules Between Sets
When adding a rule to a rule set, you can import existing rules from other rule sets:
- Click Add Rule on the rule set.
- At the top of the dialog, click Copy from another rule set.
- Search and select rules from the list. Each rule appears as a chip you can toggle.
- Click Add Selected to copy them into the current rule set.
The 12 Rule Types
Foreman provides twelve rule types organised into three categories:
| Category | Rule Types | What they check |
|---|---|---|
| File & Metadata | Naming Convention, Required Metadata, Allowed Values, File Format, Freshness | The file itself and its Forma metadata fields |
| Lists & Ranges | List Validation, Numeric Range, Register Cross-Reference, Segment Consistency | Values from filenames, metadata, or PDF zones — checked against reusable lists or numeric/conditional logic |
| PDF Content | Content Match, Content Convention, Content Extraction | Text extracted from PDF zones (title blocks, revision tables, etc.) |
1. Naming Convention
Validates file names against a regex pattern. The dialog has an explicit mode toggle at the top — pick AI Builder to generate a pattern from examples, or Manual Regex to write the pattern by hand.
AI Builder mode (default)
- Paste multiple example filenames (one per line) into the textarea, or type a plain-English description of the pattern.
- Click Generate. Foreman's AI finds the common structure across the examples and produces a regex that matches the naming structure, not just the literal text.
- The result is shown as:
- An explanation of what each part of the pattern represents
- A pattern breakdown as editable chips — click any "exact" chip to override the value (e.g. lock a specific prefix), or click
×to remove a part entirely - Other matching examples the AI confirms the regex accepts
- A Test a filename field below lets you sanity-check the pattern before saving.
The more examples you provide, the better the result. Two or three is the minimum; five-plus is ideal.
Manual Regex mode
- Type or paste the regex directly into the Regex pattern field.
- Optionally provide an example filename for the test bench.
- Tick Case sensitive if uppercase / lowercase matters (default: off).
- Use the Test a filename field at the bottom for live match feedback.
Tip — switch to Manual Regex when you already have an established pattern from your project's naming standard, or when the AI's generated pattern is too restrictive / permissive and you want to tweak it directly.
Generated patterns always start with ^ and end with $ for full-string matching. The AI generates a general pattern that matches the structure, not just the example text. File extensions are kept optional via (\.[A-Za-z0-9]+)?$ so display-name files (no extension) still match.
2. Required Metadata
Ensures that specific metadata fields are not empty.
- Select a project first to load available attributes. A loading spinner is shown while attributes are fetched from Forma.
- Select from standard file properties (File Name, File Type, Size, Created Date, Modified Date, Created By, Modified By, Folder Path, Version).
- Select from project custom attributes (loaded live from your Forma project).
3. Allowed Values
Restricts a metadata field to a predefined list of acceptable values.
- Choose the attribute (standard or custom).
- Enter the allowed values as a comma-separated list.
- Files with values not in the list are flagged.
4. File Format
Checks that files use the correct extensions.
- Enter a comma-separated list of allowed extensions (e.g.
.pdf, .dwg, .rvt). - Files with extensions not in the list are flagged.
5. Freshness
Detects stale files that haven't been updated within a specified period.
- Set the maximum age in days.
- Files whose last modified date is older than the threshold are flagged.
6. Content Match (Cross-Validation)
Compares text extracted from PDF zones against file metadata. This is the most powerful rule type -- it catches mismatches between what the document says and what the CDE records.
- Zone template -- select a PDF zone template to extract text from. When you select a template, all of its zones are auto-checked (enabled) by default.
- You must map at least one zone to a metadata field before saving. Unmapped zones display a warning count so you know how many still need attention.
- Select a project first to load available attributes. An info box is shown if no project is selected yet.
- Cross-validation mappings -- map each zone field to a metadata attribute:
- Zone field: the zone label (e.g. "Drawing Number").
- Metadata field: the Forma attribute to compare against (e.g. "Document Number" custom attribute).
- Compare mode:
contains(zone text contains the metadata value),exact(must match exactly),date(multi-format date comparison), orname(strips file extensions before comparing).
7. Content Convention (ContentRegex)
Validates PDF zone content against regex patterns. Unlike Content Match (which cross-validates zones against metadata), Content Convention checks that the text within each zone conforms to an expected format.
- Zone template -- select a PDF zone template. All zones from the template are listed.
- Pattern per zone -- define a regex pattern for each zone. Only zones with a pattern assigned are validated; zones left blank are ignored.
- Mode toggle (AI Builder ↔ Manual Regex) -- each zone row has the same two-mode toggle as the Naming Convention rule. Foreman defaults to AI Builder for Content Convention, since pasting a couple of sample title-block values is usually faster than writing the pattern by hand. Switch to Manual Regex when you already know the pattern or the AI's suggestion needs precise tweaking.
- AI-assisted pattern generation -- paste multiple example values into the helper and Foreman's AI finds the common structure across them and generates a regex. The pattern breakdown is shown as editable chips — useful when you have sample title block values (e.g. several drawing numbers) and want a pattern that matches all of them.
- Test value -- enter a test value for each zone to verify the pattern matches before saving the rule.
- Whitespace normalisation -- zone text is whitespace-normalised before matching, because PDF text extraction can produce irregular spacing (e.g. extra spaces between characters). Your pattern does not need to account for these artefacts.
- Required zones -- instead of specifying a regex pattern, you can mark a zone as Required. A required zone simply checks that the zone contains non-empty content -- it does not validate the format. This is useful for verifying that title block fields like revision, date, or author are filled in without caring about the exact value. Toggle between Required and Pattern modes using the Req button on each zone row.
8. Content Extraction
Extracts text from PDF zones and records it as structured data. See Content Match for the related cross-validation rule type.
9. List Validation
Validates that a value extracted from the file exists in a reusable validation list. This is the most flexible rule type — the value can come from the filename, a filename segment, an ACC metadata field, or a PDF zone.
When to use it:
- Discipline code (e.g. segment 1 of
STR-DWG-001-S2) must be one of an approved list (AR, ST, ME, EL, CV...) - Originator code must be from an approved list of companies on the project
- Suitability/status code (e.g.
S0, S1, S2, S3, S4, A1, A2) extracted from a PDF zone must be valid - A custom Forma metadata field like "Document Status" must be from an approved list
Configuration:
| Field | Description |
|---|---|
| Value source | One of: Full Filename, Filename Segment, ACC Metadata Field, PDF Zone Value |
| Validation list | Pick from your tenant's reusable validation lists. Click the cog icon to manage lists |
| Case sensitive | Whether matching is case-sensitive (default: off) |
| Partial match | If on, the value matches if it contains a list entry or vice-versa (useful for partial code matches) |
Filename Segment options: When the source is a filename segment, you also configure the delimiter (default -), tick a Strip extension checkbox, and click each segment in the live preview to include or exclude it. Each included segment is checked independently against the list — so you can validate multiple codes from one filename in one rule.
Example use cases:
- Discipline code from segment 1 must be valid: source = filename segment 1 (delimiter
-, include only segment 1), list =[AR, ST, ME, EL, CV, PL] - Suitability code from title block must be approved: source = PDF zone "Status", list =
[S0, S1, S2, S3, S4, A1, A2] - Both discipline AND originator must be approved: source = filename segments 1 and 2 (both included), list contains all approved codes from both groups
10. Numeric Range
Validates that a numeric value falls within a min/max range, optionally with a fixed digit count for zero-padding enforcement.
When to use it:
- Sheet number must be between 1 and 999
- Revision number is between 0 and 99
- Floor level is between 1 and 50
- Sheet number must be exactly 3 digits with zero-padding (
001,012,123)
Configuration:
| Field | Description |
|---|---|
| Value source | Same options as List Validation — full filename, segment, metadata field, or PDF zone |
| Min | Optional minimum (inclusive). Leave blank for no lower bound |
| Max | Optional maximum (inclusive). Leave blank for no upper bound |
| Expected digits | Optional. If set, the value must have exactly this many characters and they must all be digits. Use this to enforce zero-padding |
The engine parses the extracted value as a decimal. Non-numeric values like "S2" or "ABC" produce a "not a valid number" violation. Multi-segment selection works the same way as List Validation — each included segment is parsed and validated independently.
Example use cases:
- Sheet number 001-999 with zero-padding: source = filename segment (the one containing the sheet number), min = 1, max = 999, expected digits = 3
- Revision must be 0-99: source = ACC metadata field "Revision", min = 0, max = 99
- Floor level from filename: source = filename segment, min = 1, max = 50
11. Register Cross-Reference
Bidirectional completeness check against a deliverables register (MIDP/TIDP). Unlike List Validation which is per-file, this is a run-level rule: it evaluates all checked files together at the end of the run and reports two kinds of issues.
What it checks:
- Missing files — entries in the register that have no corresponding file in the checked folders
- Unexpected files — files in the checked folders whose value isn't in the register
When to use it:
- "Every deliverable in the MIDP must have a file at this stage"
- "Flag any files in the folder that aren't on the deliverables register"
- "TIDP completeness check at design milestones"
- "Confirm all 247 expected drawings are present before issuing"
Configuration:
| Field | Description |
|---|---|
| Value source | Same options as List Validation. Use Full Filename for typical document number checks, or filename segment for code-based registers |
| Validation list | The register list. Paste your deliverables column from Excel into the list editor — one document number per line |
| Case sensitive | Whether matching is case-sensitive (default: off) |
Results appear in the check history as synthetic entries with a purple [Register Check] badge — they don't belong to any single file. You'll see one entry per Register Cross-Reference rule, with all missing/unexpected violations grouped together.
Example use case — full MIDP check:
- Open your MIDP in Excel, copy the document number column
- Create a new validation list called "MIDP Stage 4 Deliverables", paste the values into the textarea, save
- Create a Register Cross-Reference rule: source = full filename (strip extension), list = MIDP list
- Run a check against the project's deliverables folder
- The check history shows a
[Register Check] MIDP Stage 4entry listing every missing file and every unexpected file
12. Segment Consistency
Conditional cross-field validation. If Source A equals a specific value, then Source B must be in an allowed set. Use this when the rules depend on what type of document a file is.
When to use it:
- "If discipline = ST (structural), originator must be ACE or BKR"
- "If document type = DWG, status code must be S2, S3, or S4"
- "If folder = 'Approved', revision must be A1 through A4"
Configuration:
| Field | Description |
|---|---|
| Source A (condition field) | The field whose value triggers a condition. Same value source options as the other rule types |
| Source B (validated field) | The field whose value is checked when a condition matches |
| Condition mappings | A list of When [A] = X → then [B] must be one of: [...] rules. Add as many as you need |
If no condition matches the current Source A value, the rule passes silently — it only fires when there's a relevant condition. This means you can add Segment Consistency rules incrementally without breaking existing files.
Example use case — discipline-originator pairing:
- Source A = filename segment 1 (the discipline code)
- Source B = filename segment 2 (the originator code)
- Conditions:
- When
ST→ allowed:ACE, BKR, CRN - When
AR→ allowed:BKR, DLT, ELM - When
ME→ allowed:CRN, ACE, FRG
- When
A file named ST-DLT-001-S2.pdf would fail because DLT isn't an approved structural originator.
Validation Lists
Validation lists are reusable sets of approved values that you create once and reference from multiple rules. They are tenant-scoped — every user in your organisation can use them, and you can update a list once to update every rule that references it.
Creating a Validation List
- Go to the Rules tab on the QA/QC page.
- Scroll to the Validation Lists section below the rule sets.
- Click Create List.
- Enter a name (e.g. "MIDP Stage 4 Deliverables", "Approved Discipline Codes").
- Optionally enter a description.
- Paste or type your values into the textarea — one per line, or comma-separated. Foreman automatically trims whitespace and removes duplicates.
- Click Create List.
The list appears in the dropdown of any List Validation or Register Cross-Reference rule across your tenant.
Managing Lists
- Edit any list to update its name, description, or values. Changes apply immediately to every rule that references the list.
- Delete a list to remove it. If any rules currently reference the list, you'll see a 409 conflict response showing which rules depend on it — update those rules first, then delete.
Quota
Validation lists may be subject to a quota depending on your plan. System admins can override the limit per tenant.
Example: Building a MIDP Register
- Open your project's MIDP spreadsheet in Excel
- Select the column that contains document numbers (e.g. column B)
- Copy
- In Foreman: Rules tab → Validation Lists → Create List
- Name:
MIDP — Project XYZ Stage 4 - Paste into the values textarea
- Save — Foreman shows
247 unique values(or however many) - Create a Register Cross-Reference rule that references this list
- Run a check — get a complete pass/fail picture of deliverables completeness
Rule Configuration
Every rule has:
| Field | Description |
|---|---|
| Name | Display name (e.g. "Naming: Arch Drawings") |
| Description | Optional explanation |
| Severity | Error (fails the file), Warning (flags but doesn't fail), Info (informational) |
| Active | Toggle to enable or disable the rule |
| Sort Order | Controls display order within the rule set |
| File type filter | Optional comma-separated list of extensions (e.g. .pdf, .dwg) to restrict the rule to specific file types. Leave blank to apply to all files. |
| Config | Type-specific configuration (pattern, field list, mappings, etc.) |
Folder path filtering is handled at the check level using per-folder rule set mapping, not on individual rules.
The Add Rule button is disabled until all required fields are completed. Check that pattern, attribute, or mapping fields are filled in.
Next Steps
- PDF Zone Templates -- set up zone extraction for Content Match rules
- Running QA Checks -- apply your rule sets to project folders