Hi Edson,
love this one – (!) a marvellous case of To See and See Not ;-)
Lindy copy-pasted the Vote.drl from the cited HTML page which must have been run over by some text processor which promptly converted space surrounded hyphens into an EN DASH, codepoint 0x2013 = 8211.
-W
Ok, it is clearly complaining about the "-" in your rule name. The odd thing is that "-" is allowed in rule names, so what is different about your setup?
* did you enabled to code dump to disk?
* what compiler are you using? JDT or Janino? what version?
* what operating system are you using?
* what JVM and java compiler are you using?
[]s
Edson2009/8/25 Lindy hagan <lindyhagan@gmail.com>
_______________________________________________Getting below error for each and every rule in Vote.drl . Using Drools 5 and eclipse 3.4.Trying this exampleRule Compilation error : [Rule name='VeryGoodValue – between 6-9']
com/examples/Rule_VeryGoodValue_–_between_6_9_0.java (3:79) : Syntax error on tokens, delete these tokens
com/examples/Rule_VeryGoodValue_–_between_6_9_0.java (3:92) : The public type Rule_VeryGoodValue_ must be defined in its own file
com/examples/Rule_VeryGoodValue_–_between_6_9_0.java (3:127) : Syntax error, insert "}" to complete Block
com/examples/Rule_VeryGoodValue_–_between_6_9_0.java (4:134) : Syntax error on tokens, delete these tokens
com/examples/Rule_VeryGoodValue_–_between_6_9_0.java (6:202) : Syntax error on token "void", @ expected
com/examples/Rule_VeryGoodValue_–_between_6_9_0.java (6:234) : Syntax error on token "KnowledgeHelper", ( expected after this token
com/examples/Rule_VeryGoodValue_–_between_6_9_0.java (6:284) : Syntax error on token "m", delete this token
com/examples/Rule_VeryGoodValue_–_between_6_9_0.java (6:287) : Syntax error on token(s), misplaced construct(s)
com/examples/Rule_VeryGoodValue_–_between_6_9_0.java (6:309) : Syntax error, insert ")" to complete MethodInvocation
com/examples/Rule_VeryGoodValue_–_between_6_9_0.java (6:309) : Syntax error, insert ")" to complete SingleMemberAnnotation
com/examples/Rule_VeryGoodValue_–_between_6_9_0.java (6:309) : Syntax error, insert "enum Identifier" to complete EnumHeaderName
com/examples/Rule_VeryGoodValue_–_between_6_9_0.java (6:309) : Syntax error, insert "EnumBody" to complete EnumDeclaration
Vote.drlpackage com.examples
import com.examples.drools.Vote;
rule "WrongValue – less than 0"
when
m : Vote( average < 0.0, vote : vote )
then
m.setAverage(0.0f);
update( m );
end
rule "WrongValue – bigger than 10"
when
m : Vote( average > 10.0, vote : vote )
then
m.setAverage(10.0f);
update( m );
end
rule "BadValue – between 0-3"
when
m : Vote( average >= 0.0 && average <=3.0, vote : vote )
then
m.setVote("Bad!");
System.out.println( m.getVote() );
end
rule "GoodValue – between 3-6"
when
m : Vote( average >3.0 && average <=6.0, vote : vote )
then
m.setVote("Good!");
System.out.println( m.getVote() );
end
rule "VeryGoodValue – between 6-9"
when
m : Vote( average >6.0 && average <=9.0, vote : vote )
then
m.setVote("Very Good!");
System.out.println( m.getVote() );
end
rule "ExcellentValue – between 9-10"
when
m : Vote( average >9.0 && average <=10.0, vote : vote )
then
m.setVote("Excellent!");
System.out.println( m.getVote() );
end
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users