[rules-users] Unexpected Token Exception

Rajesh.Sachin10 rajesh_sachin10 at yahoo.co.in
Thu May 31 16:58:23 EDT 2007


I got the following exception when I tried to run the drl file rule.

org.drools.rule.InvalidRulePackage: unknown:13:37 mismatched token:
[@79,307:308='&&',<55>,13:37]; expecting type ')'
unknown:13:81 Unexpected token ')'

	at org.drools.rule.Package.checkValidity(Unknown Source)
	at org.drools.common.AbstractRuleBase.addPackage(Unknown Source)
	at com.sample.DroolsTest.main(DroolsTest.java:47)


Rule:

package com.policy;
#expander Ex1.dsl;
#list any import classes here.
#import java.util.HashMap;
import java.util.Iterator;
import com.examples.Student;
import com.examples.Module;
#declare any global variables here
global java.util.List errorlist;

rule "Ex1"
    when
        exists( $student : Student() && Module( student == $student, score <
40 ))
    then
    	System.out.println("fierd");
end


Files:
Class 1:

package com.examples;


public class Student {
	private String name;
    private Object[] modules;
	public Object[] getModules() {
		return modules;
	}
	public void setModules(Object[] modules) {
		this.modules = modules;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}

}




class 2:

package com.examples;

public class Module {
    private String name;
    private String studentName;
    private int score;
    
    public Module(String name, int score){
    	this.setName(name);
    	this.setScore(score);
    }
    
    
	public String getName() {
		return name;
	}
	public void setName(String name) {
		
		this.name = name;
	}
	public int getScore() {
		return score;
	}
	public void setScore(int score) {
		this.score = score;
	}
	public String getStudentName() {
		return studentName;
	}
	public void setStudentName(String studentName) {
		this.studentName = studentName;
	}
}


Anyone have any idea about it


-- 
View this message in context: http://www.nabble.com/Unexpected-Token-Exception-tf3848843.html#a10901896
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list