XML Reference

This section provides a reference to the underlying XML representation of combineSuccessionSets.

Each combineSuccessionSets instance contains:

The following XML implements the logic described in Example.

<?xml version="1.0" encoding="UTF-8"?>
<RuleSet name="Example_combineSuccessionSets"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation=
"http://www.curamsoftware.com/CreoleRulesSchema.xsd">

  <!-- Rule class for a person on a case.  -->
  <Class name="Person">

    <Attribute name="caseParticipantRoleID">
      <type>
        <javaclass name="Number"/>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>

    <!-- Retrieves the absence succession sets (if any) for this 
         person on the case. -->
    <Attribute name="absences">
      <type>
        <javaclass name="List">
          <ruleclass name="Absence"/>
        </javaclass>
      </type>
      <derivation>
        <readall ruleclass="Absence">
          <match retrievedattribute="caseParticipantRoleID">
            <reference attribute="caseParticipantRoleID"/>
          </match>
        </readall>
      </derivation>
    </Attribute>

    <Attribute name="combinedAbsences">
      <type>
        <ruleclass name="CombinedAbsence"/>
      </type>
      <derivation>
        <combineSuccessionSets ruleclass="CombinedAbsence">
          <reference attribute="absences"/>
        </combineSuccessionSets>
      </derivation>
    </Attribute>

    <!-- Eligible if present in the household (i.e. no absence,
         which means the absence reason is blank), or absent
         for the reason of education. -->
    <Attribute name="isEligibleTimeline">
      <type>
        <javaclass name="curam.creole.value.Timeline">
          <javaclass name="Boolean"/>
        </javaclass>
      </type>
      <derivation>
        <timelineoperation>
          <choose>
            <type>
              <javaclass name="Boolean"/>
            </type>
            <test>
              <reference attribute="absenceReason">
                <intervalvalue>
                  <reference attribute="combinedAbsences"/>
                </intervalvalue>
              </reference>
            </test>
            <when>
              <condition>
                <Code table="AbsenceReason">
                  <!-- Not absent - eligible -->
                  <null/>
                </Code>
              </condition>
              <value>
                <true/>
              </value>
            </when>
            <when>
              <condition>
                <Code table="AbsenceReason">
                  <!-- Absent for education - eligible-->
                  <String value="AR001"/>
                </Code>
              </condition>
              <value>
                <true/>
              </value>
            </when>

            <otherwise>
              <!-- Not eligible -->
              <value>
                <false/>
              </value>
            </otherwise>
          </choose>

        </timelineoperation>
      </derivation>
    </Attribute>

  </Class>


  <!-- A rule class for holding a combined history of absences (if
       any) for a person. -->
  <Class name="CombinedAbsence">

    <!-- Will be populated from the (varying) absence reason on
         each contributing absence succession set; will be blank
         for periods between absences. -->
    <Attribute name="absenceReason">
      <type>
        <javaclass name="curam.creole.value.Timeline">
          <codetableentry table="AbsenceReason"/>
        </javaclass>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>


    <!-- Will be populated from the existence period from each
         contributing absence succession set; will be false for
         periods between absences. -->
    <Attribute name="exists">
      <type>
        <javaclass name="curam.creole.value.Timeline">
          <javaclass name="Boolean"/>
        </javaclass>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>
  </Class>

  <!-- A rule class for holding a succession set of evidence for a
       single period of absence (perhaps with a changing reason
       for absence). 
  
       The data on this rule class will be used by the example
       combineSuccessionSet expression to populate the 
       data on the CombinedAbsence rule object returned. 
  
       Note that this rule class inherits an "exists" rule
       attribute from the ActiveSuccessionSet rule class, which
       will also be used.-->
  <Class extends="ActiveSuccessionSet"
 extendsRuleSet="PropagatorRuleSet" name="Absence">

    <Annotations>
      <SuccessionSetPopulation endDateAttribute="endDate"
 startDateAttribute="startDate"/>
    </Annotations>

    <Attribute name="caseParticipantRoleID">
      <type>
        <javaclass name="Number"/>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>

    <Attribute name="startDate">
      <type>
        <javaclass name="curam.util.type.Date"/>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>

    <Attribute name="endDate">
      <type>
        <javaclass name="curam.util.type.Date"/>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>

    <Attribute name="absenceReason">
      <type>
        <javaclass name="curam.creole.type.Timeline">
          <codetableentry table="AbsenceReason"/>
        </javaclass>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>

  </Class>
</RuleSet>