Sample Mapping From Rules Output To Datastore

Presuming a MotivationType record exists which specifies the following results schema, note that not all elements here are in the abstract rule set or required in the results datastore, they are just present for demonstrations purposes. These demonstrate how a customer would go about getting custom data from their ruleset populated in the result datastore.

Figure 1. Datastore Schema Sample
<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>

Conceptually, the above schema only allows the datastore to be populated by the rules as follows. Anything else output by the rules will be ignored.