Sample Rules: Complex Attributes (Single Rule Object)

Figure 1. Complex Attributes
<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>
        ... Other attributes ..
    </Class>

   <Class name="Context" extends="AbstractContext" extendsRuleSet="MotivationRuleSet"
        xsi:noNamespaceSchemaLocation="http://www.curamsoftware.com/CreoleRulesSchema.xsd">
        ... Attributes ...
         
    </Class>

Context has not been annotated so the name used for the corresponding datastore entity will be the RuleClass name, ie Context. The processing will check the schema to see if Eligibility.Context is allowed (ie a combination of the parent RuleObject's name and this RuleObject's name), the schema does allow this so a Context entity will be added and appended to the Eligibility entity. For attributes that refer to a RuleObject, the name of the attribute on the parent RuleClass is not important (ie in the Eligibility RuleClass above, the name of context attribute is ignored). The matching is based on the name of the parent RuleObject and the name of the RuleObject itself, not the name of the attribute that refers to the RuleObject on the parent RuleObject.