[rules-dev] Adding parameters to RulesTables

Terry Laurenzo tlaurenzo at rcode.net
Mon Mar 12 19:36:45 EDT 2007


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: add_properties.diff
Type: application/octet-stream
Size: 12860 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-dev/attachments/20070312/2e28aff0/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: RuleTableConfig.xls
Type: application/octet-stream
Size: 18432 bytes
Desc: not available
Url : http://lists.jboss.org/pipermail/rules-dev/attachments/20070312/2e28aff0/attachment-0001.obj 
-------------- next part --------------





More information about the rules-dev mailing list