0 Replies Latest reply on Apr 25, 2008 11:31 AM by Lloyd Houseman

    Problem with field extractor - DROOLS

    Lloyd Houseman Newbie

      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?