Eligibility

Now that we have a SampleBenefit rule set with a Rule called "Eligibility" it's time to add some business logic.

  1. From the Business (default) palette on the right-hand side of the editor, drag an AND Rule Group element onto the rule element on the diagram (you will see a Golden circle appear when you move over the rule element). Change the name of the AND Rule Group to be "The household contains an eligible person and passes the income test".
  2. Drag a Rule element from the Business (default) palette onto the "Empty Member" element within the AND Rule Group. A dialog will appear where the "Empty Rule" is selected. For now just click the "Save" button to close the dialog. On the empty reference change the name of the to be "The household contains an eligible person".
  3. Drag another AND Rule Group element over this empty reference until you see arrows to the left and right of the reference. Move the mouse over the right-hand arrow until it turns green and drop it. Change the name of the AND Rule Group to be "The income is between 0 and 20000".
  4. Drag a Compare element onto the "Empty Member" of the new AND Rule Group. Change its name to be "Income is greater than 0".
  5. Drag another Compare element to the right of the first compare and change its name to be "Income is less than 20000".

This rule has now sufficient text and structure that can be understood by both a business user and a technical user. The Rule has an empty reference with two compares with an "AND" conjunction between them. There is also an "AND" conjunction between the reference and the group of compares.

  1. Create a new Rule in the Sample Benefit Rules folder called "Household Contains Eligible Person". Again leave the type as Boolean.
  2. Add a description to the rule: "Household Contains Eligible Person".
  3. Drag a Repeating Rule from the Business (extended) palette onto the rule. Change the name of the Repeating Rule to be "Any of the people in the household are eligible".
  4. Drag a Rule onto the Empty List element in the repeating rule. An empty rule is fine for now. Change its name to be "All the people in the household".
  5. Drag another Rule onto the Empty Members element within the repeating rule. Again an empty rule is fine here. Change its name to be "The current person is eligible".
  6. Using the context menu on the repeating rule element (this is available on the right side of the element), choose the "Succeed on Any" option.

This rule has now sufficient text and structure that can be understood by both a business user and a technical user. However if more information is required, add extra context to the description of the Empty rule elements.

  1. Create a new rule in the "Person Rules" folder called "Eligible Person".
  2. Drag an OR Rule Group element from the Business (default) palette onto the rule element on its diagram and change its name to be "The person is either a child or a student".
  3. Drag a Compare element onto the Empty Member element within the OR Rule Group and change its name to be "The person is a child under the age of 16".
  4. Drag an AND Rule Group below the compare element and change its name to be "The person is a student in the right age range".
  5. Drag a rule onto the Empty Member element within the AND Rule Group and change its name to be "The person is a student".
  6. Drag another AND Rule Group to the right of this "The person is a student" rule and change its name to be "Their age is between 16 and 22".
  7. Drag a Compare element onto the Empty Member element within the AND Rule Group and change its name to be "Age is greater than 16".
  8. Drag another Compare element to the right of this Compare and change its name to be "Age is less than 22".

This rule has now sufficient text and structure that can be understood by both a business user and a technical user. When reading this rule the user should see that this rule states: " The person is under 16 OR is a student AND in the age range of 16 to 22 ". However if more information is required, add extra context to the description of the Empty rule elements.