[JBoss JIRA] Created: (JBRULES-2777) rule with window:length/accumulate/not( before ) fires twice
by Wolfgang Laun (JIRA)
rule with window:length/accumulate/not( before ) fires twice
------------------------------------------------------------
Key: JBRULES-2777
URL: https://jira.jboss.org/browse/JBRULES-2777
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
Fix For: 5.2.0.M1
STREAM, pseudo-clock, insert facts after advancing the clock to the timestamp in the event:
for( Job job: jobs.getJobs() ){
Date jobTime = job.getTimestamp();
long newClock = jobTime.getTime();
if( newClock > oldClock ){
clock.advanceTime( newClock - oldClock, TimeUnit.MILLISECONDS );
oldClock = newClock;
}
System.out.println( "inserting " + job );
session.insert( job );
System.out.println( "advancing by 1ms" );
clock.advanceTime( 1, TimeUnit.MILLISECONDS );
oldClock++;
System.out.println( "fireAllRules" );
session.fireAllRules();
}
A single rule:
declare Job
@role( event )
@timestamp( timestamp )
@duration( duration )
end
Part of output:
inserting Job: 6 at Wed Nov 03 01:40:00 CET 2010 - 1000
advancing by 1ms
clock: 1288744799999, ts of 1st: 1288742400000 - Average interval: 599 seconds
clock: 1288744799999, ts of 1st: 1288743000000 - Average interval: 449 seconds
fireAllRules
inserting Job: 7 at Wed Nov 03 01:45:00 CET 2010 - 1000
advancing by 1ms
clock: 1288745099999, ts of 1st: 1288743000000 - Average interval: 524 seconds
clock: 1288745099999, ts of 1st: 1288743600000 - Average interval: 374 seconds
fireAllRules
Rule firing is erratic. There is no apparent reason why this should fire twice after advancing the clock.
--
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
12 years, 2 months
[JBoss JIRA] Created: (JBRULES-2882) NPE in EqualityEvaluatorsDefinition$StringEqualEvaluator.evaluateCachedLeft
by Ravi Bhatt (JIRA)
NPE in EqualityEvaluatorsDefinition$StringEqualEvaluator.evaluateCachedLeft
---------------------------------------------------------------------------
Key: JBRULES-2882
URL: https://issues.jboss.org/browse/JBRULES-2882
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core (expert)
Affects Versions: 5.1.0.FINAL
Environment: OS: Win 7 Professional 64 Bit, 64 Bit Java,
Reporter: Ravi Bhatt
Assignee: Mark Proctor
While working with rules with partitioning turned on.
KnowledgeBaseConfiguration config = KnowledgeBaseFactory.newKnowledgeBaseConfiguration();
config.setOption( MultithreadEvaluationOption.YES );
conf.setOption( MaxThreadsOption.get(5) );
Once we start inserting objects into the KSession, somewhere in the middle it throws this error:
Partition task manager caught an unexpected exception: null
Drools is capturing the exception to avoid thread death. Please report stack trace to development team.
java.lang.NullPointerException
at org.drools.base.evaluators.EqualityEvaluatorsDefinition$StringEqualEvaluator.evaluateCachedLeft(EqualityEvaluatorsDefinition.java:1984)
at org.drools.rule.VariableRestriction.isAllowedCachedLeft(VariableRestriction.java:109)
at org.drools.rule.VariableConstraint.isAllowedCachedLeft(VariableConstraint.java:115)
at org.drools.common.SingleBetaConstraints.isAllowedCachedLeft(SingleBetaConstraints.java:142)
at org.drools.reteoo.FromNode.checkConstraintsAndPropagate(FromNode.java:274)
at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:138)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:64)
at org.drools.reteoo.JoinNode.assertLeftTuple(JoinNode.java:85)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:64)
at org.drools.reteoo.FromNode.checkConstraintsAndPropagate(FromNode.java:279)
at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:138)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:64)
at org.drools.reteoo.JoinNode.assertObject(JoinNode.java:128)
at org.drools.reteoo.PartitionTaskManager$FactAssertAction.execute(PartitionTaskManager.java:274)
at org.drools.reteoo.PartitionTaskManager$PartitionTask.run(PartitionTaskManager.java:118)
at org.drools.concurrent.ExternalExecutorService$ObservableRunnable.run(ExternalExecutorService.java:453)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBRULES-2877) Disjunction over a set not working
by Oliver Roess (JIRA)
Disjunction over a set not working
----------------------------------
Key: JBRULES-2877
URL: https://issues.jboss.org/browse/JBRULES-2877
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: 5.1.1.FINAL
Reporter: Oliver Roess
Assignee: Mark Proctor
Hello there and a happy new year to everyone reading :)
Why am I here again? Yep, got a problem. Don't know why it doesn't work. I'm using the latest snapshot version.
So here it goes.
A simple rule with conjunction and disjunction but over a set of events.
when
$ldes : Set(size == 2) from collect(LoopDetectorEvent() over window:length(2))
(or LoopDetectorEvent($t1 : transportation == "LKW", $id1 : eventID) from $ldes
LoopDetectorEvent($t2 : transportation == "PKW", $id2 : eventID) from $ldes)
LoopDetectorEvent($t3 : transportation == "BUS", $id3 : eventID) from $ldes
So, what the rule says: fire when there's a BUS event plus either a LKW or PKW event in the set.
But, instead I get a big exception. It's posted at the end.
Interestingly, it works if I don't use the Set, like this...
when
(or $e1 : LoopDetectorEvent($t1 : transportation == "PKW", $id1 : eventID) over window:length(1)
$e2 : LoopDetectorEvent($t2 : transportation == "LKW", $id2 : eventID) over window:length(1))
LoopDetectorEvent($t3 : transportation == "BUS", $id3 : eventID) over window:length(1)
but that rule does not have the same meaning. So it's useless for me.
Besides, it DOES work with the set if I just cut the third event out (the BUS event).
What is wrong here?
Thanks in advance.
Kind regards!
Oliver
Exception in thread "Thread-2" java.lang.ClassCastException: org.drools.reteoo.InitialFactImpl cannot be cast to trafficsys.domain.events.LoopDetectorEvent
at org.drools.base.trafficsys.domain.events.LoopDetectorEvent446196$getTransportation.getValue(Unknown Source)
at org.drools.base.ClassFieldReader.getValue(ClassFieldReader.java:91)
at org.drools.base.evaluators.EqualityEvaluatorsDefinition$StringEqualEvaluator.evaluate(EqualityEvaluatorsDefinition.java:1961)
at org.drools.rule.LiteralRestriction.isAllowed(LiteralRestriction.java:92)
at org.drools.rule.LiteralConstraint.isAllowed(LiteralConstraint.java:109)
at org.drools.reteoo.FromNode.checkConstraintsAndPropagate(FromNode.java:264)
at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:138)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:64)
at org.drools.reteoo.FromNode.checkConstraintsAndPropagate(FromNode.java:279)
at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:138)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:189)
at org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:64)
at org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:662)
at org.drools.reteoo.AccumulateNode.assertObject(AccumulateNode.java:270)
at org.drools.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:450)
at org.drools.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:378)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:190)
at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:145)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1187)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1089)
at org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:893)
at org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:238)
at trafficsys.SessionInterface.insertAndFire(SessionInterface.java:133)
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBRULES-2871) KnowledgeAgent: unable to determine operator for symbol [after]
by Oscar de Groot (JIRA)
KnowledgeAgent: unable to determine operator for symbol [after]
---------------------------------------------------------------
Key: JBRULES-2871
URL: https://issues.jboss.org/browse/JBRULES-2871
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-core
Affects Versions: 5.1.1.FINAL
Reporter: Oscar de Groot
Assignee: Mark Proctor
When loading a ruleset via a KnowledgeAgent, only the operators defined in org.drools.base.evaluators.Operator (== != >= < <= <) are supported. When loading the same rulebase via a KnowledgeBuilder, all operators are supported.
Upon loading a ruleset that contains another operator (e.g. "after", "before"), the following error is printed:
[2011:01:19 14:01:44:exception]
java.lang.RuntimeException: KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage
at org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:674)
at org.drools.agent.impl.KnowledgeAgentImpl.addResourcesToKnowledgeBase(KnowledgeAgentImpl.java:899)
...
Caused by: org.drools.RuntimeDroolsException: unable to determine operator for symbol [after]
at org.drools.base.evaluators.Operator.determineOperator(Operator.java:87)
at org.drools.base.evaluators.Operator.readResolve(Operator.java:122)
Using Eclipse's debugging feature, I have determined that KnowledgeBuilder loads the rest of the operators through EvaluatorRegistry, while KnowledgeAgent does nothing to load any operators into org.drools.base.evaluators.Operator. I have tried modifying KnowledgeAgent by adding the code below to the constructor of KnowledgeAgentImpl. This resolves the problem: with this addition, the ruleset with "after"-operator works as intended when loaded via a KnowledgeAgent.
// Load all of Drools' default evaluators instead of just the ones defined
// in org.drools.base.evaluators.Operator
new EvaluatorRegistry();
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBRULES-2819) DSL parsing/expansion: '\', '$', empty value, empty condition
by Wolfgang Laun (JIRA)
DSL parsing/expansion: '\', '$', empty value, empty condition
---------------------------------------------------------------
Key: JBRULES-2819
URL: https://jira.jboss.org/browse/JBRULES-2819
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler-DSL
Affects Versions: 5.1.1.FINAL
Reporter: Wolfgang Laun
Assignee: Mark Proctor
Fix For: 5.2.0.M1
DSL parser does not accept an empty "value" section, e.g.
[when] a man loves a woman=
Expansion of a rule with an empty condition results in "whenthen".
The DSL parser escapes '$', but not '\' in value sections. It should not modify the value section except for "normalizing" variable references. Variable references should be restricted to a "clean" character sequence (e.g. Java identifier). The current expansion using replaceAll is too fragile.
I have emailed three reworked source files AntlrDSLMappingEntry.java DefaultExpander.java DSLTokenizedMappingFile.java to Edson, but I didn't change the parser itself.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBRULES-2845) threading issues when using MultithreadEvaluationOption.YES with fusion
by Radai Rosenblatt (JIRA)
threading issues when using MultithreadEvaluationOption.YES with fusion
-----------------------------------------------------------------------
Key: JBRULES-2845
URL: https://issues.jboss.org/browse/JBRULES-2845
Project: Drools
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: drools-compiler (fusion), drools-core (expert)
Affects Versions: 5.1.1.FINAL
Environment: dual core processor, jdk 6u21, windows xp
Reporter: Radai Rosenblatt
Assignee: Mark Proctor
Attachments: threadingbug.zip
i have 2 very simple rules and a test case (see attached maven project).
trying to set MultithreadEvaluationOption.YES on the KB causes the test to fail sporadically (~10% of the times?).
the attached project contains a testsuite that runs the same test 8 times (testsuite is defined in RunMe.java). attempting "mvn clean install" runs this suite and usually fails.
commenting out the MultithreadEvaluationOption.YES line in the other testcase (the one referred-to from RunMe) causes the tests to behave as expected (pass).
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JBAS-8824) Cardinality constraints on children are not enforced after parsing
by Brian Stansberry (JIRA)
Cardinality constraints on children are not enforced after parsing
------------------------------------------------------------------
Key: JBAS-8824
URL: https://issues.jboss.org/browse/JBAS-8824
Project: JBoss Application Server
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Domain Management
Affects Versions: 7.0.0.Alpha1
Reporter: Brian Stansberry
Priority: Critical
Fix For: 7.0.0.Beta1
The parsers enforce cardinality constraints on child elements in the model, but they aren't enforced thereafter. So, for example, a second "profile" or "socket-binding-group" could be added to a standalone server via a management operation.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 2 months
[JBoss JIRA] Created: (JGRP-1052) Ergonomics
by Bela Ban (JIRA)
Ergonomics
----------
Key: JGRP-1052
URL: https://jira.jboss.org/jira/browse/JGRP-1052
Project: JGroups
Issue Type: Feature Request
Reporter: Bela Ban
Assignee: Bela Ban
Fix For: 3.0
The goal is to (a) reduce the number of properties needed and (b) determine the values dynamically.
Examples:
- Determine the best min/max size of a thread pool
- Find out what the best timeout values are for retransmission, e.g. based on average retransmission times
- Determine the optimal number of credits in FC
This is similar to the JVM setting where, starting with 1.5, the initial values can be set, but over time, the JVM dynamically changes them.
In the best case, a config contains only a list of protocols without any properties, and JGroups will figure out the correct values.
--
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
12 years, 2 months