[rules-users] "From" in decision table

Bruno Freudensprung bruno.freudensprung at temis.com
Wed Sep 7 08:05:00 EDT 2011


Hi guys,

As you have probably noticed, today is my "decision tables day" :-).
Before telling you what is going wrong, let me show you what kind of 
rule I try to put in my Drools 5.1 decision table:

         # for each window
         $window : Window($elements : elements) from $windows
         # for each manual annotation
         $an1 : ManualAnnotation( this inside $window && text == 
*"ToMatch"*)
         # if there is another manual annotation
         exists ManualAnnotation( this inside $window && text == 
*"ToMatch2"*)

The only things I would like to parametrize are strings in bold.
My decision table looks like this:

CONDITION 	CONDITION 	CONDITION
	CONDITION 	CONDITION

	$an1 : ManualAnnotation 	
	exists ManualAnnotation 	
$window : Window($elements... 	this inside $window
	text == "$1"
	this inside $window 	text == "$1"
for each window
	annotation inside window
	Text 	annotation inside window 	Text
N/A 	N/A 	ToMatch
	N/A 	ToMatch2
N/A 	N/A 	ToMatch3 	N/A 	ToMatch4


Here are the problems (in bold) with the generated rule:

         $an1 : ManualAnnotation( *this inside $window == "N/A"* && text 
== *"*ToMatch*"*)
         exists ManualAnnotation( *this inside $window == "N/A"* && text 
== *"*ToMatch2*"*)
*$window : Window($elements : elements) from $windows*

    * The order of the LHS "fact lines" of the generated rules is the
      not same as the order of appearance in the spreadsheet
    * The "this inside $window" is considered as a field name

Do you know if I can solve those problems?
I have tried to find a way to tell the decision table to extend another 
rule but I haven't found a keyword for that in the documentation.

Maybe do I have to use rule templates?

Many thanks,
Best regards,

Bruno.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20110907/55faa82f/attachment.html 


More information about the rules-users mailing list