[JBoss JIRA] Created: (JBRULES-3001) Free form expression constraints: unexpected execution result; unexpected failure to compile
by Wolfgang Laun (JIRA)
Free form expression constraints: unexpected execution result; unexpected failure to compile
---------------------------------------------------------------------------------------------
Key: JBRULES-3001
URL: https://issues.jboss.org/browse/JBRULES-3001
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.CR1
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Given
public class Customer {
int custid;
//...
}
The following rule always fires, for any value of custid.
rule "articles of a customer"
when
$c: Customer( 150 <= custid <= 250 ) returns true
then
System.out.println( "Customer1 " + $c.getCustid() );
end
But the constraint
$c: Customer( 100 <= custid )
is refused by the compiler:
Unable to build constraint as '100' is invalid : [Rule name='articles of a customer']
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[JBoss JIRA] Created: (JBRULES-2986) Confusing error reporting due to incomplete constraint
by Wolfgang Laun (JIRA)
Confusing error reporting due to incomplete constraint
------------------------------------------------------
Key: JBRULES-2986
URL: https://issues.jboss.org/browse/JBRULES-2986
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.CR1
Reporter: Wolfgang Laun
Assignee: Mark Proctor
declare Article
artid : int;
artname : String;
custid : int;
end
declare Customer
custid : int
end
rule "articles of a customer"
when
$c: Customer( $custid: custid )
$a: Article( $artid, artname == ("mou" + "se"), $custid : custid == $custid )
then
end
Produces many error messages (see below), where line number 1 and column numnber 1 are incorrect.
Expect: only one error message, with correct line number.
====================================================================
Unable to Analyse Expression $artid:
[Error: Failed to compile: 2 compilation error(s):
- (1,1) unable to resolve method using strict-mode: ex50.Article.$artid()
- (1,1) unqualified type in strict mode for: $artid]
[Near : {... $artid ....}]
^
[Line: 1, Column: 1] : [Rule name='articles of a customer']
Rule Compilation error : [Rule name='articles of a customer']
ex50/Rule_articles_of_a_customer_0.java (14:690) : $artid cannot be resolved
====================================================================
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[JBoss JIRA] Created: (JBRULES-2987) Literal expression not possible in constraint
by Wolfgang Laun (JIRA)
Literal expression not possible in constraint
---------------------------------------------
Key: JBRULES-2987
URL: https://issues.jboss.org/browse/JBRULES-2987
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 3.0-beta3
Reporter: Wolfgang Laun
Assignee: Mark Proctor
declare Article
artid : int;
artname : String;
custid : int;
end
declare Customer
custid : int
endrule "articles of a customer"
when
$c: Customer( $custid: custid )
$a: Article( $artid: artid, artname == "mou" + "se", $custid : custid == $custid )
then
end
This produces the (misleading) error message below, but should work according to Mark Proctor.
Notice that artname == ("mou" + "se") works correctly.
Unable to return Declaration for identifier '"mou" + "se"' : [Rule name='articles of a customer']
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[JBoss JIRA] Created: (JBRULES-2878) NPE due to session.update with 1 or 2 invalid operands
by Wolfgang Laun (JIRA)
NPE due to session.update with 1 or 2 invalid operands
------------------------------------------------------
Key: JBRULES-2878
URL: https://issues.jboss.org/browse/JBRULES-2878
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.1.1.FINAL
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Counter counter = new Counter( initial );
this.session.insert( counter );
And now each of these calls
session.update( session.getFactHandle( null ), null );
session.update( session.getFactHandle( counter ), null );
session.update( session.getFactHandle( null ), counter );
results in a NPE
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.drools.common.ObjectTypeConfigurationRegistry.getObjectTypeConf(ObjectTypeConfigurationRegistry.java:58)
at org.drools.common.NamedEntryPoint.update(NamedEntryPoint.java:382)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:981)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:954)
at org.drools.impl.StatefulKnowledgeSessionImpl.update(StatefulKnowledgeSessionImpl.java:266)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[JBoss JIRA] Created: (JBRULES-3002) Invalid comparison operator (=) causes EmptyStackException in DRLParser/ParserHelper
by Wolfgang Laun (JIRA)
Invalid comparison operator (=) causes EmptyStackException in DRLParser/ParserHelper
------------------------------------------------------------------------------------
Key: JBRULES-3002
URL: https://issues.jboss.org/browse/JBRULES-3002
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.2.0.M2
Reporter: Wolfgang Laun
Assignee: Mark Proctor
class Customer {
int custid; //...
}
rule x
when
$c: Customer( custid = 100 ) // Typo, wanted: "=="
then end
[0,0]: Line 47:0 unexpected exception at input 'rule'. Exception: java.util.EmptyStackException. Stack trace:
java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:102)
at java.util.Stack.pop(Stack.java:84)
at org.drools.lang.ParserHelper.popParaphrases(ParserHelper.java:409)
at org.drools.lang.ParserHelper.end(ParserHelper.java:723)
at org.drools.lang.DRLParser.rule(DRLParser.java:915)
at org.drools.lang.DRLParser.statement(DRLParser.java:248)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:143)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:292)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:471)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months
[JBoss JIRA] Created: (JBRULES-2761) Restriction operator parameters should be strings, not token sequences
by Wolfgang Laun (JIRA)
Restriction operator parameters should be strings, not token sequences
----------------------------------------------------------------------
Key: JBRULES-2761
URL: https://jira.jboss.org/browse/JBRULES-2761
Project: Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Reporter: Wolfgang Laun
Assignee: Mark Proctor
User defined operators (similar to "matches" or the temporal ops) may have parameters, written in '[' and ']' after the identifier denoting the relational operator. Text between the brackets is currently parsed as a "chunk", requiring the text to be composed from tokens recognized by the lexer. This is too restrictive since all Unicode characters that aren't letters (and this part of an identifier) are simply dropped.
It should be simple to parse the text between '[' and ']' as a special form of recursive string, with brackets as delimiters. This means that op[foo[1]] is OK, but op{bar[[] is not.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 3 months