This section provides a reference to the underlying XML representation of legislationChange.
Each legislationChange instance contains:
The following XML implements the logic described in Example.
A production-quality rule set would instead externalize these rates using Cúram's rate tables. See rate for further details.
<?xml version="1.0" encoding="UTF-8"?> <RuleSet name="Example_legislationChange" 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"> <!-- The pre-tax income for this person. --> <Attribute name="preTaxIncomeTimeline"> <type> <javaclass name="curam.creole.value.Timeline"> <javaclass name="Number"/> </javaclass> </type> <derivation> <specified/> </derivation> </Attribute> <!-- The pre-tax income for this person. --> <Attribute name="postTaxIncomeTimeline"> <type> <javaclass name="curam.creole.value.Timeline"> <javaclass name="Number"/> </javaclass> </type> <derivation> <specified/> </derivation> </Attribute> <!-- Eligible if "low-waged", where the definition of "low-waged" varies as changes in legislation are enacted. --> <Attribute name="isEligibleTimeline"> <type> <javaclass name="curam.creole.value.Timeline"> <javaclass name="Boolean"/> </javaclass> </type> <derivation> <legislationChange> <!-- The type of the timeline returned is a timeline of Boolean values. --> <intervaltype> <javaclass name="Boolean"/> </intervaltype> <!-- Initial legislation era. --> <era> <from> <null/> </from> <value> <timelineoperation> <!-- Low-waged if pre-tax income is below 20,000. --> <compare comparison="<"> <intervalvalue> <reference attribute="preTaxIncomeTimeline"/> </intervalvalue> <Number value="20000"/> </compare> </timelineoperation> </value> </era> <!-- A change in legislation, effective from 1st January 2001, --> <era> <from> <Date value="2001-01-01"/> </from> <value> <timelineoperation> <!-- Low-waged if post-tax income is below 15,000. --> <compare comparison="<"> <intervalvalue> <reference attribute="postTaxIncomeTimeline"/> </intervalvalue> <Number value="15000"/> </compare> </timelineoperation> </value> </era> <!-- Another change in legislation, effective from 1st January 2002. --> <era> <from> <Date value="2002-01-01"/> </from> <value> <timelineoperation> <!-- Low-waged if pre-tax income is below 22,000 OR post-tax income is below 16,000. --> <any> <fixedlist> <listof> <javaclass name="Boolean"/> </listof> <members> <compare comparison="<"> <intervalvalue> <reference attribute="preTaxIncomeTimeline"/> </intervalvalue> <Number value="22000"/> </compare> <compare comparison="<"> <intervalvalue> <reference attribute="postTaxIncomeTimeline"/> </intervalvalue> <Number value="16000"/> </compare> </members> </fixedlist> </any> </timelineoperation> </value> </era> </legislationChange> </derivation> </Attribute> </Class> </RuleSet>