[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
14 years, 7 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
14 years, 7 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
14 years, 7 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
14 years, 7 months
[JBoss JIRA] Created: (JBRULES-3061) Compiler error on 5.2.0.CR1. Worked on 5.0.1
by Joe White (JIRA)
Compiler error on 5.2.0.CR1. Worked on 5.0.1
--------------------------------------------
Key: JBRULES-3061
URL: https://issues.jboss.org/browse/JBRULES-3061
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler
Affects Versions: 5.2.0.CR1
Environment: Java 5. Windows. Drools Master branch
Reporter: Joe White
Assignee: Mark Proctor
The test below can be added directly to MiscTest in drools-compiler and run to reproduce the problem. The exception that occurs is pasted below the rule. If there is only one check in the Person object then the rule will compile, but adding in the part with "|| status != $inStatus" causes the exception.
######################TEST#################################
@Test
public void testMapVarCompare() {
//
String str = "";
str += "package org.drools\n";
str += "import org.drools.Person\n";
str += "import java.util.Map\n";
str += "import java.util.List\n";
str += "rule rule1 \n";
str += "when\n";
str += " $listOfMaps : List()\n";
str += " Map($inName : this['name'], $inStatus : this['STATUS']) from $listOfMaps\n";
str += " Person( name != $inName || status != $inStatus)\n";
str += "then\n";
str += "end\n";
try {
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add( ResourceFactory.newByteArrayResource( str.getBytes() ),
ResourceType.DRL );
if ( kbuilder.hasErrors() ) {
System.out.println(kbuilder.getErrors());
fail( "KnowledgeBuilder should not have errors" );
}
} catch ( Exception e ) {
e.printStackTrace();
fail( "Exception should not be thrown " );
}
}
################################EXCEPTION##################################################
Unable to build expression for 'inline-eval' : [Error: incompatible types in statement: class java.lang.Object (compared from: class java.lang.String)]
[Near : {... name != $inName || status != $ ....}]
^
[Line: 1, Column: 1]'name != $inName || status != $inStatus'
[Error: incompatible types in statement: class java.lang.Object (compared from: class java.lang.String)]
[Near : {... name != $inName || status != $ ....}]
^
[Line: 1, Column: 1] : [Rule name='rule1']
[Error: incompatible types in statement: class java.lang.Object (compared from: class java.lang.String)]
[Near : {... name != $inName || status != $ ....}]
^
[Line: 1, Column: 1]
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBRULES-3053) Include jbpm-persistence-jpa.jar into distribution
by Tomáš Schlosser (JIRA)
Include jbpm-persistence-jpa.jar into distribution
--------------------------------------------------
Key: JBRULES-3053
URL: https://issues.jboss.org/browse/JBRULES-3053
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.2.0.M2
Reporter: Tomáš Schlosser
Assignee: Mark Proctor
If jbpm-persistence-jpa.jar is not on classpath, following exceptionis thrown:
Exception in thread "main" java.lang.IllegalStateException: java.lang.reflect.InvocationTargetException
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:130)
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newStatefulKnowledgeSession(KnowledgeStoreServiceImpl.java:54)
at org.drools.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:109)
at org.sample.Test.main(Test.java:48)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommanService(KnowledgeStoreServiceImpl.java:116)
... 3 more
Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Unable to load class: org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory
at org.jbpm.process.instance.ProcessRuntimeImpl.loadClass(ProcessRuntimeImpl.java:97)
at org.jbpm.process.instance.ProcessRuntimeImpl.initProcessInstanceManager(ProcessRuntimeImpl.java:71)
at org.jbpm.process.instance.ProcessRuntimeImpl.<init>(ProcessRuntimeImpl.java:60)
at org.jbpm.process.instance.ProcessRuntimeFactoryServiceImpl.newProcessRuntime(ProcessRuntimeFactoryServiceImpl.java:10)
at org.jbpm.process.instance.ProcessRuntimeFactoryServiceImpl.newProcessRuntime(ProcessRuntimeFactoryServiceImpl.java:6)
at org.drools.runtime.process.ProcessRuntimeFactory.newProcessRuntime(ProcessRuntimeFactory.java:12)
at org.drools.common.AbstractWorkingMemory.createProcessRuntime(AbstractWorkingMemory.java:359)
at org.drools.common.AbstractWorkingMemory.setKnowledgeRuntime(AbstractWorkingMemory.java:1260)
at org.drools.impl.StatefulKnowledgeSessionImpl.<init>(StatefulKnowledgeSessionImpl.java:116)
at org.drools.impl.StatefulKnowledgeSessionImpl.<init>(StatefulKnowledgeSessionImpl.java:110)
at org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:372)
at org.drools.reteoo.ReteooRuleBase.newStatefulSession(ReteooRuleBase.java:352)
at org.drools.impl.KnowledgeBaseImpl.newStatefulKnowledgeSession(KnowledgeBaseImpl.java:175)
at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:101)
... 8 more
Caused by: java.lang.ClassNotFoundException: Unable to load class: org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory
at org.drools.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:92)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at org.jbpm.process.instance.ProcessRuntimeImpl.loadClass(ProcessRuntimeImpl.java:95)
... 21 more
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBRULES-3108) problems with concurrent process executions, constraints, and multiple sessions
by Jordi Alvarez (JIRA)
problems with concurrent process executions, constraints, and multiple sessions
-------------------------------------------------------------------------------
Key: JBRULES-3108
URL: https://issues.jboss.org/browse/JBRULES-3108
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (flow)
Affects Versions: 5.2.0.Final, 5.1.1.FINAL
Environment: Independent of OS, JVM, and Application Server. Reproduced in a windows development environment with a Sun JVM. Also reproduced in linux. Also database independent: reproduced with Oracle RDBMS and HSQLDB.
Reporter: Jordi Alvarez
Assignee: Mark Proctor
The context is as follows:
1. We have drools flow configured with JPA and Hibernate, accessing an Oracle / HSQLDB database (depending on the environment).
2. We do have several concurrent stateful sessions in which different instances of the same kind of processes are running. These stateful sessions are persisted in the same database schema.
3. We do use wait states (also reproduced with rule nodes) that have constraints that wait for a fact to be inserted into the stateful session.
4. Whenever the fact that makes the constraint to satisfy is inserted for one process in a given stateful session; if there are other processes waiting in that wait state/constraint (in other different stateful sessions), the stateful session tries also to continue those process executions, even when they are not part of it.
A solution has been implemented temporally over drools source code (in order to get our context working): the solution is briefly described in the forum url below. For completeness a summary is included here:
- Adding a new attribute to org.drools.persistence.processinstance.ProcessInstanceInfo POJO identifying the stateful session to which the process instance corresponds (and the corresponding DB column).
- modifying the ProcessInstancesWaitingForEvent query (in orm.xml) in order to take into account the session id as a (new) second parameter.
- modify the class org.drools.persistence.processinstance.JPASignalManager in order to execute the query with both parameters.
- as a quick way to have the session id, we have a threadlocal.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months