[rules-users] Compilation Error in Drools

McShiv rajesh_sachin10 at yahoo.co.in
Thu Jul 12 17:42:08 EDT 2007


Hi All,

    I used the following code in the dsl file. 

DSL:

    [when] Check whether the name is present as "{studName}" = $stud :
Student(name = "{studName}");
    [then] Set the Error Code {errorCode} = String string = $stud.getName();
Error(errorCode, string);

DRL:

    package com.policy;
    expander StudendProgram.dsl;
    import java.util.Iterator;
    import com.class.Student;
    import com.class.Error;

   rule "StudendProgram_1"
   
	when
		Check whether the name is present as "Stephen" 
	then
		Set the Error Code 88
    end


When I try to run this program I got the following error.

   Caused by: org.drools.rule.InvalidRulePackage: Rule Compilation error
File com/policy/Rule_SpeCodeSpeValProdPlan12_0.java, Line 12, Column 176:
Unexpected token "." in primary 

When I remove the Line "$stud.getName();" in the then part and set the error
code alone its working fine. The "." inbetween $stud and getName() may be
the problem. But I don't know the solution for this. 

Any suggessions on this.

Thanks,
McShiv....
-- 
View this message in context: http://www.nabble.com/Compilation-Error-in-Drools-tf4071029.html#a11569413
Sent from the drools - user mailing list archive at Nabble.com.




More information about the rules-users mailing list