샘플 규칙: 복합 속성(단일 규칙 오브젝트, 어노테이션이 작성됨)

그림 1. 복합 속성(단일 규칙 오브젝트, 어노테이션이 작성됨)
<Class name="Eligibility" extends="AbstractEligibility" 
extendsRuleSet="MotivationRuleSet" 
xsi:noNamespaceSchemaLocation="http://www.curamsoftware.com/CreoleRulesSchema.xsd">
         .. Other attributes ..
        <Attribute name="annotatedAttributeElementWillBeAnnotated">
            <type>
                <ruleclass name="AnnotatedElement">
            </type>
            <derivation>
                <create ruleclass="AnnotatedElement">
            </derivation>
        </Attribute>
    </Class>

   <Class name="AnnotatedElement"
        xsi:noNamespaceSchemaLocation="http://www.curamsoftware.com/CreoleRulesSchema.xsd">
        <Annotations>
            <Motivation_Display_Element resultSchemaElement="ElementNameFromAnnotation">
        </Annotations>

        .. Attributes ..

    </Class>

AnnotatedElement는 어노테이션이 작성되지 않았으므로 해당 데이터 저장소 엔티티에 사용된 이름은 어노테이션의 resultSchemaElement 속성 즉, ElementNameFromAnnotation이 됩니다. 처리에서 Eligibility.ElementNameFromAnnotation이 허용되는지 스키마를 확인하고(즉 상위 RuleObject의 이름과 이 RuleObject 이름의 조합, 스키마는 이를 허용하므로 ElementNameFromAnnotation 엔티티가 추가되어 적격성 엔티티에 추가됩니다. RuleObject를 나타내는 속성의 경우 상위 RuleClass에서 속성의 이름은 중요하지 않습니다. (즉, 위의 적격성 RuleClass에서 annotatedAttributeElementWillBeAnnotated 속성의 이름은 무시됩니다.) 일치는 상위 RuleObject에서 RuleObject를 나타내는 속성의 이름이 아닌, 상위 RuleObject 이름과 RuleObject 자체의 이름을 기반으로 합니다. 어노테이션이 없는 경우 잠재적 데이터 저장소 엔티티에 사용되는 이름은 AnnotatedElement가 됩니다. 스키마는 Eligibility.AnnotatedElement를 허용하지 않으므로 이 엔티티는 작성되지 않습니다. 이는 결과 데이터 저장소에 있을 RuleClass는 스키마에서 예상되는 요소와 일치하도록 어노테이션이 작성되어야 함을 보여줍니다.