The Validation Process Manager (VPM) manages the process of validating one or more components for a given execution point. When the VPM receives an execution point, it launches a validation process to execute the rules associated with that component using the Validator defined by the execution point.
A Validator needs two pieces of information to run, the ruleset where the rules are defined for that component and a validation context that contains the current state of the validation process for that component. For instance, the AccessibilityValidationContext class is used for validating components for accessibility and contains the following information:
Upon receipt of the execution point, the VPM needs to determine what rulebase is
associated with the target defined within the execution point.
The relationship between the rulebase and the target is defined in the rulebases.xml
file by default.
Within the actf:rulebase
element, actf:target
has an actf:regexp
attribute that represents a regular expression
to match against a package name of components of a target model.
For instance, if the actf:regexp
expression is org\.eclipse\.swt\..+
,
then that rulebase will be used for SWT components.
Once the target's rulebase is determined, the VPM uses a registry of execution point/validation process pairs to obtain a validation process class for the execution point. The target rulebase and execution point are then used to create a validation process. Each type of execution point would most likely have a corresponding validation process class associated with it in the registry in the VPM. If an execution point does not have a registry entry then a default validation process is created.
Note: The mapping of execution points to validation processes is currently hard-coded in ACTF. Future releases will support a full specification of this mapping.
On initialization, the validation process builds a validation context from the target's rulebase and determines which rulesets are to be used for the rule definitions. Starting at the target component, the validation process traverses the components while applying the validation rules for each component. For each component, it determines what rulesets are associated with the execution point and the target. If one of the associated rulesets is enabled, an instance of the Validator specified in the execution point is created using the ruleset and validation context. After all the rules have been applied to a component, the validation process recursively validates the component's children until all components have been validated.
During the execution of the validation rules, the validator generates validation records for each rule that fails. The validation records are collected by the reporter into a validation report. After the validation is complete for a hierarchy of components the validation report is passed to a report viewer to be displayed.