tag:blogger.com,1999:blog-6666038.post-56643604510250910402008-02-07T09:59:00.001-05:002008-02-27T21:29:08.459-05:00Agile Curam Development Requirements Gathering: Rules and Evidence<p>To be honest, Curam provides an excellent document called the Rules Definition Guide in their Documentation Center that would be a good read for any Business Analyst dealing with Rules.&nbsp; This blog will not rehash what is written there, but my knowledge is based on what was written in that document and other business rule specifications I have seen in other projects.</p> <p>Although the focus is on Curam, this can be applied to any other rules engine analysis work.</p> <h2>Which to do first: Rules or Evidence?</h2> <p>That's usually one of the first questions.&nbsp; The answer to this is neither.&nbsp; If you're thinking of rules and <a href="http://www.trajano.net/2008/02/agile-curam-development-requirements_27.html">evidence</a> you're thinking way too far ahead.&nbsp; That's a good thing.</p> <p>The starting point for any rules/evidence work is <strong>policy</strong>.&nbsp; Policy can be in the form of a legislation or an existing manual.&nbsp; This sets up a guideline for you to work with.</p> <p>Policies tend to be very large documents.&nbsp; It is best that before you try and extract information from the policies you break it up into logical chunks.&nbsp; Usually chapters and subchapters are sufficient.</p> <p>Most policies will tell you what <strong>conditions</strong> you have to meet and what are the <strong>outcome </strong>based on those conditions.&nbsp; This will be the data that gets put into <strong>the catalogue</strong>.</p> <h2>The catalogue</h2> <p>The catalogue is an <strong>interim</strong> work product.&nbsp; It should contain a list of conditions and outcome and links to the <em>sub</em>-policies.&nbsp; This is predominantly a copy and paste from a policy document.</p> <p>The catalogue would have the following sections.</p> <ul> <li><strong>Policy Map</strong> - which maps out the policy document and how it is broken into sub-policies for the use of the analysis. <li>For each sub-policy, table containing the following columns: <ul> <li>Sub Policy ID - A unique identifier for the sub-policy.&nbsp; (e.g. PO-1.1) <li>Condition ID - A unique identifier for the condition. (e.g. PO-1.1-1) <li>Condition text. <li>Condition Analysis <ul> <li>Input data required for the condition (not necessarily where to get it, but what they are). <li>The outcome of the condition.</li></ul></li></ul></li></ul> <p>Here is an example of a conditions that may appear in a policy document.</p> <blockquote> <p>A senior citizen with no living siblings will receive $100 times their age if they have paid CCSIB premiums for at least 5 years.</p> <p>A senior citizen with living siblings will receive $100 times their age if they have paid CCSIB premiums for at least 10 years.</p></blockquote> <p>The analysis can be broken up into a more formal table format.&nbsp; However, since this is an interim piece of work, you can get away with just creative highlighting.&nbsp; For example:</p> <blockquote> <p>A <u>senior</u> <u>citizen</u> with <u>no living siblings</u> will <strong>receive $100 times their <u>age</u></strong> if they have <u>paid CCSIB premiums for at least 5 years</u>.</p></blockquote> <p>What I have done was <u>underline</u> each individual input data and <strong>bolded</strong> the outcomes.&nbsp; If you keep things consistent you should be able to get away with that approach with the client.&nbsp; Just remind them that this an <strong>interim </strong>work product but one of the first step in analysis.</p> <p>If you need a formal table format, you can use the following:</p> <table cellspacing="0" cellpadding="2" width="593" border="1"> <tbody> <tr> <td valign="top" width="104"><strong>Condition ID</strong></td> <td valign="top" width="100"><strong>Policy ID</strong></td> <td valign="top" width="102"><strong>Policy Text</strong></td> <td valign="top" width="95"><strong>Data Elements</strong></td> <td valign="top" width="95"><strong>Outcomes</strong></td> <td valign="top" width="95"><strong>Analysis</strong></td></tr> <tr> <td valign="top" width="107">P001-C001</td> <td valign="top" width="100">P001</td> <td valign="top" width="105">A <u>senior</u> <u>citizen</u> with <u>no living siblings</u> will <strong>receive $100 times their <u>age</u></strong> if they have <u>paid CCSIB premiums for at least 5 years</u>.</td> <td valign="top" width="94"> <ul> <li>senior citizen <li>no living siblings <li>age <li>paid CCSIB premiums for the last 5 years</li></ul></td> <td valign="top" width="94">receive $100 times age</td> <td valign="top" width="94">&nbsp;</td></tr> <tr> <td valign="top" width="109">P001-C002</td> <td valign="top" width="100">P001</td> <td valign="top" width="107">This benefit cannot be removed by any future government</td> <td valign="top" width="93">&nbsp;</td> <td valign="top" width="94">&nbsp;</td> <td valign="top" width="95">Statement.&nbsp; Not a rule</td></tr> <tr> <td valign="top" width="109">P001-C003</td> <td valign="top" width="100">P001</td> <td valign="top" width="107"><u>Part of a clan</u></td> <td valign="top" width="93"> <ul> <li>part of a clan</li></ul></td> <td valign="top" width="94">&nbsp;</td> <td valign="top" width="95">Missing outcome.</td></tr></tbody></table> <p>There was an emphasis on <strong>interim</strong>, because this catalogue is useless for development and just a regurgitation of the policy from the client.&nbsp; It is also highly likely that not everything can be covered in policies.</p> <p>As a BA you have to add value in order for development to be able to use it.&nbsp; So the next step is to convert what you have into a decision table.</p> <h2>The decision table</h2> <p>The <a href="http://en.wikipedia.org/wiki/Decision_tables">decision table</a> is a table that collects all the information from the catalogue and places them into a tabular format.&nbsp; A group of condition results in a decision table.&nbsp; The following shows a decision table for a condition group.</p> <p><strong>Conditions satisfied:</strong></p> <ul> <li>PO-1.1-1 <li>PO-1.1-2 <li>PO-1.1-3 <li>PO-1.1-4 <li>PO-1.1-5</li></ul> <table cellspacing="0" cellpadding="2" width="477" border="1"> <tbody> <tr> <td valign="top" width="111"><strong>Input Data Name</strong></td> <td valign="top" width="102"><strong>Input Data Formula</strong></td> <td valign="top" width="55"><strong></strong></td> <td valign="top" width="55"><strong></strong></td> <td valign="top" width="51"><strong></strong></td> <td valign="top" width="51"><strong></strong></td> <td valign="top" width="50"><strong></strong></td></tr> <tr> <td valign="top" width="114">senior</td> <td valign="top" width="104">CN-PO-1.1-1</td> <td valign="top" width="55">Y</td> <td valign="top" width="55">Y</td> <td valign="top" width="51">N</td> <td valign="top" width="51">N</td> <td valign="top" width="50">N</td></tr> <tr> <td valign="top" width="114">citizen</td> <td valign="top" width="106">CN-PO-3.1-1</td> <td valign="top" width="55">Y</td> <td valign="top" width="55">Y</td> <td valign="top" width="50">N</td> <td valign="top" width="50">Y</td> <td valign="top" width="49">N</td></tr> <tr> <td valign="top" width="115">no living siblings</td> <td valign="top" width="107">CD052</td> <td valign="top" width="55">Y</td> <td valign="top" width="55">N</td> <td valign="top" width="50">Y</td> <td valign="top" width="50">Y</td> <td valign="top" width="49">N</td></tr> <tr> <td valign="top" width="114">paid CCSIB premiums for at least 5 years</td> <td valign="top" width="109">EV042 &gt;= 5 years</td> <td valign="top" width="55">Y</td> <td valign="top" width="55">-</td> <td valign="top" width="50">-</td> <td valign="top" width="50">-</td> <td valign="top" width="49">Y</td></tr> <tr> <td valign="top" width="114">paid CCSIB premiums for at least 10 years</td> <td valign="top" width="109">EV042 &gt;= 10 years</td> <td valign="top" width="55">N</td> <td valign="top" width="55">Y</td> <td valign="top" width="50">Y</td> <td valign="top" width="50">Y</td> <td valign="top" width="49">N</td></tr> <tr> <td valign="top" width="114">paid MCSB premiums for at least 10 years</td> <td valign="top" width="109">EV? &lt; 10 years</td> <td valign="top" width="55">-</td> <td valign="top" width="55">-</td> <td valign="top" width="50">-</td> <td valign="top" width="50">Y</td> <td valign="top" width="49">Y</td></tr> <tr> <td valign="top" width="114">&nbsp;</td> <td valign="top" width="109">&nbsp;</td> <td valign="top" width="55">&nbsp;</td> <td valign="top" width="55">&nbsp;</td> <td valign="top" width="50">&nbsp;</td> <td valign="top" width="50">&nbsp;</td> <td valign="top" width="49">&nbsp;</td></tr> <tr> <td valign="top" width="114"><strong>Outcome</strong></td> <td valign="top" width="109"><strong>Outcome ID</strong></td> <td valign="top" width="55">&nbsp;</td> <td valign="top" width="55">&nbsp;</td> <td valign="top" width="50">&nbsp;</td> <td valign="top" width="50">&nbsp;</td> <td valign="top" width="49">&nbsp;</td></tr> <tr> <td valign="top" width="114">Receive $100 times their age</td> <td valign="top" width="109">OC412</td> <td valign="top" width="55">X</td> <td valign="top" width="55">X</td> <td valign="top" width="50">X</td> <td valign="top" width="50">&nbsp;</td> <td valign="top" width="49">&nbsp;</td></tr> <tr> <td valign="top" width="114">Receive $200 times their age</td> <td valign="top" width="109">OC413</td> <td valign="top" width="55">&nbsp;</td> <td valign="top" width="55">&nbsp;</td> <td valign="top" width="50">&nbsp;</td> <td valign="top" width="50">X</td> <td valign="top" width="49">X</td></tr></tbody></table> <p>&nbsp;</p> <p>The <strong>Input Data Name </strong>specifies the input data as per the condition record from the catalogue.&nbsp; The outcome data is information required by the outcome calculation.</p> <p>The <strong>Input Data Formula </strong>is a formula that represents the information in the input data name.&nbsp; The formula may consist of an ID to point to some input data with a few simple calculations if needed.&nbsp; This prevents having to create several input data records where the only difference is one parameter.</p> <p>The formula does not show where to get the data, but it is best the Input Data ID represents the possible source in this example we used CD for core data, CN for other conditions, EV or evidence data.&nbsp; Information on where to get the data is in the I/O catalogue which is described later.</p> <p>Sometimes we don't have the any input data information defined yet, in which case we indicate it by a "?" on the ID to remind us to get the information.</p> <p>One word of advice, try to use what is in the core rather than creating new evidences.&nbsp; The information in the core tend to be things that do not really change over time and can be shared with other parts of your application.&nbsp; Evidences are usually not shared outside the integrated case it is associated with.</p> <p>One other thing to avoid: you may be tempted to just put some of the conditions like this:</p> <table cellspacing="0" cellpadding="2" width="484" border="1"> <tbody> <tr> <td valign="top" width="114">years paid paid CCSIB premiums</td> <td valign="top" width="109">EV042 </td> <td valign="top" width="55">&gt;=5</td> <td valign="top" width="55">&gt;=10</td> <td valign="top" width="50">&gt;=10</td> <td valign="top" width="50">&gt;=10</td> <td valign="top" width="49">&gt;=5</td></tr></tbody></table> <p>&nbsp;</p> <p>You may have a harder time normalizing the decision table later.&nbsp; So avoid that.</p> <p>The <strong>Outcome</strong> specifies the outcome as per the condition record from the catalogue.&nbsp; The <strong>Outcome ID</strong> is a unique identifier for the outcome.&nbsp; The outcome ID is not a formula, because describing it as a formula in the decision table would make things hard to read.&nbsp; The detailed information for the outcome will be in the I/O catalogue which is described shortly.</p> <p>Most documentation regarding rules tables call the outcome as <strong>Action</strong>, but in Curam speak it is probably best to call this an outcome as the rule engine does not actually start up processes.</p> <p>Once you have captured your decision table, you can optimize it using the techniques shown in <a href="http://www.cems.uwe.ac.uk/jharney/table.html">http://www.cems.uwe.ac.uk/jharney/table.html</a></p> <p>The conditions satisfied section is just there for the <strong>interim</strong>.&nbsp; It is meant as a way for the BA to keep track as to which conditions have been completed, be the rule catalogue will eventually be <strong>discontinued </strong>in favour of the decision tables and I/O catalogue.&nbsp; At which point, the section will be reworked as <strong>policies satisfied</strong> to ensure that any change in policy will trigger a trace back to the proper decision tables.</p> <h2>The I/O catalogue</h2> <p>This catalogue captures the input data and outcomes that were required by the decision tables in the previous section.</p> <p>For input data, there are three common sources:</p> <ul> <li>Core data - these are provided by Curam core such as Person Details, Relationships, Case Header Data, Related case information. <li>Evidence - these are additional information that are captured as part of the Integrated Case. <li>Other conditions - these are other conditions that have been defined.&nbsp; These could lead to new conditions being developed that were not part of the original policy document.&nbsp; These are <strong>not </strong>in the I/O catalogue though.</li></ul> <p>The following tables would illustrate how to capture the information for input data:</p> <table cellspacing="0" cellpadding="2" width="500" border="1"> <tbody> <tr> <td valign="top" width="183"><strong>Input Data ID</strong></td> <td valign="top" width="162"><strong>Input Data Name</strong></td> <td valign="top" width="153"><strong>Calculation</strong></td></tr> <tr> <td valign="top" width="181">CN005</td> <td valign="top" width="160">date of birth</td> <td valign="top" width="157"><strong>Person.dateOfBirth</strong></td></tr> <tr> <td valign="top" width="180">CN042</td> <td valign="top" width="160">no living siblings</td> <td valign="top" width="161"><strong>Person.dateOfDeath </strong>defined for all <strong>ConcernRoleRelationship </strong>relations where type is sibling</td></tr> <tr> <td valign="top" width="180">CN006</td> <td valign="top" width="160">age</td> <td valign="top" width="161">Current Date - <strong>Person.dateOfBirth</strong></td></tr></tbody></table> <p>&nbsp;</p> <table cellspacing="0" cellpadding="2" width="501" border="1"> <tbody> <tr> <td valign="top" width="120"><strong>Input Data ID</strong></td> <td valign="top" width="124"><strong>Input Data Name</strong></td> <td valign="top" width="84"><strong>Evidence Form</strong></td> <td valign="top" width="171"><strong>Evidence Field</strong></td></tr> <tr> <td valign="top" width="119">EV042</td> <td valign="top" width="122">years paid CCSIB premiums </td> <td valign="top" width="83">CCSIB</td> <td valign="top" width="174">Years Paid</td></tr></tbody></table> <p>&nbsp;</p> <p>As you can see there are two different ways of writing the input data specifications.&nbsp; For core data, it tends to be a calculation rather than a direct field because the data tends to be spread out.&nbsp; It is best to communicate with a Curam developer or someone who knows more about the reference model.&nbsp; It is recommended that data elements be of <strong>different type </strong>to distinguish them from calculation descriptions.</p> <p>Evidence input data tends to be new and so it should be possible to list the exact form and field rather than a calculation.</p> <p>The Outcome data shows the following information:</p> <table cellspacing="0" cellpadding="2" width="501" border="1"> <tbody> <tr> <td valign="top" width="120"><strong>Outcome Data ID</strong></td> <td valign="top" width="124"><strong>Outcome Data Name</strong></td> <td valign="top" width="84"><strong>Objective Type</strong></td> <td valign="top" width="171"><strong>Objective Value Formula</strong></td></tr> <tr> <td valign="top" width="119">OC412</td> <td valign="top" width="122">$100 x age</td> <td valign="top" width="83">Money</td> <td valign="top" width="174">CN006 x 100</td></tr> <tr> <td valign="top" width="119">OC413</td> <td valign="top" width="122">$200 x age</td> <td valign="top" width="83">Money</td> <td valign="top" width="174">CN006 x 200</td></tr> <tr> <td valign="top" width="119">OC501</td> <td valign="top" width="122">Food Delivery</td> <td valign="top" width="83">Product Delivery</td> <td valign="top" width="174">"FOODDELIVERY"</td></tr> <tr> <td valign="top" width="119">OC001</td> <td valign="top" width="122">General Eligibility</td> <td valign="top" width="83">Assessment</td> <td valign="top" width="174">&nbsp;</td></tr></tbody></table> <p>&nbsp;</p> <p>Generally an outcome would end up as an objective in Curam terms.&nbsp; The objectives types are usually money, a product or an assessment.&nbsp; The formula column shows the formula with reference to some of the input data as well.</p> <h2>That's All Folks</h2> <p>This is as far as the BA would go.&nbsp; The combination of decision tables and the I/O catalogue would be sufficient information to communicate with the development team.&nbsp; It also provides a way of communication with the client team as they can visually see what would happen depending on their choices.</p> <p>At this point the rule catalogue should be discarded in favour of the decision tables and the I/O catalogue.&nbsp; This is assuming that all the conditions in the rule catalogue are met.</p> <p>The decision table will be a almost mechanical process to convert to the Curam rules structure.&nbsp; I say almost because the decision table does not name what the data or rulesets are nor do they group things together.&nbsp; That is left with the development team as part of their naming conventions.</p> <p>The I/O catalogue will drive the creation of evidence and loaders.</p> <h2>Conclusion: Be agile</h2> <p>Don't get into analysis paralysis.&nbsp; You should never ever do this when you think you completed a previous section.&nbsp; Once you have sufficient information, move onto the next section, if you realize something is missing go back.&nbsp; There is no harm in updating the previous one.</p> <p>Business rules are very complicated, and policies are just as complicated.&nbsp; Policies tend to be vague and make certain assumptions which cannot be translated into code so you need to ensure those get analyzed.</p> <p>Most likely the little problems would arise in development, but if you have done your job correctly, they should very little and you can fix it with a relatively quick turnaround.</p> <p>The process defined here will provide sufficient documentation for both the client what is going on and the developer to understand what needs to be done.</p> <p>The process defined here is general to most rule engines as well, there is very little Curam specific information so it can be used in other non-Curam projects.</p> Archimedes Trajanohttp://www.blogger.com/profile/15993184075121538415noreply@blogger.com