[JBoss JIRA] Created: (JBRULES-2989) Slotted/named syntax for bindings silently accepted as positional argument
by Wolfgang Laun (JIRA)
Slotted/named syntax for bindings silently accepted as positional argument
--------------------------------------------------------------------------
Key: JBRULES-2989
URL: https://issues.jboss.org/browse/JBRULES-2989
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
rule "articles of a customer"
when
$a: Article( $artid: artid, $artname: artname, $custid : custid ; ) ### semicolon here! ###
then
System.out.println( "Art " + $artid + " " + $a.getArtname() + " by " + $custid );
end
This is accepeted by the compiler without error indication, but preceding a semicolon only positional argument should be permitted.
Expect: an error message, compilation failure.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[JBoss JIRA] Created: (JBRULES-2956) Runtime error when using non-boolean expression as a constraint
by Wolfgang Laun (JIRA)
Runtime error when using non-boolean expression as a constraint
---------------------------------------------------------------
Key: JBRULES-2956
URL: https://issues.jboss.org/browse/JBRULES-2956
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler
Affects Versions: 5.2.0.M2
Reporter: Wolfgang Laun
Assignee: Mark Proctor
declare Num
num : Integer
even : boolean
end
rule start
when
then
insert( new Num( 42, true ) );
end
rule sumem
when
$n: Num( num, num + 1, eval(num + 1) )
then
end
All of these constraints result in a RUNTIME error ar java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean org.drools.base.mvel.MVELPredicateExpression.evaluate(MVELPredicateExpression.java:97)
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[JBoss JIRA] Created: (JBRULES-2801) Entry-point defaults for type, rule, package
by Wolfgang Laun (JIRA)
Entry-point defaults for type, rule, package
--------------------------------------------
Key: JBRULES-2801
URL: https://jira.jboss.org/browse/JBRULES-2801
Project: Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Implement the definition of the default entry point for an Event or Fact type via a metadata attribute, e.g.:
declare X
@role( event )
@entry-point( y )
end
so that this
a) declares the entry-point in the KnowledgeBase (the same way from entry-point "x" does)
b) removes the need to use from entry-point with all patterns referring to X
c) would still let me override the entry point with a "from entry-point" clause.
The same attribute can be used inside a rule, where it is associated with all fact patterns without an explicit entry point. Here it also overrides an entry-point declared with the type's declare, if any.
Since all rule attributes may also be used at package level (outside rules), this includes the new entry-point attribute. It will then be honoured in rules according to the current strategy for all other rule attributes.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 1 month
[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, 1 month
[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, 1 month
[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, 1 month
[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, 1 month
[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, 1 month