[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2758) matrix sytle decision tables do not have documentation

Michael Anstis (JIRA) jira-events at lists.jboss.org
Fri May 20 05:15:01 EDT 2011


    [ https://issues.jboss.org/browse/JBRULES-2758?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12603355#comment-12603355 ] 

Michael Anstis commented on JBRULES-2758:
-----------------------------------------

OK, org.drools.decisiontable.parser.RuleMatrixSheetListener is an example of how you can write your own RuleSheetListener.

Test org.drools.decisiontable.SpreadsheetCompilerUnitTest.testLoadCustomListener() shows how it can be used. There is no other documentation since the example RuleSheetListener is really just that, an example. I looked at the test though and it looks quite straight forward to meet your requirement, provided your "Cs" are a template condition with single parameter: e.g. "Cheese( flavour == $param)":-

*Header*
{code}
PreCondition        [C37]: "$r : Result()"
Action              [C38]: $r.setResult($param);"
HorizontalCondition [C39]: "C( field1 == $param)"
VerticalCondition   [C40]: "C( field2 == $param)"
{code}

*Body*
{code}
\\|C        |D |E |F |
--+---------|--|--|--|
44|RuleTable|v1|v2|v3|
--+---------|--|--|--|
45|v1       |T |  |  |
--+---------|--|--|--|
46|v2       |F |F |  |
--+---------|--|--|--|
47|v3       |T |T |F |
--+---------|--|--|--|
{code}

*Rules*
{code}
//Rule for D45
when
  $r : Result()
  C(field1 == v1)
  C(field2 == v1)
then
  $r.setResult(T);
end
{code}

> matrix sytle decision tables do not have documentation
> ------------------------------------------------------
>
>                 Key: JBRULES-2758
>                 URL: https://issues.jboss.org/browse/JBRULES-2758
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: drools-api
>    Affects Versions: 5.1.1.FINAL
>            Reporter: kioto m
>            Assignee: Michael Anstis
>             Fix For: 5.2.0.CR1
>
>   Original Estimate: 1 day
>  Remaining Estimate: 1 day
>
> We need to use matrix style decision table feature of Drools but it does not have any documentation.
> Below there exists related files but they are almost useless. If you still support this feature, then it will be great if you can
> supply documentation and examples for it.
> http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-decisiontables/src/test/resources/data/CustomWorkbook.xls
> http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-decisiontables/src/test/java/org/drools/decisiontable/SpreadsheetCompilerUnitTest.java testLoadCustomListener()
> http://anonsvn.jboss.org/repos/labs/labs/jbossrules/trunk/drools-decisiontables/src/main/java/org/drools/decisiontable/parser/RuleMatrixSheetListener.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list