Validation Classes
Validation classes allow different types of business rules to be enforced. Some validation classes can be used generically while other classes are used for specific purposes. Validations can be created from a set of existing validation classes. Many business rules on nodes can be enforced with a validation class that uses a query for its logic. This enables validations to leverage queries that have been created for analysis purposes to also manage data integrity. Rules for versions and hierarchies or special cases for nodes can be accomplished using other validation classes. A few of the validation classes are used for product testing purposes only and should not be used in a production environment.
Table 10-1 Validation Classes
Validation Class | Level | Description | Parameters |
---|---|---|---|
BoolNodeInHier |
Node |
Verifies that the specified boolean property has no True values in the specified hierarchy |
Property, Hierarchy |
ContainAllProp |
Global Node |
Verifies that the specified hierarchy contains all nodes where the specified property is True |
Hierarchy, Property |
ContainAllWith |
Global Node |
Verifies that the specified hierarchy contains all nodes for which the specified property has the specified value |
Hierarchy, Property, Value |
CustPropQuery |
Node |
Verifies using predefined query and expected result Only a local property query can be used. |
Property query name, Failure value |
DateRangeCheck |
Node |
Verifies that the From Date is earlier than or equal to the To Date |
From Date Property, To Date Property |
Formula |
Node |
Verifies a node using business logic expressed in a formula. A formula result of False results in a validation failure. |
Formula |
GlobalPropQuery |
Global Node |
Verifies using predefined query and expected result |
Property query name, Failure value |
HierContainsRef |
Node |
Hierarchy contains a reference to the node when a Boolean property is True, or if the node is a leaf node and a third Boolean property is True. |
Hierarchy name, Boolean property for all nodes, Boolean property for leaf nodes |
HierFail |
Hierarchy |
Automatically fails at hierarchy level for testing purposes |
none |
InvalidNameLength |
Node |
Verifies that the node name is not equal to a specified length. |
Length |
MaxChildren |
Version |
Verifies that the number of children per node do not exceed specified limit |
Maximum number of children |
MaxHierNodes |
Hierarchy |
Verifies that the number of nodes in the hierarchy does not exceed specified limit |
Maximum number of nodes |
MaxVersionNodes |
Version |
Verifies that the number of nodes in the version does not exceed specified limit |
Maximum number of nodes |
MergeEquiv |
Merge |
Verifies that the affected node and merge node have the same value for the specified property |
Global node property |
MergePropSet |
Merge |
Verifies that if the affected node property value is set (overridden), the merge node property value is set for the specified property (Property values need not be the same) |
Property |
MixedKids |
Node |
Checks for nodes with both limb and leaf children. |
None |
NoBoolBranch |
Node |
Verifies that the specified boolean property is set to True at least once on a specified branch |
Property |
NodeFail |
Global Node |
Automatically fails nodes at the version level for testing purposes |
none |
NodeFailRandom |
Node |
Automatically fails the specified percentage of nodes for testing purposes |
Failure percentage |
NoDefaults |
Node |
Verifies that no default values are used for the specified property |
Property |
NoPropBranch |
Node |
Verifies that the specified property is set at least once on a specified branch |
Property |
PropEquivBool |
Node |
Property equivalency when a third boolean property is True. |
Boolean property to evaluate, First Property, Second Property |
PropLength |
Node |
Verifies that the specified property is at least minimum length and no more than maximum length |
Property, Minimum Length, Maximum Length |
PropRemove |
Remove |
Prevents the removal of a node if the property or properties specified (in the prop1, prop2 and prop3 parameters) are equal to the specified values (in the value1, value2, value3 parameters). |
Property1, Property2, Property3, Value1, Value2, Value3 |
RequiredField |
Node |
Verifies that, for all nodes for which the specified property has a specified value, each property in the required list has a value:
|
Property, Value, Reject Default Records, Required Properties |
Script |
Node, Hierarchy, Version, Global Nodes, Move, Remove, Merge |
Verifies data using a dynamic script. A return value of True passes the validation. A return value of False results in failure of the validation. |
Script |
SingleBoolBranch |
Node |
Verifies that the specified boolean property is set to True only once per branch |
Property |
SinglePropBranch |
Node |
Verifies that the specified property is set only once per branch |
Property |
StrandedParent |
Node |
Verifies that all limb nodes have children |
none |
StrPropEqual |
Node |
Fails for all nodes for which the specified property equals the specified value |
Property, Value |
UniqueProp |
Node |
Verifies that the specified property has no duplicate values within a hierarchy If Include Defaults is False, then nodes with the default value are not included. If Exclude Shared is True, then shared nodes are not considered when checking uniqueness of property values. |
Property, Include Defaults, Exclude Shared It is recommended that the UniqueProp validation use indexed properties. |
UniquePropBranch |
Node |
Verifies that the specified property has unique value within a branch |
Property |
VersionFail |
Version |
Automatically fails at the version level for testing purposes |
none |
VersionUnique2Prop |
Global Node |
Verifies that specified properties have no duplicate values within a version If Include Defaults is False, then nodes with the default value are not included. If Exclude Shared is True, then shared nodes are not considered when checking uniqueness of property values. |
First property, Second property, Include Defaults, Exclude Shared |
VersionUniqueProp |
Global Node |
Verifies that the specified property has no duplicate values within a version If Include Defaults is False, then nodes with the default value are not included. If Exclude Shared is True, then shared nodes are not considered when checking uniqueness of property values. |
Property, Include Defaults, Exclude Shared |