Rulebases

Validation documents are XML documents that define all the necessary information to validate a set of components of a given model. The root element of the validation document is the rulebase. The rulebase contains metadata about the rulebase, one or more rulesets, and one or more execution points. The attributes of a rulebase include:

actf:name
the name of this rulebase
actf:enable
boolean to enable/disable this rulebase
actf:model
the model to which this rulebase is to be applied. (ex. swt, swing, etc.)
actf:scriptlang
the code processor or scripting engine to use when evaluating the rules.
actf:version
the version of this rulebase definition

Sample Rulebase Definition

A sample, abbreviated rulebase definition follows:


<actf:rulebase xmlns:actf="http://www.eclipse.org/projects/actf/validation"
    actf:name="SwtAccessibility"
    actf:enable="true"
    actf:scriptlang="javascript"
    actf:model="swt"
    actf:version="0.1.0">
    
    <actf:metadata>
        <actf:aliases>
        
            ...alias definitions...
            
        </actf:aliases>
    
        <actf:scripts>
        
            ...script definitions...
            
        </actf:scripts>
    </actf:metadata>
    
    <actf:ruleset>
        actf:name="AccessibilityRuleSet"
        actf:enable="true"
        actf:executionPoint="visibility"
        actf:ruleFactory = "org.eclipse.actf.validation.core.rules.IRuleFactory">
    
            ...rule definitions...
    
    </actf:ruleset>
    
    <actf:executionPoint
        actf:name="visibility"
        actf:validator="org.eclipse.actf.javaco.core.validators.SwtAccessibilityValidator">
    
    <actf:modelTransition
        actf:regexp="java\.awt\..+"
        actf:rulebase="SwingAccessibility"
        actf:executionPoint="visibility"/>
    
    <actf:modelTransition
        actf:regexp="javax\.swing\..+"
        actf:rulebase="SwingAccessibility"
        actf:executionPoint="visibility"/>

</actf:rulebase>