Hi all!

Please help me with this problem: I have a class Employed ( name, workedHours, extraHours), and two facts asserted into working memory:

Employed("Susan",10,5);
Employed("Fred",16,8);

I also have two rules. First one is ok, it fires and  print the correct results, but the second one give this error:"emp can not be resolved "

rule "Extra Hours-Predicate _expression_"

    when
           Employed(employedID=="Fred", extra:extraHours)
           Employed(ext:extraHours ->(extra.intValue()==ext.intValue()+3))
    then
           System.out.println("Predicate Constraint -- extra:"+extra+" ext:"+ext);
end

rule "allEmployedFacts"

    when
        Employed(emp:employedID)
    then
        System.out.println("Name:"+emp);
end

Please tell me what can be the problem  and where I did something wrong!

Regards, Oana


Access over 1 million songs - Yahoo! Music Unlimited.

Reply via email to