규칙 결과에서 데이터 저장소로 샘플 맵핑

다음의 결과 스키마를 지정하는 MotivationType 레코드가 있다고 추정하는 경우 여기에 있는 모든 요소가 추상 규칙 세트에 있거나 결과 데이터 저장소에 필요한 것은 아니며 단지 데모 목적으로 표시됩니다. 고객이 결과 데이터 저장소에 채워진 고객의 규칙 세트에서 사용자 정의 데이터를 계속 가져오는 방법을 보여줍니다.

그림 1. 데이터 저장소 스키마 샘플
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:d="http://www.curamsoftware.com/BaseDomains" elementFormDefault="qualified">
    <xsd:import namespace="http://www.curamsoftware.com/BaseDomains">
    <xsd:include schemaLocation="IEGDomains">
    <xsd:include schemaLocation="MotivationResultDomains">
    <xsd:element name="Eligibility">
        <xsd:complexType>
            <xsd:sequence minOccurs="0">
                <xsd:element ref="Context" minOccurs="0" maxOccurs="1">
                <xsd:element ref="Results" minOccurs="0" maxOccurs="1">
                <xsd:element ref="ElementNameFromAnnotation" minOccurs="0" maxOccurs="1">
            </xsd:sequence>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="Context">
        <xsd:complexType>
            <xsd:sequence minOccurs="0">
                <xsd:element ref="Person" minOccurs="0" maxOccurs="unbounded">
                <xsd:element ref="Summary" minOccurs="0" maxOccurs="1">                
            </xsd:sequence>
            <xsd:attribute name="extratAttributeNotFromAbstractRuleSet" type="IEG_INT64">                                            
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="ElementNameFromAnnotation">
        <xsd:complexType>
            <xsd:attribute name="attributeFromAnnotation" type="IEG_INT64">                                            
        </xsd:complexType>
    </xsd:element>       
    <xsd:element name="Person">
        <xsd:complexType>
            <xsd:attribute name="personID" type="IEG_INT64">
            <xsd:attribute name="firstName" type="IEG_STRING">
            <xsd:attribute name="lastName" type="IEG_STRING">            
            <xsd:attribute name="dateOfBirth" type="IEG_DATE">            
            <xsd:attribute name="status" type="CW_MOTIVATION_RESULTS_MEMBER_STATUS">
            <xsd:attribute name="gender" type="IEG_GENDER">            
        </xsd:complexType>
    </xsd:element>   
    <xsd:element name="Summary">
        <xsd:complexType>
            <xsd:attribute name="isRichText" type="IEG_BOOLEAN">
            <xsd:attribute name="summaryText" type="IEG_STRING">
            <xsd:attribute name="title" type="IEG_STRING">
        </xsd:complexType>
    </xsd:element>    
    
    <xsd:element name="Results">
        <xsd:complexType>
            <xsd:sequence minOccurs="0">
                <xsd:element ref="Category" minOccurs="0" maxOccurs="unbounded">
            </xsd:sequence>                
        </xsd:complexType>        
    </xsd:element>
    
    <xsd:element name="Category">
        <xsd:complexType>
            <xsd:sequence minOccurs="0">
                <xsd:element ref="Result" minOccurs="0" maxOccurs="unbounded">
            </xsd:sequence>                
            <xsd:attribute name="categoryID" type="IEG_STRING">
            <xsd:attribute name="type" type="IEG_STRING">
            <xsd:attribute name="isPrimary" type="IEG_BOOLEAN">
            <xsd:attribute name="order" type="IEG_INT16">
            <xsd:attribute name="help" type="IEG_STRING">
            <xsd:attribute name="status" type="IEG_STRING">
            <xsd:attribute name="extratAttributeNotFromAbstractRuleSet" type="IEG_INT64">
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="Result">
        <xsd:complexType>
            <xsd:sequence minOccurs="0">
                <xsd:element ref="Person" minOccurs="0" maxOccurs="unbounded">
                <xsd:element ref="Benefit" minOccurs="0" maxOccurs="unbounded">
            </xsd:sequence>                 
            <xsd:attribute name="resultID" type="IEG_STRING">
            <xsd:attribute name="type" type="IEG_CODETABLE_CODE">
            <xsd:attribute name="resultDescription" type="IEG_STRING">            
            <xsd:attribute name="status" type="IEG_STRING">
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="Benefit">
        <xsd:complexType>
            <xsd:attribute name="benefitType" type="IEG_CODETABLE_CODE">
            <xsd:attribute name="benefitValue" type="IEG_INT32">
            <xsd:attribute name="explanation" type="IEG_STRING">
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

개념상으로 위의 스키마에서만 데이터 저장소가 다음과 같은 규칙에 의해 채워질 수 있습니다. 규칙에 의한 그밖의 또 다른 결과는 무시됩니다.