I added some logic to the decisiontables module to allow properties to be specified per RulesTable. This is done by declaring a RulesTableConfig tag followed by properties that should apply to the following RulesTable. I used this capability to allow declarations of code snippets that should be inserted before/after generated conditions and before/after the consequences on the right hand side. This allows me to create more complicated rule templates.

For example, the declaration:
----
RuleTableConfig
LhsPreamble     ##LHS PREAMBLE
LhsTrailer              ##LHS TRAILER
RhsPreamble     ##RHS PREAMBLE
RhsTrailer              ##RHS TRAILER
----

produces the following DRL output:

----
package Testing_table_configuration;
#generated from Decision Table
#From row number: 14
rule "_14"
        
        when
                ##LHS PREAMBLE
                Abc(column == "123")
                ##LHS TRAILER
        then
                ##RHS PREAMBLE
                def.action;
                ##RHS TRAILER
end
----

The patch which includes these changes (against 3.0.5 source bundle) is attached. I also added a test case spreadsheet to src/test/ resources/data which is not included in the patch but is attached to this email. For some reason I was unable to get the patch to apply cleanly from the command line but Eclipse took it just fine.

Let me know if this is of interest and is a candidate for commit to SVN. If so, I can update the patch to apply against the trunk.

Terry Laurenzo

Attachment: add_properties.diff
Description: Binary data

Attachment: RuleTableConfig.xls
Description: Binary data




_______________________________________________
rules-dev mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-dev

Reply via email to