Writing Rule Sets For Triage

All triage rule sets will need to use the triage interface so that they can be executed within UA. The interface is detailed below:

<?xml version="1.0" encoding="UTF-8"?>
<!--
  Copyright 2010-2011 Curam Software Ltd.
  All rights reserved.

  This software is the confidential and proprietary
  information of Curam Software, Ltd. ("Confidential
  Information").  You shall not disclose such Confidential
  Information and shall use it only in accordance with
  the terms of the license agreement you entered into
  with Curam Software.
-->
<RuleSet
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation=
   "http://www.curamsoftware.com/CreoleRulesSchema.xsd"
  name="TriageInterfaceRuleSet">

  <!-- This class must be extended by all rule sets invoked by
  the Citizen Portal screening results processing. -->
  <Class name="AbstractTriageResult" abstract="true">

    <Attribute name="alertMessage">
      <type>
        <javaclass name="List">
          <ruleclass name="AbstractAlertMessage"/>
        </javaclass>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="services">
      <type>
        <javaclass name="List">
          <ruleclass name="AbstractService"/>
        </javaclass>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="programs">
      <type>
        <javaclass name="List">
          <ruleclass name="AbstractProgram"/>
        </javaclass>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="screenings">
      <type>
        <javaclass name="List">
          <ruleclass name="AbstractScreening"/>
        </javaclass>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="intakeApplications">
      <type>
        <javaclass name="List">
          <ruleclass name="AbstractIntakeApplication"/>
        </javaclass>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="needs">
      <type>
        <javaclass name="List">
          <ruleclass name="AbstractNeed"/>
        </javaclass>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

  </Class>

  <!-- Abstract Need -->
  <Class abstract="true" name="AbstractNeed">
    <Attribute name="description">
      <type>
        <javaclass name="curam.creole.value.Message"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="identifier">
      <type>
        <javaclass name="String"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="appropriate">
      <type>
        <javaclass name="Boolean"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="priority">
      <type>
        <javaclass name="Number"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>
  </Class>

  <!-- Abstract Screening -->
  <Class abstract="true" name="AbstractScreening">
    <Attribute name="description">
      <type>
        <javaclass name="curam.creole.value.Message"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="appropriate">
      <type>
        <javaclass name="Boolean"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="identifier">
      <type>
        <javaclass name="String"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>
  </Class>
  <!-- End Abstract Screening -->

  <!-- AbstractIntakeApplication -->
  <Class abstract="true" name="AbstractIntakeApplication">
    <Attribute name="description">
      <type>
        <javaclass name="curam.creole.value.Message"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="appropriate">
      <type>
        <javaclass name="Boolean"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="identifier">
      <type>
        <javaclass name="String"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>
  </Class>
  <!-- End AbstractIntakeApplication -->

  <Class name="AbstractAlertMessage" abstract="true">
    <Attribute name="alertRequired">
      <type>
        <javaclass name="Boolean"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>
    <Attribute name="message">
      <type>
        <javaclass name="curam.creole.value.Message"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>
  </Class>

  <!-- Abstract Service -->
  <Class abstract="true" name="AbstractService">
    <Attribute name="description">
      <type>
        <javaclass name="curam.creole.value.Message"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="appropriate">
      <type>
        <javaclass name="Boolean"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="identifier">
      <type>
        <javaclass name="String"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="groupInd">
      <type>
        <javaclass name="Boolean"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="needIdentifier">
      <type>
        <javaclass name="String"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

  </Class>

  <!--  Abstract program  -->
  <Class abstract="true" name="AbstractProgram">
    <Attribute name="description">
      <type>
        <javaclass name="curam.creole.value.Message"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="appropriate">
      <type>
        <javaclass name="Boolean"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="programTypeReference">
      <type>
        <javaclass name="String"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

    <Attribute name="needIdentifier">
      <type>
        <javaclass name="String"/>
      </type>
      <derivation>
        <abstract/>
      </derivation>
    </Attribute>

  </Class>

</RuleSet>

The ruleset specified by the curam.citizenworkspace.triage.ruleset.name application property must include a rule class, typically named "Triage" which extends the AbstractTriageResult rule class outlined above.

This usage of the AbstractTriageResult rule class guarantees that the required attributes are available during the rules execution.