Sample Rules: Processing Rule Objects

Figure 1. Processing Rule Objects Sample
<Class name="Eligibility" extends="AbstractEligibility" 
extendsRuleSet="MotivationRuleSet" 
xsi:noNamespaceSchemaLocation="http://www.curamsoftware.com/CreoleRulesSchema.xsd">
    <Attribute name="context">
       <type>
        <ruleclass name="AbstractContext" ruleset="MotivationRuleSet">
       </type>
         <derivation>
          <create ruleclass="Context">
         </derivation>
    </Attribute>
    <Attribute name="results">
       <type>
        <ruleclass name="AbstractResults" ruleset="MotivationRuleSet">
       </type>
         <derivation>
          <create ruleclass="Results">
         </derivation>
        </Attribute>
    <Attribute name="annotatedAttributeElementWillBeAnnotated">
       <type>
        <ruleclass name="AnnotatedElement">
       </type>
        <derivation>
          <create ruleclass="AnnotatedElement">
        </derivation>
    </Attribute>
</Class>

Taking the RuleClass above, where Eligibility is the first RuleClass in the ruleset (this must always be the case), the motivation processing will add a datastore entity named Eligibility, and for each of the Context, Results and AnnotatedElement attributes process their attributes (and their attributes' attributes etc), adding new datastore entities and attributes to existing entities as appropriate relative to the schema.