This section defines the business validation rules architecture that was established by the Validation Working Group. It contains introductory and background information about the purpose of validation, a guide to how to make use of the documents published by the Validation Working Group, and serves as a reference point for implementers.
The main documents produced by the Validation Working Group is the set of validation rules, expressed in English:
The validation rules follow the principles and guidelines defined in the Validation Rule Specifications section.
Previous versions of the validation rules, expressed in English:
The Validation Working Group's charter includes a mandate to formalize the validation rules from their plain English representation to a suitable implementation language. The purpose of this decision was to disambiguate the English language representation, to serve as a point of reference for implementers looking for clarification, and to validate the test cases produced by the working group. Reference implementations play an important part in providing quality guarantees to the working group and it is hope that their publication will be useful to implementers.
The reference implementations are non-normative and should not be considered publications of the Validation Working Group. Instead, they are contributions provided by members of the working group or other implementers.
Although the working group does not have the means to provide official certification, it expects implementers to demonstrate that they produce the correct results - valid or invalid - for the normative test cases of each implemented rule. There is no requirement to implement all rules, but reference implementations will state clearly which rules are implemented by publishing a list of rule identifiers.
Provider |
![]() |
Implementation Language | Java and C# |
Implemented Rules | All published FpML rules (plus adjustments for FpML 1.0, 2.0 and 3.0); Additional rules for datatypes (in DTD documents FpML 1.0, 2.0 and 3.0); Additonal rules for schemes (all FpML releases) |
Browse | N/A |
Further Information | http://www.handcoded.com |
Provider |
![]() |
Implementation Language | Xpath/Java |
Implemented Rules | All versions, All rules |
Browse | FpML Reference Implementation |
Further Information | http://www.iona.com/products/artix/standards_libraries.htm |
Provider |
![]() |
Implementation Language | CLiX / Java |
Implemented Rules | http://www.fpml.org/2003/FpML-4-0/validation/2004-04-02: All rules |
Browse | FpML Reference Implementation |
Further Information | http://www.messageautomation.com |
Provider |
![]() |
Implementation Language | XQuery |
Implemented Rules | All rules, version 4.5+ |
Browse | N/A |
Further Information | FpML Reference Implementation |
The Validation Working Group also publishes a set of test cases with each rule set release (available above). For each rule, a number of valid examples and a number of invalid counter-examples are given. The test cases for a release will have been validated both manually and against at least one reference implementation to check that they are correct. The test cases have the following properties:
This document should be useful to:
FpML has been designed as a very rich language, with a large amount of optionality in its element and attribute definitions. This richness, which arises from the complexity of the information that FpML is designed to carry, has made it easier for implementers to fit FpML into existing architectures, and has facilitated the reuse of common element types across different asset classes.
Partly due to this flexibility, and partly due to the rich structure of FpML, it is unrealistic to assume that a schema-validated FpML document is necessarily correct in a business sense. The Validation Working Group was established early in 2003 to consider the implications of this problem and breaks down the correctness of an FpML document into three parts:
It is useful to consider some simple example to illustrate the different levels of validity. The following is a fragment of a well-formed FpML document, but violates the schema due to an invalid start date:
<calculationPeriodDates> <effectiveDate> <unadjustedDate>xxxx-xx-xx</unadjustedDate> .. </effectiveDate> <terminationDate> <unadjustedDate>2004-02-29</unadjustedDate> .. </terminationDate> .. </calculationPeriodDates>
The following version of the fragment is syntactically valid, because the contents of the effective date now match the schema definition of a valid date.
<calculationPeriodDates> <effectiveDate> <unadjustedDate>2004-08-29</unadjustedDate> .. </effectiveDate> <terminationDate> <unadjustedDate>2004-02-29</unadjustedDate> .. </terminationDate> .. </calculationPeriodDates>
The fragment of FpML inserted above is however not semantically valid, because the effective date of the trade precedes the termination date. As a consequence, the trade is not meaningful and in fact violates one of the validation rules for IRD interest rate streams. Many other types of constraints will not be validated by the schema, which is designed to designate structure, not semantics:
The validation working group has considered these problems and their implications, and has attempted to address a number of questions. How do we extract the knowledge about what constitutes a correct trade from business experts? What, if any, guarantees will we give that our work is complete? What is the normative status of the validation rules? How can parties override or tailor the rule set? What infrastructure support is necessary in the FpML architecture to enable rule-based checking? What support is necessary in the new messaging framework? The answers to these questions are addressed in the remainder of this section.
This section defines the guiding principles and requirements for how rules should be defined and written. The Validation Working Group’s desire is to define a set of guidelines, which when followed produce a set of rules which conforms to an agreed standard of layout and content, with the intention that the rules are coherent, complete and well-defined; and therefore usable by practitioners.
Validation rules should be written in a stylized plain English which is both precise and complete, but not necessarily formal:
* XML infoset does not contain schema information; PVSI contains gaps and impossible scenarios when used for rules, and therefore is unsuitable; this is why the W3C created the XDM infoset. NB model groups do not appear in XDM and therefore cannot be defined in the rule (they are also context free)
+ other cases would result in ambiguity, e.g. an optional Boolean value or more than one Boolean value (multiplicity)
There is a list of approved mathematical symbols which must be used, in the formal description, instead of their natural language equivalents. This list contains the commonly understood mathematical symbols. Only the symbols on the approved list may be used in the formal description. Their advantage is their terseness and readability compared to natural language.
To avoid confusion with XPath definitions, each symbol must be separated for other words with a space. Otherwise for example the division symbol and the XPath symbol would be confusable.
The approved mathematical symbols are:
eq | equality (XPath value comparison operator) |
ne | inequality (XPath value comparison operator) |
lt and gt | is less/greater than (XPath value comparison operator) |
le and ge | is less/greater than or equal (XPath value comparison operator) |
+ | addition (plus) |
- | substraction (minus) |
* | multiplication |
/ | division |
() | precedence grouping |
XPath value comparison operators (eq, ne, lt, le, gt, ge) are defined in the XPath specification.
To ensure consistency and improve readability rules should be defined using the following syntax (the notation is expressed using EBNF):
Rule | ::= | RuleIdExpr Contexts RuleDef Tests |
RuleIdExpr | ::= | RuleId “(” “Mandatory” | “Warning” “)” |
RuleId | ::= | ProductType “-” Digits |
ProductType | ::= | One of the product type or shared |
Digits | ::= | [0-9]+ |
Contexts | ::= | Context (“,” Context)* |
Context | ::= | “Context:” TypeName (ContextConds) |
ContextConds | ::= | ContextCond (ContextCond)* |
ContextCond | ::= | “[”ConditionExpr | ValCondition “]” |
ConditionExpr | ::= | Precise definition of the rule expressed in English using defined terms |
ValCondition | ::= | Reference to a global validation condition (ref) expressed in English |
TypeName | ::= | XML Schema Type Name (complex type) |
RuleDefEnglish | ::= | English definition of the rule expressed in natural language. This description may include business reasons or examples. |
RuleDefFormal | ::= | Formal definition of the rule expressed in XPath and defined terms |
Tests | ::= | “Test Cases:” Valid (Valid)* Invalid (Invalid)* |
Valid | ::= | “[“ DocLink “]” |
Invalid | ::= | “[“ DocLink “]” |
DocLink | ::= | Link to a test case document |
Rule layout:
An example rule:
The above definition describes rule 3-b for credit derivatives. The context is type ContractualTermsSupplement, which is a complex type. The precondition ISDA1999 must evaluate to true. The rule body specifies that the node-element type must not begin with string “ISDA2003Credit” (finally, links to applicable valid and invalid test case documents.)
In the previous sections, the notion of expressing rules using stylized English was introduced; and the concomitant concept that a term should have the same meaning as the equivalent XPath expression. This section introduces functions as a mechanism to define repeatable tests that are applied independent of a context. Functions take node-element types as parameters and return a typed result.
Consider a test requiring that all currencies must be the same and that this applies for several different contexts. With reference to the schema it’s possible to identify that currency is applicable to all Money types and therefore define a function which accepts as a parameter a set of Money nodes:
Function Name | same-currency |
Description | the set of money elements must all contain the same currency |
Parameter 1 | $money (fpml:Money) (min=2, max=*) |
Result Type | xs:boolean |
Test | Every $money/currency must be the same and every $money/currency/@currencyScheme must be the same |
This creates a new term same-currency which can be used as part of the definition of any validation rule.
NB The function does not inherit the context of where it is called from.
Each parameter name is prefixed with "$" to distinguish it from an XPath. Otherwise "money" might be either the parameter "$money" or the XPath "./money".
Each parameter has a minimum and maximum cardinality. This is given in the style of XML Schema. The cardinality must always be present. If the cardinality is not indicated, by default, the parameter must be provided once.
Each function must have a single result type.
There can be any number of parameters to a function.
Once a new term (e.g., same-currency) is defined, it can be used as part of the definition of any validation rule (including conditions).
A reference to a new term must also include required parameters (within parenthesis and comma-delimited) as specified in the function definition. For example,
Components of the validation rules may be differenciated by formatting as shown in the following table.
Component | Formatting | Example |
values | Courier New, 12pt, bold, black font | 100, ISDA2003Credit |
xpath expressions and elements | Courier New, small 9pt, blue font | creditDefaultSwap/generalTerms/effectiveDate |
functions | Times, 10pt, black font | exists(argument) |
Formatting is defined in stylesheet rules.css.
For the purposes of precision, extensibility, and robustness to change the structure of the Validation Rules is profiled. The rules of the profile are:
The evaluation of dates in the validation rules is not trivial. The optionality of including time offsets in date datatypes makes comparisons between dates more difficult since sometimes the result is indeterminate as any ISO8601 date is +/- 18 hours of timezone, and +/- 24 hours of day.
The Validation Working Group recommends the use of the XPath 2.0 date/time comparison rules which defines a definitive true / false value even for indeterminate calculations.
The Validation Working Group recommends that time offsets appear on all date/time values used in FpML documents.
Many validation rules defined in FpML use the term 'contains'. FpML uses the definition of XPath 2's 'contains' (fn:contains) http://www.w3.org/TR/xpath-functions/#func-contains. This is significant for alphabets with accents, diaresis, etc.
Since the Validation Working Group was established after most product working groups, it still has a lot of work to complete before the rules span the whole product range, and indeed are reasonably complete for any particular product type. The latest set of validation rules is thus likely to change more frequently than the specification, and the process of rule publication has been decoupled from the specification.
The validation working group undergoes the following process in preparing its releases:
At the end of this process, a new URI is allocated for the revised rule set, and the rule set is announced and published as the new normative rule set on the FpML web site. We expect to publish the process to take on average three months for the foreseeable future.
The rule sets and test cases are the normative content published by the Validation Working Group. The reference implementations, see below, are informative and not part of the normative process. This normative characteristic has the implication that applications that construct FpML documents have to be designed so that their output meets the full set of validation constraints.
Applications that receive FpML for processing may want to check the validation rules to ensure that the data they are receiving represent a valid FpML document. Processing applications are not obliged to reject invalid messages. Instead, the implications of rule normativity are that the receiver gains the right to reject invalid messages. In other words, the sender has to either be prepared for rejection, or the rule set has to be tailored.
The validation working group is concerned that there may be legal implications due to this definition in situations where trades are executed between counter-parties. While we believe that the definition given above, providing a right for the receiver to reject trades and placing the burden on the sender, is the least controversial, we would like to obtain additional feedback on this issue before the publication of the final recommendation.
Previous | Top | Next |
---|