Roadmap
Part 1: What is BREX?
Introduction
This series of articles is intended for those working with S1000D data and are responsible in ensuring the data conforms to the business rules defined for your project. At a minimum, it is beneficial if you have a basic familiarity with S1000D and XML structures and terminology.
Disclaimer
I am the lead developer of IrisCheck, an S1000D data validation tool. The goal is to provide information that is beneficial to you regardless of what S1000D processing tools you choose to use. However, IrisCheck will be mentioned in this series to help illustrate concepts and/or provide examples of how BREX-based validation tools may operate.
What are Business Rules?
Business rules are the decisions you make and adopt on how S1000D is applied to your project.
The specification itself identifies business rule decision points (BRDPs) to help you identify items to consider when establishing your business rules. For example:
Business rule decision point BRDP-S1-00007 - Use of optional elements and attributes:
Decide whether and how to use each optional element and attribute in its structural context.
This is just one of many, where you will likely define additional business rules not called out explicitly in the specification. Chapter 2.5.3, Para 2 of the S1000D specification enumerates all the BRDPs defined. Once you get over the initial shock of how many there are, you will realize that initial decisions you make will eliminate the need to address other BRDPs: You only need to focus on those that are relevant to your project.
What is BREX?
Chapter 4.10.2 of the S1000D specification defines the business rules exchange (BREX) data module as follows:
The data module provides a means to represent adopted business rules in a formal way that enables unambiguous automatic processing of the rules. Such processing includes, without being restricted to, verification that the XML objects in the CSDB fulfill the requirements expressed in the business rules.
A BREX data module can contain the following types of business rules:
Context Rules:
Rules defined in a formal matter to facilitate automated verification.
Schema/XML-based.
Uses XPath (which we will cover later).
Non-context Rules:
Rules independent of XML structure and/our outside the scope of a single data module.
SNS Rules:
Contains descriptions of one or several SNS systems that apply to your project.
This series of articles solely focuses on the Context Rules portion of BREX: From covering the basics of writing context rules, working with real-world examples, to more advanced topics for experienced developers.
What is a BREX Checker?
The tool used to perform automated verification of CSDB XML objects against the context rules specified in a BREX data module is commonly referred to as a BREX checker. The BREX checker can be a standalone software program (like IrisCheck) or an embedded component of your S1000D-aware content management system or editor.
Aren’t the Schemas Enough?
Not for most projects. The S1000D XML schemas define the basic structures all data modules must conform to. Although XML schemas are quite powerful in defining what is, and is not, allowed in XML documents, within the scope of S1000D, they have the following limitations:
S1000D defines rules where the rules for a specific XML structure is conditional on data specified in another part of the document. For example, take the following rule:
Data modules up to and including the initial issue of the approved release must have the attribute
issueNumberset to the value000forinworkversions or value 001 for the initial issue and have the attributeissueTypeset to the value /new/. (Chap 3.9.5.1, Para 2.2)The XML schema language does not provide a way to express and enforce this rule. This is just one of many rules that cannot be codified in the schemas. When you download the S1000D specification and schema package from s1000d.org, the default BREX is included that encapsulates such rules.
S1000D is designed to be tailorable, where you can choose to impose additional restrictions on your data that the schema normally allows. S1000D schemas are normally “set in stone” by contract, where modifying the schemas is prohibited. The BREX provides a mechanism to define additional restrictions on a per-contract/per-project basis.
BREX Limitations
Although much can be achieved with BREX context rules, it is important to be aware of its limitations so you will know which project rules can and cannot be codified in a BREX data module to support automated validation.
The scope of BREX context rules is limited to a single data module.
Rules that require access to multiple data modules, and any other information external to a module’s XML document structure, cannot be represented by BREX context rules (but can be documented as non-context rules).
Examples of the types of checks a BREX cannot support:
Applicability product and condition references.
CIR references.
CSN references.
Data module references.
Media references.
etc…
Now what?
In Part 2, we will the cover the basic XML markup for writing context rules, and provide an introduction to XPath, the expression language used in writing context rules.
