sábado, 22 de agosto de 2015

Testing CER Rules

After done the follow the Example - Creating a simple CER Rules you can test your CER Rules with the following steps:

Step 1 Generate Rules
Go to EJBServer DOS window because you need to extract the ruleset
Make build creole.extractrulesdata
Your ruleset will be extracted to \build\dataextractor\blob

Step 2 Copy files generatedSearch RulesPerson.xml and RULESET-RulesPerson1.properties and Copy it to EJBServer\components\custom\CREOLE_Rule_Sets (or whatever directory you are working in)

Step 3 Add body rule with correct version into DMXAfter add to or create EJBServer\components\custom\data\initial\CREOLERULESET.dmx an entry for your ruleset (You can copy the ssction generated on \build\dataextractor\blob\CREOLERULESET.dmx)
(if you use the extracted DMX you need to change the ruleSetVersion)

Step 4 Generate class Java for use into eclipse with JunitThen do build creole.generate.test.classes  and refresh in eclipse.  This should extent RulesTestBase, which in turn extends CuramServerTest.  You can then write your junit tests
Cúram create the class into
EJBServer\build\svr\creole.gen\source\curam\creole\ruleclass\RulesPerson\impl

Step 5 Invoke cer rules from java into eclipse
And you can use the object session for generated documentation.













Step 6 View Documentation and result about rule
Result after configured the session documentation


 

 You can help the statistics rules too for this part.

Example - Creating a simple CER Rules

This is an overview, as you can create a CER rules, it is not intended to replace the full 10 days of CER training that IBM offer.
 
Good, first, log in Cúram or Care Management as admin user after follow the next steps:
 
Step 1  Cúram Express Rule Sets
Go to Rules and Evidence.  Select "Cúram Express Rule Sets".
 
 
Create a new ruleset click "New" from the Page Actions Menu.  Give it a name and an optional category.  Click Save 
 
 Search your ruleset created and click "Continue Editing"

 Cúram show a new blank ruleset

 
 Step 2  Cúram a Class
Now click the "Technical View".  After add a class  (This is analogous to a Java class).


 
 After add age attribute with " Initialization" box is checked, after change the type to a number





 After add "gender" attribute the type String (also could be used condatables but now not)

 
 After create a “Result” attribute without class initialization check


After double click a “Result” attribute.  That contain the diagram for the attribute

 
 Step 3 Make the Flow Rule

On the right, there are the tools for works. The Idea is make the next condition: if is woman and age is between 27 and 50 years.

Set the tool palette to business default


After select "Choose" and drag and drop into the “Result” attribute on the diagram
 
  After select  the Result type (Boolean).


After Cúram Show, Click in save.

 

After drag and drop "And Group" and “Compare


 
  After drag and drop “Rule” and select the attribute “age



In the  tool you can select "Data Type" and drag and drop "number", for compare with the attribute age



In properties you can set a specific value for the compare


 
 
In the  tool you add, another "compare", "rule" for completed the rule compare


 

In the  tool you can add, another "compare", "rule" for completed the rule compare with the Gender, the same form.




 Save and validate.  Fix any errors.

 
Step 4 Publish the rule

Click in action publish, select check box and click on buttom publish.