Validator Rules & Smart Rules

Estimated time: 10 minutes

Learning objectives

By the end of this lesson, you will be able to:

  • Understand what validator rules and smart rules are
  • Spot a rule violation while reviewing an XML file
  • Read the rule error detail and choose what to do with it
  • Build a new smart rule by picking fields from the XML
  • Manage and enable/disable rules from the Validator page

While you review an XML file, the app automatically checks every value against a set of validator rules. This lesson explains what those rules are, how a broken rule looks during a review, and how you can create your own smart rules so the same mistake gets caught automatically next time.


1. What are validator rules?

A validator rule is a saved condition that every dataset is checked against at validation time. If a value doesn't satisfy the rule, that value is flagged so it can be fixed before the dataset is approved.

There are two kinds:

TypeWhat it does
Smart RulesStructured expression rules — for example "field A must equal field B". They can compare values across different files in the same AC bundle.
DOs / DON'TsSimpler do / don't guidance applied during validation.

Smart rules are the powerful ones: they let you express a relationship between two fields and have it checked everywhere, automatically.


2. Spot a rule violation in the review

When a value breaks a rule, its line is highlighted red in the XML viewer and counts toward the Rule Violations badge at the top of the file.

XML viewer showing a Rule error tooltip on a flagged line

Hover the flagged line to see a quick Rule error tooltip. It shows:

  • The XPath of the field (e.g. OdfBody/Competition/Unit/@Code).
  • What the rule expected — for example "Expression 'equal': left values […] must equal right values ['<missing>']".

Click the line for the full details and options.


3. Read the rule error detail

Clicking a violation opens the This value breaks a validation rule dialog.

Rule violation detail dialog with Ignore, Add Comment and Add Rule

It explains everything you need to decide what to do:

FieldMeaning
Flagged valueThe actual value that failed.
XPathWhere in the file the value lives.
What the rule requiresThe condition the value must satisfy.
RuleWhich rule caught it (name + type, e.g. expression).
Dataset keyThe bundle/scope the rule applies to.

You then have three choices:

  • Ignore — dismiss this flag if it's a false alarm.
  • Add Comment — leave a note so the author fixes the value.
  • Add Rule — open the Smart Rule Creator to define a new rule from here.

A rule violation marked error must be corrected before the dataset can be approved.


4. Build a smart rule by picking fields

The Smart Rule Creator lets you build a rule visually — you click values directly in the XML instead of typing XPaths.

Smart Rule Creator — picking the right-hand value from the XML

A smart rule compares two sides with an operator:

SlotHow you fill it
A — LeftThe first field. Click a value in the XML to load it.
OperatorThe comparison, e.g. = equals.
B — RightThe second field. With the slot in picking mode, click any value in the XML — even in another file — to fill it.

As you pick each side, the highlighted field shows "Click to use this field in the Smart Rule". The Preview line at the bottom builds the full condition as you go.

Smart Rule Creator with both sides filled, ready to save

Once both sides are set:

  1. Give the rule a Name (optional — auto-generated if left empty).
  2. Set the Severity (e.g. error).
  3. Check the Preview reads what you intend.
  4. Click Save Rule.

In the example above, the rule says the Unit/@Code in DT_SCHEDULE must equal the @DocumentCode in DT_RESULT — a cross-file consistency check.


5. Manage rules in the Validator page

All saved rules live under the Validator tab, on the Validator Rules screen.

Validator Rules page listing saved smart rules

The Smart Rules tab lists every expression rule. For each rule you can see:

ColumnMeaning
NameThe rule name (rules made during review are tagged Created from ODF Generator review).
TypeThe rule kind, e.g. expression.
Condition PreviewThe full condition the rule checks.
Severityerror, etc.
EnabledToggle the rule on or off without deleting it.
ActionsEdit or delete the rule.

From here you can also:

  • Use + Add Smart Rule to create a rule from scratch.
  • Search rules by name or description and filter by type.
  • Switch to the DOs / DON'Ts tab for the simpler rule set.

Every enabled rule is applied automatically the next time a dataset is validated — so a rule you add today catches the same problem in every future review.