Infrastructure Rule Classes

The EvidenceValidationRuleSet provides several Rule Classes which are to be used when authoring Validation Rule Sets:

Validation

The Validation Rule Class represents a particular Validation. It contains the following Attributes:
Table 1. Validation Rule Class - Attributes
Name Type Description
isFailure Boolean Indicates if the Validation has failed for the given Case Evidence record.
failureMessage curam.creole.value.Message The message to be shown to the user if the Validation fails.
informationalType curam.dynamicevidence
.validation.
impl.InformationalType
Specifies if a Validation failure should be reported as a warning, error or a fatal error. By default, this is set to 'error'. A warning will not stop the user action from getting completed. For example, if a Validation fails during creation of a Case Evidence record, but the informational type is 'warning', the Case Evidence record will get created in the database and a warning message will be displayed to the user. However, if the informational type is 'error' or 'fatal error', any database changes as part of the user action will be rolled back. In addition, a 'fatal error' will stop the validation process immediately. The informational type of a Validation should be specified as 'fatal error', if it is considered that proceeding with subsequent Validations is not useful if this Validation fails.

ValidationMode

The ValidationMode Rule Class represents the operation as part of which the Validation is being invoked. This can be used to determine the set of Validations to be applied and the informational type to be used for a particular Validation.

This Rule Class has a single Attribute, namely "mode" of type curam.dynamicevidence.validation.impl.ValidationMode.

DefaultEvidenceValidationResult

As explained in the contract, Validation Rule Sets must have a Rule Class that extends from DefaultEvidenceValidationResult . This Rule Class has the following Attributes; all of these Rule Attributes are of type List<Validation>
Table 2. DefaultEvidenceValidationResult Attributes
Rule Attribute Purpose Value
detailsValidations These Validations are called before writing a new or modified Case Evidence record to the database. When these Validations are called as part of creating a new Case Evidence record, Parent/Child Relationship will not have been established. As such, any Validation that involves navigating to Parent Case Evidence records should not be included as part of detailsValidations . Typically these Validations contain Single Field or Cross Field validations. null
standardValidations These Validations are called after a Case Evidence record is created, modified, activated or as part of validating a Case Evidence Record. Typically this contains Validations which involve navigating to other Case Evidence records such as Parent/Child records or Case Evidence instances of the same Type on the Case. null
preCreateValidations This set of Validations is called before a Case Evidence record and any entity related to that Case Evidence record are created on the Database. The related entity could be an Address or a Case Participant Role. null
preModifyValidations This set of Validations is called before a Case Evidence record and any entity related to that Case Evidence record are modified on the Database. The related entity could be an Address or a Case Participant Role. null
postCreateValidations As the name suggests, this set of Validations is called after a Case Evidence record and any entity related to that Case Evidence record are created on the Database. The related entity could be an Address or a Case Participant Role. null
postModifyValidations As the name suggests, this set of Validations is called after a Case Evidence record and any entity related to that Case Evidence record are modified on the Database. The related entity could be an Address or a Case Participant Role. null
In addition to the Attributes described above, this Rule Class also contains a "validationMode" Attribute.
The idea behind defining these Attributes in the DefaultEvidenceValidationResult Rule Class is twofold:
  • In their Validation Rule Sets, administrators need to define only those Attributes which correspond to the sets of Validations required for the particular Dynamic Evidence Type Version.
  • In a future major release of Cúram, if a new set of Validations is added, a corresponding Attribute would be added to DefaultEvidenceValidationResult . As such, any existing hand-crafted Validation Rule Sets would not need to be changed to include this new Attribute, as long as the new set of Validations is not required.