Dear user group,
 
I have a question about the use of the package statement in Drools (3).
The application is for testing specific traffic situations (lost cargo,
accidents etc.)  The traffic situation are send through JMS to the
application and at reception asserted to the workingmemory and the rules
are fired.
 
 
I am getting errors at the moment I try to use the package definition as
stated below. It gives the following error;
Rule Compilation error The import vdberg.CarsXGC cannot be resolved The
import vdberg.CarsXGC cannot be resolved vdberg.CarsXGC cannot be
resolved to a type Element cannot be resolved to a type Element cannot
be resolved to a type vdberg.CarsXGC cannot be resolved to a type
 
When I change to the second package statement everything works as
expected. I don't understand the relation between the package
declaration and the import. The jar containing the two classes is on the
classpath. Is there something I am overlooking..
 
package test
/** package vdberg.CarsXGC.ejbcontainer.domain **/
 
import java.lang.Long
import java.lang.String
import vdberg.CarsXGC.ejbcontainer.domain.Situation
import vdberg.CarsXGC.ejbcontainer.domain.Element
import vdberg.rules.advice.AccidentManagementAdvice
import vdberg.rules.advice.IncidentManagementAdvice
import vdberg.rules.advice.AdviceSender
 
rule "CheckAccident"
      when 
            situation: Situation(actionNeeded == true )
            eval(  (( Element )
situation.getElements().get(0)).getDataObjectCode().equalsIgnoreCase("AC
C")  )
      then 
            String id1 = " warn all emergency organisations";
            String alarm = "Accident";
            AccidentManagementAdvice advice = new
AccidentManagementAdvice(alarm, id1, situation);
            AdviceSender.sendAdvice( advice ); 
End
 
Leo van den Berg
University of Valencia 
Spain
 
P.S. The application works great (with the second package statement), I
can add and change all kind of traffic situations changing only the rule
file, it's great to use Drools, Thanks!
 
 
 
etc..

Reply via email to