Code Tables

Any application code table may be used as a data type in your CER rule set.

Tip: The code table does not necessarily need to exist at development time; if an administrative user uses the online application to create a new code table, that code table can then be used as a data type in dynamically-defined CER rule sets.

To create an instance of a code table entry (i.e. to refer to a particular item in the code table), use the Code expression.

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

    <Attribute name="gender">
      <type>
        <!-- The value of this attribute will
             be an entry from the "Gender" Cúram
             code table. -->
        <codetableentry table="Gender"/>
      </type>
      <derivation>
        <specified/>
      </derivation>
    </Attribute>

    <Attribute name="isMale">
      <type>
        <javaclass name="Boolean"/>
      </type>
      <derivation>
        <!-- Use "Code" to create a codetableentry value
        for comparison. -->
        <equals>
          <reference attribute="gender"/>
          <Code table="Gender">
            <!-- The code from the code table -->
            <String value="MALE"/>
          </Code>
        </equals>
      </derivation>
    </Attribute>

  </Class>

</RuleSet>