[jboss-user] [Beginners Corner] - Problem with field extractor - DROOLS

lloyd.houseman do-not-reply at jboss.com
Fri Apr 25 11:31:30 EDT 2008


I have recently started using DROOLS and I keep having a problem. I think I am not entirely sure how the field extractors are supposed to work. Basically I need to write a rule that fires when a particular category of object is encountered but drools keeps returning null for the category even though the category has contents. I think the best way to see it is the following code...

rule "Test"
  | 
  | 	when
  | 		$ts : CategorisedTree($category : category)
  | 	then
  | 		System.out.println($category + " == " + $ts.getCategory() + " ? " + ($category == $ts.getCategory()));
  | 
  | end

and this is the output...

null == Relation ? false
  | null == Type ? false
  | null == Surname ? false
  | null == MiddleName ? false
  | null == FirstName ? false

I know I must be missing somthing, can anyone please point me in the right direction?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4146852#4146852

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4146852



More information about the jboss-user mailing list