Business rules
Business rules capture validation constraints that go beyond what a structural schema (XSD, JSON Schema) can express. Where a schema defines the structure and data types of a message, business rules encode the domain-specific logic. For example, in the world of European e-invoicing, the PEPPOL NL-R-001 rule states: "if the document is a credit note from a Dutch supplier, then it MUST contain a reference to the original invoice." This kind of conditional constraint cannot be expressed in XSD alone. It requires Schematron assertions that evaluate context at validation time.
In Semantic Treehouse, business rules are defined in natural language and can optionally be implemented as Schematron assertions for automated validation.
The Business rules overview is only accessible to Maintainers and above. Users do not see the Business rules page in the navigation menu. Adding, editing, deleting, and importing business rules is restricted to Administrators.
Business rule properties
Each business rule has the following fields:
- Rule identifier: a unique human-readable identifier for the rule. This identifier is used to reference the rule from message model elements.
- Rule text: the rule expressed in natural language, describing the constraint in a way that domain experts can understand.
- Purpose: an explanation of why this rule exists.
- Category: an optional grouping label to organize related rules, e.g. by source or specification.
- Flag: the severity level when the rule is violated. Typical values are
fatal(the message is invalid) andwarning(the message is valid but may have issues). - Locked: a toggle that prevents editing when enabled (see Locking business rules below).
Creating a business rule
Business rules are managed at the environment level, which means they are not tied to a specific specification version. This allows the same rule to be referenced by multiple message models.
Creating a business rule requires the Administrator role.
To create a business rule:
- Navigate to the Business rules overview.
- Click the '+ Add business rule' button to create a new rule.
- Fill in the rule identifier, rule text, and flag (severity).
- Optionally add a purpose, category, and Schematron implementation.
Screenshot of steps 1-2:

Screenshot of steps 3-4 taking the previous example from the e-invoice domain:

Schematron implementation
A business rule can have one or more Schematron rules that implement the natural language constraint as executable validation logic. Each Schematron rule consists of:
- Context: an XPath expression defining where in the document the rule applies.
- Assertions: one or more test/message pairs:
- Test: an XPath expression that must evaluate to true for the document to be valid.
- Violation message: the error message shown when the test fails.
A single business rule can have multiple Schematron rules, each with their own context and assertions. This allows a rule to be checked at different points in a document structure.
To add a Schematron rule, use the '+ Add schematron rule' button in the Schematron rules section. Within each Schematron rule, use the '+ Add assertion' button to add test/message pairs.