[jboss-jira] [JBoss JIRA] Updated: (JBRULES-1044) dialect appears to be a reserved keyword, not allowed in package name
christopher barham (JIRA)
jira-events at lists.jboss.org
Mon Jul 30 00:34:52 EDT 2007
[ http://jira.jboss.com/jira/browse/JBRULES-1044?page=all ]
christopher barham updated JBRULES-1044:
----------------------------------------
Similar issue on import in the DRL file...
Example Rule:
package com.sample
import com.dialect.rules.DroolsTest.Message;
rule "Hello World"
when
m : Message( status == Message.HELLO, message : message )
then
System.out.println( message );
m.setMessage( "Goodbye cruel world" );
m.setStatus( Message.GOODBYE );
update( m );
end
rule "GoodBye"
no-loop true
when
m : Message( status == Message.GOODBYE, message : message )
then
System.out.println( message );
m.setMessage( message );
end
gives stack trace:
org.drools.rule.InvalidRulePackage: [3,11]: unknown:3:11 mismatched token '[@10,31:37='dialect',<32>,3:11]' expecting set nullorg.drools.compiler.ImportError at 1bc4459
at org.drools.rule.Package.checkValidity(Package.java:408)
at org.drools.common.AbstractRuleBase.addPackage(AbstractRuleBase.java:288)
at com.dialect.rules.DroolsTest.readRule(DroolsTest.java:63)
at com.dialect.rules.DroolsTest.main(DroolsTest.java:21)
> dialect appears to be a reserved keyword, not allowed in package name
> ---------------------------------------------------------------------
>
> Key: JBRULES-1044
> URL: http://jira.jboss.com/jira/browse/JBRULES-1044
> Project: JBoss Rules
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Drl Parser/Builder
> Affects Versions: 4.0.0.GA
> Environment: Sun Java build 1.6.0_01-b06, Windows XP SP2, Eclipse 3.3, Jboss Rules Eclipse IDE 4.0
> Reporter: christopher barham
> Assigned To: Mark Proctor
>
> Although not mentioned in the Online documentation, it appears Dialect is now a reserved word, the Eclipse IDE highlights this in a rule. Changing the (Eclipse generated) sample project to be in package com.dialect.rules instead of com.sample results in the stack trace below. This is a problem as my company is called Dialect so all my pacakges have the word in there :-) :
> org.drools.compiler.DroolsParserException: Unknown error while parsing. This is a bug. Please contact the Development team.
> at org.drools.compiler.DrlParser.compile(DrlParser.java:180)
> at org.drools.compiler.DrlParser.parse(DrlParser.java:61)
> at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:158)
> at com.sample.DroolsTest.readRule(DroolsTest.java:54)
> at com.sample.DroolsTest.main(DroolsTest.java:21)
> The example rule is:
> package com.dialect.rules
> import com.sample.DroolsTest.Message;
> rule "Hello World"
> when
> m : Message( status == Message.HELLO, message : message )
> then
> System.out.println( message );
> m.setMessage( "Goodbye cruel world" );
> m.setStatus( Message.GOODBYE );
> update( m );
> end
> rule "GoodBye"
> no-loop true
> when
> m : Message( status == Message.GOODBYE, message : message )
> then
> System.out.println( message );
> m.setMessage( message );
> end
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list