A rule validation reference for handling complex data transactions.
A transaction validation rule defines what rule definition will be used to validate the transaction’s data and how failed validation is handled on the Agentry Client. The rule referenced is called in a Boolean context and is expected to return true or false. False indicates failed validation, which may be treated as a warning or error. Messaging may be displayed to the user in relation to failed validation. An error requires the user to change the offending value(s) before proceeding. A warning displays an informational message giving the user the option to change the value(s), but does not require a change.
Not every transaction will have validation rules. Certain types of values do not need to be validated using a validation rule. Simple requirements such as the size of a string value or the minimum and maximum values of a numeric property can be enforced by the property itself. In other cases the information may not need to be validated. An example of this is some sort of note or description entry where the user is entering free form text.
Validation rules are used when more complex validation is required, such as when the valid value for a property is dependent on the value of a second property. Also, validation rules offer the flexibility to differentiate between a warning and an error. With a warning, the user is given the option of changing the value that violates the rule or leaving it as is. If treated as an error, the user must change the value before being allowed to proceed.
Validation rules are evaluated when the user clicks any navigation buttons in the wizard screen set displaying the transaction. If a validation rule references a property not yet displayed in the wizard, it will not fail validation. A false return by the rule is treated as a validation failure and the validation rule definition will then dictate the behavior of the Agentry Client.