Thanks ! - I think Steven Williams was working on something similar, but from a different angle - I will get him to take a look at it to see how we could incorporate it.

Michael.

On 3/13/07, Terry Laurenzo <tlaurenzo@rcode.net> wrote:
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






_______________________________________________
rules-dev mailing list
rules-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-dev