[JBoss JIRA] Created: (JBRULES-2296) Infinite loop in OutputMarshaller
by Maciej Prochniak (JIRA)
Infinite loop in OutputMarshaller
---------------------------------
Key: JBRULES-2296
URL: https://jira.jboss.org/jira/browse/JBRULES-2296
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core, drools-core (expert)
Affects Versions: 5.1.0.M1
Reporter: Maciej Prochniak
Assignee: Mark Proctor
in OutputMarshaller, there are 2 lines containing:
for ( LeftTuple childLeftTuple = getLeftTuple( leftTuple.getBetaChildren() ); childLeftTuple != null; childLeftTuple = (LeftTuple) leftTuple.getLeftParentPrevious() ) {
it leads to infinite loop, should be:
for ( LeftTuple childLeftTuple = getLeftTuple( leftTuple.getBetaChildren() ); childLeftTuple != null; childLeftTuple = (LeftTuple) childLeftTuple.getLeftParentPrevious() ) {
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2265) running default "Hello" Drools Project
by shashank singh (JIRA)
running default "Hello" Drools Project
--------------------------------------
Key: JBRULES-2265
URL: https://jira.jboss.org/jira/browse/JBRULES-2265
Project: Drools
Issue Type: Task
Security Level: Public (Everyone can see)
Reporter: shashank singh
Assignee: Mark Proctor
In set up eclipse 3.5 as given on "http://www.jboss.org/tools/download" under "JBoss Tools 3.1 :: Eclipse 3.5.0"
Now when I am trying to set up a hello Drools Project I am getting this error
org.drools.RuntimeDroolsException: Unable to load dialect 'org.drools.rule.builder.dialect.java.Java
DialectConfiguration:java:org.drools.rule.builder.dialect.java.JavaDialectConfiguration'
at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:274)
at org.drools.compiler.PackageBuilderConfiguration.buildDialectConfigurationMap(PackageBuilderConfi
guration.java:259)
at org.drools.compiler.PackageBuilderConfiguration.init(PackageBuilderConfiguration.java:176)
at org.drools.compiler.PackageBuilderConfiguration.<init>(PackageBuilderConfiguration.java:153)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:242)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:142)
at org.drools.builder.impl.KnowledgeBuilderProviderImpl.newKnowledgeBuilder(KnowledgeBuilderProvide
rImpl.java:29)
at org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:29)
at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:39)
at com.sample.DroolsTest.main(DroolsTest.java:23)
Caused by: java.lang.RuntimeException: The Eclipse JDT Core jar is not in the classpath
at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.setCompiler(JavaDialectConfigurati
on.java:94)
at org.drools.rule.builder.dialect.java.JavaDialectConfiguration.init(JavaDialectConfiguration.java
:55)
at org.drools.compiler.PackageBuilderConfiguration.addDialect(PackageBuilderConfiguration.java:270)
... 9 more
I would like to mention that while creating this application I added a DroolsRumtime and set it to C:\drools folder. But no jar was placed in that folder. I manually copied jars there. The jars that I copied are
drools-all-jdk5-2.1.jar
drools-ant-5.0.1.jar
drools-api-5.0.1.jar
drools-bam-5.0.1.jar
drools-clips-5.0.1.jar
drools-compiler-5.0.1.jar
drools-core-5.0.1.jar
drools-decisiontables-5.0.1.jar
drools-jsr94-5.0.1.jar
drools-mc-5.0.1.jar
drools-messenger-jms-5.0.1.jar
drools-persistence-jpa-5.0.1.jar
drools-process-task-5.0.1.jar
drools-templates-5.0.1.jar
drools-transformer-jaxb-5.0.1.jar
drools-transformer-jxls-5.0.1.jar
drools-verifier-5.0.1.jar
drools-workitems-5.0.1.jar
I am unable to make it is
IS installing JBoss Tools 3.0 or 3.1 means we are doing it for Drools4.0 or Drools5.0. And what is the dependency in this regard as such.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2493) Drools does not make use of the PropertyChangeListeners on my objects
by Tamas Cserveny (JIRA)
Drools does not make use of the PropertyChangeListeners on my objects
---------------------------------------------------------------------
Key: JBRULES-2493
URL: https://jira.jboss.org/jira/browse/JBRULES-2493
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.0.1.FINAL
Environment: Eclipse RCP
Reporter: Tamas Cserveny
Assignee: Mark Proctor
Hi,
I've asserted an object with the relevant add and remove methods for the change support, but drools did not subscribe to property changes.
I've used StatefulKnowledgeSession's insert method for this.
After some minutes it turned out, that the insert method delegates the call to the ReteooWorkingMemory with dynamic property set to false.
It might be that this is the reason why they were not picked up.
Cheers,
Tamas
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2484) Unsupported brackets in right operator
by Jeremy Ary (JIRA)
Unsupported brackets in right operator
--------------------------------------
Key: JBRULES-2484
URL: https://jira.jboss.org/jira/browse/JBRULES-2484
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.1.0.M1, 5.0.1.FINAL
Reporter: Jeremy Ary
Assignee: Mark Proctor
Class QueueList has two properties:
private QueueIds idList; //QueueIds just extends HashMap<String, Integer>
private Collection<Integer> queueIds;
rule "testing"
when
QueueList ( queueIds contains idList["ABC"] )
then
System.out.println("testing fired");
end
Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1938)
at org.drools.rule.builder.PatternBuilder.buildRestriction(PatternBuilder.java:888)
at org.drools.rule.builder.PatternBuilder.buildRestriction(PatternBuilder.java:717)
at org.drools.rule.builder.PatternBuilder.createRestriction(PatternBuilder.java:504)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:351)
at org.drools.rule.builder.PatternBuilder.buildConstraint(PatternBuilder.java:239)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:196)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:104)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:68)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1159)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:649)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:290)
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:488)
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)
at com.sample.DroolsTest.createKnowledgeBase(DroolsTest.java:47)
at com.sample.DroolsTest.main(DroolsTest.java:19)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2332) Drools JPA- Spring Transactions
by Pradeep Thomas (JIRA)
Drools JPA- Spring Transactions
-------------------------------
Key: JBRULES-2332
URL: https://jira.jboss.org/jira/browse/JBRULES-2332
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.0.1.FINAL
Environment: Java (1.6)
Spring framework (2.5.6)
Hibernate (3.3.2.GA)
Drools (5.0.1) Using Expert and Flow parts.
Oracle (11g)
Reporter: Pradeep Thomas
Assignee: Mark Proctor
What we do
We have a domain model. It is made up of a number of objects annotated with JPA annotations (for persistence) with Hibernate as the ORM provider.
The drools JPA persistence module is also made of java classes annotated for persistence.
We're trying to create a stateful session and start a process. Process stops in a waiting state at some point. Then we want to persist the session together with the process state. Application needs to be able to load the session back into memory and continue with the process execution (by sending notify events).
Issues
First issue
The first issue we faced was that the drools persistence module does not work out of box for Oracle.
Cause: Table/column names too long,
Fix: This was sorted by overrides to the annotations in the drools-jpa source code.
Current issue
The issues that we are currently facing are related to transactions/JPA entity manager and persisting of Session/Process/Workitem etc.
The expected transactional/persistence behaviour is
------- Begin Transaction (triggered by Spring's transactional annotation that also creates the entity manager)
1) Persist/Read domain entities from datasource
2) Persist/Read drools entities from same datasource
-------End Transaction (commit/rollback releases the entity manager)
The expected behaviour is without the use of a distributed transaction manager (because we have a single datasource and no distributed transactions)
It seems like the persistence module out of the box in drools-jpa relies on a Distributed transaction manager (DTM) and in the absence of one (configured by us) uses Bitronix (an built-in DTM)
The use of Bitronix further complicates matters as its not related to the transaction/entity manager created by Spring and visibility of domain entities/drools entities have of each other.
The way we would like to use drools persistence is:
a) Entities (drools/domain) to be managed by the same entity manager (persisted/read) for both Domain model entities and Drools JPA entities.
b) Participate in the same (RESOURCE_LOCAL) transaction (committed/rolled back)
c) Eliminate the need for a DTM if there is a single datasource
Question : is there anything we're doing is incorrect or is the described behaviour not available in the current version?
Any advice would be appreciated.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2316) StringIndexOutOfBoundsException when a fact is in default package
by Renaud Julienne (JIRA)
StringIndexOutOfBoundsException when a fact is in default package
-----------------------------------------------------------------
Key: JBRULES-2316
URL: https://jira.jboss.org/jira/browse/JBRULES-2316
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 4.0.7
Reporter: Renaud Julienne
Assignee: Mark Proctor
Assuming you have a rule base for which you have defined shadow proxy excludes.
If you insert a fact which class is in default package, a StringIndexOutOfBoundsException is raised by RuleBaseConfiguration#isShadowed()
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1768)
at org.drools.RuleBaseConfiguration.isShadowed(RuleBaseConfiguration.java:546)
at org.drools.reteoo.Rete$ClassObjectTypeConf.defineShadowProxyData(Rete.java:486)
at org.drools.reteoo.Rete$ClassObjectTypeConf.<init>(Rete.java:468)
at org.drools.reteoo.Rete.assertObject(Rete.java:152)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
at org.drools.reteoo.ReteooWorkingMemory.doInsert(ReteooWorkingMemory.java:71)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:911)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:883)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:704)
..........
Problem comes from this line (RuleBaseConfiguration.java:546):
String qualifiedNamespace = className.substring( 0,
className.lastIndexOf( '.' ) ).trim(); // => default package => no '.' => exception
This can typically happen when trying to insert JDKProxies into the working memory for test purpose (EasyMock use such proxies).
The issue only appears if you have defined shadow proxy excludes.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2315) DroolsMVELFactory leaks memory in previousDeclarationsObjectCache field using "from" DRL construct
by Kurt Westerfeld (JIRA)
DroolsMVELFactory leaks memory in previousDeclarationsObjectCache field using "from" DRL construct
--------------------------------------------------------------------------------------------------
Key: JBRULES-2315
URL: https://jira.jboss.org/jira/browse/JBRULES-2315
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.0.1.FINAL
Environment: Windows/any
Reporter: Kurt Westerfeld
Assignee: Mark Proctor
When using the DRL construct to extract variables using a "from" clause, a FromNode is created which extracts data using an instance of DroolsMVELFactory paired with MVELDataProvider. After processing of rule agenda items, many of these nodes can exist and hold onto memory due to the snapshot of data processed during DroolsMVELFactory.setContext(), called from MVELDataProvider.getResults(). The snapshotting of state is held in (HashMap) previousDeclarationsObjectCache of DroolsMVELFactory.
Suggest that during MVELDataProvider.getResults() call clear on the DroolsMVELFactory after obtaining the results. The clear method could clear out previousDeclarationsObjectCache, which is used during the processing of the MVEL expression.
In my application, much data held from these nodes kept instances of data in memory, even though the data was never asserted into working memory.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2226) Creating custom ConsequenceExceptionHandler with application restart
by Uros Majeric (JIRA)
Creating custom ConsequenceExceptionHandler with application restart
--------------------------------------------------------------------
Key: JBRULES-2226
URL: https://jira.jboss.org/jira/browse/JBRULES-2226
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-api
Affects Versions: 5.0.1.FINAL
Environment: JBoss AS 5.1
Drools 5.0.1
JBoss ESB 4.6
Reporter: Uros Majeric
Assignee: Mark Proctor
I have a JBoss ESB and in it I have created my custom ConsequenceExceptionHandler. When I deploy the esb everything is ok. When I redeploy the application, deployment goes fine. But when my application get an error (exception), my custom exception handler should catch the exception (in method handleException(Activation activation, WorkingMemory workingMemory, Exception exception)), but instead of catching the exception get an error:
java.lang.RuntimeException: Unable to instantiate object for class 'si.aditus.drools.CustomConsequenceExceptionHandler'
My custom Exception Handler:
public class CustomConsequenceExceptionHandler implements ConsequenceExceptionHandler {
public void handleException(Activation activation, WorkingMemory workingMemory, Exception exception) {
if (!(exception instanceof MyException || exception instanceof OtherException)) {
System.err.println(exception.getClass());
exception.printStackTrace();
return;
}
System.out.println("exceptions: "+exception);
}
}
Knowledge Base instantiation:
KnowledgeBaseConfiguration kbc = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
((RuleBaseConfiguration)kbc).setConsequenceExceptionHandler(CustomConsequenceExceptionHandler.class.getName());
KnowledgeBase kbase = KnowledgeBaseFactory.newKnowledgeBase(kbc);
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2147) NullPointerException in org.drools.rule.builder.PatternBuilder.getDeclarationsMap()
by Juergen none (JIRA)
NullPointerException in org.drools.rule.builder.PatternBuilder.getDeclarationsMap()
-----------------------------------------------------------------------------------
Key: JBRULES-2147
URL: https://jira.jboss.org/jira/browse/JBRULES-2147
Project: JBoss Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: drools-compiler (expert)
Affects Versions: 5.0.1.FINAL
Environment: java 1.5, linux x64, jboss 4.0.5
Reporter: Juergen none
Assignee: Mark Proctor
I understand my rules/fact objects might not be proper (still searching), but resulting in a NullPointerException is not proper as well
entry.getValue().getExtractor().getExtractToClass() yields NullPointerException, because entry.getValue().getExtractor() is null
eclipse debug variable:
value org.drools.rule.Declaration (id=502)
identifier "schoolForm" (id=501)
internalFact false
pattern org.drools.rule.Pattern (id=508)
behaviors null
constraints java.util.ArrayList<E> (id=520)
declaration org.drools.rule.Declaration (id=521)
declarations java.util.HashMap<K,V> (id=522)
index 1
objectType org.drools.base.ClassObjectType (id=524)
offset 0
source null
readAccessor null
Stacktrace:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
...
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NullPointerException
at org.drools.rule.builder.PatternBuilder.getDeclarationsMap(PatternBuilder.java:641)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:574)
at org.drools.rule.builder.PatternBuilder.buildConstraint(PatternBuilder.java:244)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:196)
at org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:104)
at org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:69)
at org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:68)
at org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:1159)
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:649)
at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:278)
at org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet(LocalRuleExecutionSetProviderImpl.java:158)
at org.drools.jsr94.rules.admin.LocalRuleExecutionSetProviderImpl.createRuleExecutionSet(LocalRuleExecutionSetProviderImpl.java:93)
...
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-1559) Ability to negate a constraint group
by Dirk Bergstrom (JIRA)
Ability to negate a constraint group
------------------------------------
Key: JBRULES-1559
URL: http://jira.jboss.com/jira/browse/JBRULES-1559
Project: JBoss Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Drl Parser/Builder
Affects Versions: FUTURE
Reporter: Dirk Bergstrom
Assigned To: Mark Proctor
Priority: Minor
I want to write a rule that says "Find all long-eared dogs that do not have
short, black hair". This seems like the simple way to do it:
collect( Dog( ears=="long",
not (hair=="short" && color=="black") )
But that doesn't parse. Some digging through the archives unearthed a mention
of De Morgan's laws, which leads to: http://en.wikipedia.org/wiki/De_Morgan's_laws
Which explains that I can instead write:
collect( Dog( ears=="long", (hair!="short" || color!="black") )
Which, after some mental effort, turns out to be the right thing.
However, had I not found the reference to De Morgan's Law, it would have taken
me a long time to get there (if indeed I ever would have). The end result is
also quite difficult to parse if you're not a logician, and thus not very
user-friendly.
--
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
15 years
[JBoss JIRA] Created: (JBRULES-1662) Tomcat Debugging of Rules
by Paul Ryan (JIRA)
Tomcat Debugging of Rules
-------------------------
Key: JBRULES-1662
URL: http://jira.jboss.com/jira/browse/JBRULES-1662
Project: JBoss Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Eclipse IDE
Environment: Tomcat 5+ and Eclipse IDE
Reporter: Paul Ryan
Assigned To: Mark Proctor
The ability to debug rules while running from a tomcat instance. This would be helpful for those of us that have services wrapping the rules so that we can debug into running rule sets. This feature should be capable of running its own instance of tomcat as well as attaching to a debug version of an externally running tomcat to allow for flexibility based on the users socket needs.
This feature would be a huge selling point for enterprise applications of Drools.
--
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
15 years
[JBoss JIRA] Created: (JBRULES-2113) NPE thrown by LeftTuple.get() method
by Tom Murphy (JIRA)
NPE thrown by LeftTuple.get() method
------------------------------------
Key: JBRULES-2113
URL: https://jira.jboss.org/jira/browse/JBRULES-2113
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.0.0.CR1
Environment: FOund in 5.0.0.CR1 - Community version. Windows XP
Reporter: Tom Murphy
Assignee: Mark Proctor
the get() method on LeftTuple throws a null exception under certain circumstances, which are as yet undetermined.
Here is the Code:
public InternalFactHandle get(final int index) {
LeftTuple entry = this;
while ( entry.index != index ) {
entry = entry.parent;
}
return entry.handle;
}
Note that the loop moves to each parent in succession, but never checks for entry != null. If it does get to the end of the chain, it will throw an NPE
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2101) Intermittant NullPointerException when invoking StatefulSession.asyncUpdate() while maintainTms==true
by Greg Barton (JIRA)
Intermittant NullPointerException when invoking StatefulSession.asyncUpdate() while maintainTms==true
-----------------------------------------------------------------------------------------------------
Key: JBRULES-2101
URL: https://jira.jboss.org/jira/browse/JBRULES-2101
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.0.1.FINAL
Environment: Ubuntu Jaunty Jackelope
Linux version 2.6.27-11-generic (buildd@yellow) (gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu11) ) #1 SMP Wed Apr 1 20:53:41 UTC 2009
Multicore
Reporter: Greg Barton
Assignee: Mark Proctor
After calling StatefulSession.asyncUpdate() the following exception occurs, but only when maintainTms==true in the rule configuration:
Exception in thread "Thread-5" java.lang.NullPointerException
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1387)
at org.drools.common.AbstractWorkingMemory.update(AbstractWorkingMemory.java:1350)
at org.drools.concurrent.UpdateObject.execute(UpdateObject.java:46)
at org.drools.concurrent.CommandExecutor.run(CommandExecutor.java:78)
at java.lang.Thread.run(Thread.java:619)
AbstractWorkingMemory.java line 1387 is wrapped in an if statement with condition "this.maintainTms" so setting maintainTms=false avoids the exception entirely. The NPE producing line is this:
status = ((InternalFactHandle) factHandle).getEqualityKey().getStatus();
While encountering this problem the factHandle passed in to StatefulSession.asyncUpdate() was always non-null, so my guess is that the getEqualityKey() call returned null.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-1675) Xpath Default Constraint Evaluations
by Paul Ryan (JIRA)
Xpath Default Constraint Evaluations
------------------------------------
Key: JBRULES-1675
URL: http://jira.jboss.com/jira/browse/JBRULES-1675
Project: JBoss Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: Drl Parser/Builder, Eclipse IDE, Rule Assemply/SPI, Solver, Verifier, xml
Reporter: Paul Ryan
Assigned To: Mark Proctor
A default set of constraint matchers for xpath based on loaded w3c DOMs would be very helpful. For our project we have alot of facts that are just an xml file (this seems to be the way the industry in general is going) that is calculated and being able to load that in to working memory and have constraint based node evaluations would be a very nice and attractive feature. I would suggest as a start a basic content equals (on elements it would match against text content and on attributes it would match against the node value) as well as a basic check for exists based on given xpath.
Potential syntax:
Fact( xml.xpath("/document//fragment[@id='myid']")) // Checks if the xpath exists in the property xml
or
Fact( xml.xpath("/document//fragment[@id='myid']") == "myvalue") // Checks if the text content of the fragment with the given id is "myvalue"
or
Fact( xml.xpath("/document//fragment[@id='myid']/@attr1") == "myattr") // Checks if the node value of the attribute attr1 in the given fragment is "myattr"
with the property xml having been defined in the fact.
I would suggest implementing this using the latest DOM stuff that has been recently released with xerces 2.9 and up as it has a very fast and efficient xpath evaluator. If you would like I think I can draw up some examples, however I don't think I know enough about drools core code to write this feature myself yet, maybe with some help.
Also this constraint module may need a new interface for configuring the size limit (or other constraint) around when to load the xml into working memory. Maybe a annotation based solution in the fact is a good idea (e.g. put an annotation @LoadDOM on xml property in the fact for properties that should be loaded into DOM), or the other option is that the designer has to set the property up as an org.w3c.dom.Document for it to be consider pre-loadable.
--
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
15 years
[JBoss JIRA] Created: (JBRULES-2069) NPE on RuleBase when Guvnor is down
by George Gastaldi (JIRA)
NPE on RuleBase when Guvnor is down
-----------------------------------
Key: JBRULES-2069
URL: https://jira.jboss.org/jira/browse/JBRULES-2069
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.0.0.CR1
Reporter: George Gastaldi
Assignee: Mark Proctor
Priority: Minor
When creating a a RuleBasedAgent with the following code: org.drools.agent.RuleAgent.newRuleAgent(properties), having properties only the url property, the following stacktrace appears:
java.io.IOException: Was unable to reach server.
at org.drools.agent.URLScanner.hasChanged(URLScanner.java:155)
at org.drools.agent.URLScanner.getChangeSet(URLScanner.java:119)
at org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:96)
at org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:410)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:362)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:347)
at org.drools.agent.RuleAgent.init(RuleAgent.java:247)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:187)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:147)
followed by
java.lang.NullPointerException
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:363)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:347)
at org.drools.agent.RuleAgent.init(RuleAgent.java:247)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:187)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:147)
That´s OK to throw the IOException, but the NullPointerException should not happen.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (EJBTHREE-1647) @Resource injection of primitive types from JNDI
by Dennis Reed (JIRA)
@Resource injection of primitive types from JNDI
------------------------------------------------
Key: EJBTHREE-1647
URL: https://jira.jboss.org/jira/browse/EJBTHREE-1647
Project: EJB 3.0
Issue Type: Bug
Components: injection
Affects Versions: AS 4.2.1.GA
Reporter: Dennis Reed
The following does not work to inject an arbitrary JNDI entry for primitive/primitive wrapper/String fields:
@Resource( mappedName = "java:/blah/blah" )
String myVar;
In older versions, a "NYI" exception was thrown (then changed to a different exception before getting to the user).
In newer versions, the literal value in mappedName is injected.
For all other types, the JNDI entry injection works. For example, the following does inject that same String from JNDI:
@Resource( mappedName = "java:/blah/blah" )
Object myVar;
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2343) Context assist in DSLR Editor
by Hamza Bakkali (JIRA)
Context assist in DSLR Editor
-----------------------------
Key: JBRULES-2343
URL: https://jira.jboss.org/jira/browse/JBRULES-2343
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.0.1.FINAL
Environment: Eclipse 3.4 Ganymede
Reporter: Hamza Bakkali
Assignee: Mark Proctor
Fix For: 4.0.8
I have been using drools 4 for couple of months now and I am starting to get the hang of it. We recently decided to move to Dools 5 with Eclipse 3.4.2 (Ganymede).
We unfortunately hit a major 'show stopper' (for us). In the DSLR editor: Context Assist + space + enter removes/replaces the whole line, not only the place holder.
In other words:
DSL:
[*][]Log : {msg}=System.out.println("{msg}");
[*][]id1="some id label"
DSLR:
rule "MyRule"
when
then
end
If I Press L , control space --> the line Log:{msg} appears in the context menu. Hit enter I get
Log :{msg}
Now, If want to replace msg by id1. I position the cursor in the {msg}, hit ctrl space, id1 shows in the list. I hit enter the whole line disappear, and I am left with
id1
instead of
Log : id1
Is this a setting somewhere in eclipse itself?? I doubt it.
The same thing use to work as expected in Drools 4.
thanks.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2218) Unknown error while parsing. This is a bug. Please contact the Development team.
by Udo Klinkmüller (JIRA)
Unknown error while parsing. This is a bug. Please contact the Development team.
--------------------------------------------------------------------------------
Key: JBRULES-2218
URL: https://jira.jboss.org/jira/browse/JBRULES-2218
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-eclipse
Affects Versions: 5.0.0.FINAL
Environment: Eclipse 3.5 (Galileo), Mac OS X
Reporter: Udo Klinkmüller
Assignee: Mark Proctor
rule "Arrival-Delayed-Upd"
salience 1000
when
#conditions
VisitPair( $ov: oldVisit != null, $nv: visit )
$oaf: ArrivalFlight( onBlock == null, $ost: scheduledTime != null, $op: position != null ) from $ov.arrivalFlight
$naf: ArrivalFlight( onBlock == null, (($nst: scheduledTime != null, != $ost) || ($np: position != null, != $op)) ) from $nv.arrivalFlighT
then
#actions
Date vf = addMinutes($nst, 15);
ResourceEvent re = eventBuilderFactory.getResourceVisitEventBuilder(EventType.ARRIVAL_DELAYED, $naf.getPositionKey(), vf)
.visitKey($nv.getKey())
.build();
eventHandler.handleEvent(re);
end
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-1769) Improvements to pluggable operator framework
by Edson Tirelli (JIRA)
Improvements to pluggable operator framework
--------------------------------------------
Key: JBRULES-1769
URL: https://jira.jboss.org/jira/browse/JBRULES-1769
Project: JBoss Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Reporter: Edson Tirelli
Assignee: Edson Tirelli
e-mail from Michel Zimmermann:
-----------
Hi Edson,
I think I got it working :-)
Edson Tirelli wrote:
> For an example, look at the file SetEvaluatorsDefinition and look at
> the BaseMemberOf inner class. So, all the logic is in there, but we
> still used subclasses just to set the constructor attributes and
> override the toString() method, but you could still implement
> everything in a single class I guess.
Yes, this approach makes sense as long as you don't need to use the
different VariableContextEntry subclasses for handling double, char etc.
Yet, this can be handled, too.
toString():
You can avoid subclassing from your BaseMyEvaluatorClass to override
toString() by using a string method like:
public String toString() {
return getValueType().getName() + " " +
getOperator().getOperatorString();
}
Regarding the evaluator API:
If you only need one evaluator class (subclassed from BaseEvaluator),
personally I don't like the > 10 static calls to
addEvaluator(type, operator, myEvaluatorInstance)
in the EvaluatorDefinition class.
So, how about adding the method addDefaultEvaluator(operator,
evaluatorClass) to EvaluatorCache, see attachment?
This would allow you to register a evaluator as default and only overide
the special cases...
PS: If you are interested I will write some small tutorial about custom
evaluators / operators in drools trunk. This might take a week or two,
though. Any preferences regarding the format?
Thanks for the help....
cu, Michael
@SuppressWarnings("unchecked")
public void addDefaultEvaluator(final Operator operator, Class evaluatorClass) {
// define the constructor
Class[] evaluatorParameters = new Class[2];
evaluatorParameters[0] = ValueType.class;
evaluatorParameters[1] = Operator.class;
// get the constructor
try {
Constructor<BaseEvaluator> constructor;
constructor = evaluatorClass.getConstructor( evaluatorParameters );
// add feault operators
addEvaluator(ValueType.ARRAY_TYPE, operator, constructor.newInstance(ValueType.ARRAY_TYPE, operator));
addEvaluator(ValueType.BIG_DECIMAL_TYPE, operator, constructor.newInstance(ValueType.BIG_DECIMAL_TYPE, operator));
addEvaluator(ValueType.BIG_INTEGER_TYPE, operator, constructor.newInstance(ValueType.BIG_INTEGER_TYPE, operator));
addEvaluator(ValueType.BOOLEAN_TYPE, operator, constructor.newInstance(ValueType.BOOLEAN_TYPE, operator));
addEvaluator(ValueType.PBOOLEAN_TYPE, operator, constructor.newInstance(ValueType.PBOOLEAN_TYPE, operator));
addEvaluator(ValueType.BYTE_TYPE, operator, constructor.newInstance(ValueType.BYTE_TYPE, operator));
addEvaluator(ValueType.PBYTE_TYPE, operator, constructor.newInstance(ValueType.PBYTE_TYPE, operator));
addEvaluator(ValueType.CHAR_TYPE, operator, constructor.newInstance(ValueType.CHAR_TYPE, operator));
addEvaluator(ValueType.PCHAR_TYPE, operator, constructor.newInstance(ValueType.PCHAR_TYPE, operator));
addEvaluator(ValueType.DATE_TYPE, operator, constructor.newInstance(ValueType.DATE_TYPE, operator));
addEvaluator(ValueType.DOUBLE_TYPE, operator, constructor.newInstance(ValueType.DOUBLE_TYPE, operator));
addEvaluator(ValueType.PDOUBLE_TYPE, operator, constructor.newInstance(ValueType.PDOUBLE_TYPE, operator));
addEvaluator(ValueType.FLOAT_TYPE, operator, constructor.newInstance(ValueType.FLOAT_TYPE , operator));
addEvaluator(ValueType.PFLOAT_TYPE, operator, constructor.newInstance(ValueType.PFLOAT_TYPE, operator));
addEvaluator(ValueType.INTEGER_TYPE, operator, constructor.newInstance(ValueType.INTEGER_TYPE, operator));
addEvaluator(ValueType.PINTEGER_TYPE, operator, constructor.newInstance(ValueType.PINTEGER_TYPE, operator));
addEvaluator(ValueType.LONG_TYPE, operator, constructor.newInstance(ValueType.LONG_TYPE, operator));
addEvaluator(ValueType.PLONG_TYPE, operator, constructor.newInstance(ValueType.PLONG_TYPE, operator));
addEvaluator(ValueType.OBJECT_TYPE, operator, constructor.newInstance(ValueType.OBJECT_TYPE, operator));
addEvaluator(ValueType.SHORT_TYPE, operator, constructor.newInstance(ValueType.SHORT_TYPE, operator));
addEvaluator(ValueType.PSHORT_TYPE, operator, constructor.newInstance(ValueType.PSHORT_TYPE, operator));
addEvaluator(ValueType.STRING_TYPE, operator, constructor.newInstance(ValueType.STRING_TYPE, operator));
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchMethodException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (InvocationTargetException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-1322) Accumulate functions are highly unreliable for long's and BigDecimals
by Geoffrey De Smet (JIRA)
Accumulate functions are highly unreliable for long's and BigDecimals
---------------------------------------------------------------------
Key: JBRULES-1322
URL: http://jira.jboss.com/jira/browse/JBRULES-1322
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Drl Parser/Builder
Affects Versions: 4.0.3
Reporter: Geoffrey De Smet
Assigned To: Edson Tirelli
Priority: Critical
Fix For: 4.1.0
When dealing with financial data, one should never ever use double's. Instead BigDecimal should be used.
Not because BigDecimal is bigger (that's rarely a problem) but because it doesn't do any decimal to binary transformation.
For example, it's impossible for a double to correctly represent "0.2", aka 1/5.
Summing many doubles (or even a few differing in scale), can easily give wrong results (and for financial data this tends to be important).
Using doubles to sum longs have the exact same problem.
Attached is a testcase patch which proves this by checking if (MAX_LONG - 4L) and 3L sum up to be (MAX_LONG - 1L).
Currently they don't.
One possible way to solve this is to fix JBRULES-1075,
which just happens to give drools-solver 3% more performance ;) what a coincidence ^^
--
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
15 years
[JBoss JIRA] Created: (JBRULES-2238) Accumulate should be implemented with left-input incremental so they don't start from scratch on every left-input retraction/assertion
by Geoffrey De Smet (JIRA)
Accumulate should be implemented with left-input incremental so they don't start from scratch on every left-input retraction/assertion
--------------------------------------------------------------------------------------------------------------------------------------
Key: JBRULES-2238
URL: https://jira.jboss.org/jira/browse/JBRULES-2238
Project: Drools
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.0.1.FINAL
Reporter: Geoffrey De Smet
Assignee: Mark Proctor
The current accumulate implementation has a severe performance loss in the drools-solver context.
Edson said that this issue could be the culprit.
However, for this to be implemented the true modify feature should first be implemented.
See the discussion "Why is this DRL twice as slow?" on the dev user list.
>From IRC:
<ge0ffrey> more and more of my experiments show the poisones nature of accumulate for drools-solver. Probably because they are backwards chained (as I understand it?). Of course accummulate is great for many use cases, just not drools-solver.
<ge0ffrey> The problem is, I have no way to workaround them. I need the sum of my logically inserted objects.
<etirelli> ge0ffrey: no, accumulate are implemented as forward chain as usual
<etirelli> the problem is that a left-input retraction on an accumulate node will throw away any result and a leftinput assert will recalculate everything from scratch
<ge0ffrey> What do you mean by "must fully recalculate"?
<etirelli> mean from scratch
<ge0ffrey> Why does it do that?
<etirelli> remember that modify = retract+assert
<ge0ffrey> And right-input retractions won't recalculate everything from scratch?
<etirelli> no... right input are incremental
<ge0ffrey> would making leftinput assert incremental too be possible?
<etirelli> ge0ffrey: the only way to do left-input incremental is with a feature called "true modify"
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-2336) Context assist in DSLR Editor
by Hamza Bakkali (JIRA)
Context assist in DSLR Editor
-----------------------------
Key: JBRULES-2336
URL: https://jira.jboss.org/jira/browse/JBRULES-2336
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: All
Affects Versions: 5.0.1.FINAL
Environment: Eclipse 3.4.2 GANYMEDE
Reporter: Hamza Bakkali
Assignee: Mark Proctor
Fix For: 4.0.8
I have been using drools 4 for couple of months now and I am starting to get the hang of it. We recently decided to move to Dools 5 with Eclipse 3.4.2 (Ganymede).
We unfortunately hit a major 'show stopper' (for us). In the DSLR editor: Context Assist + space + enter removes/replaces the whole line, not only the place holder.
In other words:
DSL:
[*][]Log : {msg}=System.out.println("{msg}");
[*][]id1="some id label"
DSLR:
rule "MyRule"
when
then
end
If I Press L , control space --> the line Log:{msg} appears in the context menu. Hit enter I get
Log :{msg}
Now, If want to replace msg by id1. I position the cursor in the {msg}, hit ctrl space, id1 shows in the list. I hit enter the whole line disappear, and I am left with
id1
instead of
Log : id1
Is this a setting somewhere in eclipse itself?? I doubt it.
The same thing use to work as expected in Drools 4.
thanks.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years
[JBoss JIRA] Created: (JBRULES-1199) Add a field constraint negation operator to drools
by Arsalan Zaidi (JIRA)
Add a field constraint negation operator to drools
---------------------------------------------------
Key: JBRULES-1199
URL: http://jira.jboss.com/jira/browse/JBRULES-1199
Project: JBoss Rules
Issue Type: Feature Request
Security Level: Public (Everyone can see)
Reporter: Arsalan Zaidi
Assigned To: Mark Proctor
Arsalan,
Unfortunately Drools does not have a field constraint negation operator, mostly because when writing rules, it was not needed, since you can always negate the constraint itself.
Although, I understand a agree with your use case. My suggestion is for you to open a JIRA feature request and we will include that as soon as possible in the product.
Although, meanwhile, the only workaround I can see for your case is to translate the expression you are using directly into a java or mvel expression and write it inside an in-line eval.
[]s
Edson
2007/9/14, Arsalan S. Zaidi <arsalan.zaidi(a)capgemini.com>:
Hi
I'll try to explain the situation that Gaurav finds himself in. We're working on this problem together and so far, we haven't been able to crack it.
We're using drools to handle the business rules for an application. The rules however, are not provided to us in a .drl file, rather, we get an XLS sheet from the analysts with rules in a different grammar.
We're using ANTLR to read and parse these rules to generate the drools rules programmatically. However, we're running into problems with NOT.
The input rules (in the non-drools business language) have a NOT operator which works like '!' in Java. It flips the Boolean around, so to speak. So:
NOT((some sub expression which evaluates to TRUE)) == FALSE
MVEL doesn't seem to support this. So how do we simulate it?
If it were only being used with NOT IN, we could manage, but its use is completely arbitrary. Changes to the input rules or to the input rules grammar have been (ha ha) ruled out.
Any help would be appreciated.
Regards,
_____________________________________________________
Arsalan Zaidi / Capgemini - India (FS SBU) / Mumbai
Technical Architect
Mobile Phone: +91 - 9892 8970 03 / www.capgemini.com
Together: the Collaborative Business Experience
_____________________________________________________
--------------------------------------------------------------------------------
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Anstis, Michael (M.)
Sent: 13 September 2007 13:31
To: Rules Users List
Subject: RE: [rules-users] How to use not operator in drool.
What dialect do your rules use?
You could also simplify the logic using DeMorgans Theorem (which might be troublesome to accomplish programmatically)
I don't know whether your example is flawed as the brackets don't match, but assuming you mean something like this:-
(NOT (G13.1 IN ("1","2","3") OR (G250.8 = Y)))
You can re-write this as
(G13.1NOT IN ("1","2","3") AND G250.8 != Y)
With kind regards,
Mike
--------------------------------------------------------------------------------
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of JOSHI, GAURAV
Sent: 13 September 2007 08:20
To: Rules Users List
Subject: RE: [rules-users] How to use not operator in drool.
Thank's for your sugession of using "not in" instead of "not" but my problem is that "not" can also come without "in".
Actually I am making a generator of rule file from expression like
((NOT (ENDS WITH (G10.2, ",")))
((NOT (G13.1 IN ("1","2","3"))) OR (G250.8 = Y)))
Where G13.2, G250.8, G10.2 are variables coming from a map inserted in working memory.
I am accessing these variables from map.
My rules are as follows
This rule is working fine.
rule "Editable_G10.3"
when
((Map( this["G10.3"] !=8))||(Map( this["G10.2"] ==19)))
then
System.out.println("comming here----------------------------------------------------->");
End
This is not working
rule "Mandatory_G10.3"
when
(not((Map( this["G10.3"] !=8))||(Map( this["G10.2"] ==19))))
Then
System.out.println("comming here----------------------------------------------------->");
End
In also tried following approaches:
1) eval(not((Map( this["G10.3"] !=8))||(Map( this["G10.2"] ==19))))
2) eval(!((Map( this["G10.3"] !=8))||(Map( this["G10.2"] ==19))))
But in both cases it is giving same error:
org.drools.rule.InvalidRulePackage: Rule Compilation error : [Rule name=ValidationRuleExp_G10.3, agendaGroup=MAIN, salience=0, no-loop=false]
com/telekurs/nva/mde/fe/ak/validation/Rule_ValidationRuleExp_G10_3_0.java (11:495) : Cannot use this in a static context
com/telekurs/nva/mde/fe/ak/validation/Rule_ValidationRuleExp_G10_3_0.java (11:500) : Type mismatch: cannot convert from String to int
I am trying to find out some general concept so that I can change just achieve the functionality of not.
Thanks
Gaurav
--------------------------------------------------------------------------------
From: rules-users-bounces(a)lists.jboss.org [mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Edson Tirelli
Sent: Wednesday, September 12, 2007 10:20 PM
To: Rules Users List
Subject: Re: [rules-users] How to use not operator in drool.
Remove your "eval" and use "or" instead of "||" for the OR CE.
Although, I feel that this is not what you want... what you want is simply:
when
Map( this['city'] not in ( "mumbai", "delhi" ) )
then
//...
end
[]s
Edson
2007/9/12, Gaurav2007 < gaurav.a.joshi(a)capgemini.com>:
Hi ALL,
I am using drool4.0.1 in my application i am able to use IN,OR,AND operator
but i am facing problem in using not operator.
my requirement of not operator is just like a not gate.
the way i am using it is :
eval(not((Map( this["city"] !="mumbai"))||(Map( this["city"] =="delhi"))))
so can you please help me out to solve this problem:
should i use not operator or some thing else in drool.
Thanks,
--
View this message in context: http://www.nabble.com/How-to-use-not-operator-in-drool.-tf4430240.html#a1...
Sent from the drools - user mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
--
Edson Tirelli
Software Engineer - JBoss Rules Core Developer
Office: +55 11 3529-6000
Mobile: +55 11 9287-5646
JBoss, a division of Red Hat @ www.jboss.com
--
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
15 years
[JBoss JIRA] Created: (JBRULES-1596) java.lang.NoClassDefFoundError
by Jurgen Van Bouchaute (JIRA)
java.lang.NoClassDefFoundError
-------------------------------
Key: JBRULES-1596
URL: http://jira.jboss.com/jira/browse/JBRULES-1596
Project: JBoss Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 4.0.4
Environment: Win XP, Drools 4.0.4 , BRMS on JBOSS 4.2.1-GA , JVM Bea JRockit R27 3.1 (1.5)
Reporter: Jurgen Van Bouchaute
Assigned To: Mark Proctor
Attachments: adresDSL, packagesource.txt, Rule source.txt
Encountered following error during unit testing execution of rules :
[BeforeActivationFired: rule=Address Validation Town required; tuple=[fid:1:1:com.amadeus.mbo.msp.proto.model.AddressImpl@558fec]
]
java.lang.NoClassDefFoundError: Adres/CreateValidationErrorDSL
at ASMAccessorImpl_34195571209986950480.getValue(Unknown Source)
at org.mvel.ASTNode.getReducedValueAccelerated(ASTNode.java:174)
at org.mvel.ExecutableAccessor.getValue(ExecutableAccessor.java:50)
at ASMAccessorImpl_33632651209986950320.getValue(Unknown Source)
at org.mvel.ast.VariableDeepPropertyNode.getReducedValueAccelerated(VariableDeepPropertyNode.java:22)
at org.mvel.ast.PropertyASTNode.getReducedValueAccelerated(PropertyASTNode.java:21)
at org.mvel.MVELRuntime.execute(MVELRuntime.java:88)
at org.mvel.CompiledExpression.getValue(CompiledExpression.java:111)
at org.mvel.MVEL.executeExpression(MVEL.java:235)
at org.drools.base.mvel.MVELConsequence.evaluate(MVELConsequence.java:47)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:514)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:471)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)
at com.amadeus.mbo.commons.ruleengine.RuleManager.executeRules(RuleManager.java:158)
at com.amadeus.mbo.msp.proto.service.CustomerServiceImpl.validateAddress(CustomerServiceImpl.java:444)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:296)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:177)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:144)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:107)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy8.validateAddress(Unknown Source)
at com.amadeus.mbo.msp.proto.service.CustomerServiceImplTest.testValidateAddress(CustomerServiceImplTest.java:1139)
DSL Rule RHS executes a function that returns an object which is inserted.
No problems when building & validating the package in BRMS, only when executing the rule.
--
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
15 years
[JBoss JIRA] Created: (JBRULES-2466) Exception in hash code calculation for character attributes in alpha hashing optimization
by Olexandr Demura (JIRA)
Exception in hash code calculation for character attributes in alpha hashing optimization
-----------------------------------------------------------------------------------------
Key: JBRULES-2466
URL: https://jira.jboss.org/jira/browse/JBRULES-2466
Project: Drools
Issue Type: Sub-task
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.1.0.M1
Reporter: Olexandr Demura
Assignee: Mark Proctor
JBRULES-1348 introduces a bug in interaction between CompositeObjectSinkAdapter$HashKey and BaseObjectClassFieldReader
be following code change
- } else if ( vtype.isIntegerNumber() ) {
+ } else if ( vtype.isIntegerNumber() || vtype.isChar() ) {
this.type = LONG;
if ( !isNull ) {
this.lvalue = extractor.getLongValue( null, value );
because BaseObjectClassFieldReader.getLongValue() doesn't handle properties of Character type,
and RuntimeDroolsException is thrown with message "Conversion to double not supported from java.lang.Character".
In case BaseObjectClassFieldReader.getLongValue() returns ((Character) value).charValue() instead of throwing exception,
exception in the following form will be thrown be CompositeObjectSinkAdapter$HashKey
on equality check if other HashKey gained type OBJECT instead of LONG:
java.lang.NumberFormatException: For input string: "R"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
at java.lang.Long.parseLong(Long.java:403)
at java.lang.Long.parseLong(Long.java:461)
at org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.getLongValue(CompositeObjectSinkAdapter.java:628)
at org.drools.reteoo.CompositeObjectSinkAdapter$HashKey.equals(CompositeObjectSinkAdapter.java:692)
at org.drools.util.AbstractHashTable$EqualityEquals.equal(AbstractHashTable.java:446)
at org.drools.util.ObjectHashMap.get(ObjectHashMap.java:90)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:326)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
15 years