fact problem
by saurabh maheshwari
Hi,
When i am taking a precompiled class in my rule engine is able to
process any no of objects in very quick session.
but when i am taking the facttype(class created from drl) inspite of
precompiled class then it is taking much time as no of objects increased in
the memory
i have 6 rules in my drl
1- in case of factType it is taking 1 sec for each 50 when 30000 objects
in memory(increases as no of objects increased in memory )
2- but in case of precompiled class it is taking 1 sec for each 1000
.without much effect of the no of objects (i have taken 1024mb heap size)
I am not able to find the cause of this problem .
Please inform if you have any idea about this.
Regards
Saurabh
15 years, 4 months
drools-guvnor\modules
by Michael Anstis
Hi,
We're in the process of rationalising Guvnors code-base including the
removal of GWTEXT and came across use of GWTEXT's Grid in
drools-guvnor\modules\properties.
Anybody care to claim ownership? Otherwise we're probably delete it (if not
all drools-guvnor\modules) s we don't want to refactor stuff no longer
needed.
X-posted in case knowledge of the module has moved to the user list only.
With kind regards,
Mike
15 years, 4 months
Decision Trees
by Petr Chelčický
I have quite a big decision tree (eligibility check) that I'd like to implement in Drools. To convert it to rules, I'd have to find every path from start leading to a leaf and check all the constraints. I feel like it'd be very messy. Is there a faster way? How about Drools Flow and decision trees? I tried to explain my use case here: http://stackoverflow.com/questions/4887456/decision-trees-and-rule-engine... where they recommend using Drools Expert. Is this the way to take?
John
15 years, 4 months
Drools: how do I compare two fields in a Decision Table
by David Smith
Hi,
How do I compare two fields in a decision table e.g.
transactionDate==attachmentDate
I can create a rule that has a restriction using two fields such as
rule "check if risk is active"
when
$risk : Risk(transactionDate==attachmentDate)
then
...
end
I can do this using an eval statement in a decision table
Condition
$risk:Risk
eval($risk.getAttachmentDate().equals($risk.getTransactionDate()))
How do I write this without an eval?
I want to write something similar to the rule above:
Condition
$risk:Risk
attachmentDate == transactionDate
Thanks
David
15 years, 4 months
timer and duration
by OlliSee
Hello there.
I seem to have trouble with the "timer" operator which is documented to have
superseded the "duration" operator for use in the rule body. I might have
something to do with the "not" operator I use in my rule.
Scenario: A is a fact, B is an event
When I write something like this
rule "test"
timer(int: 5s 5s)
when
$a : A()
not (exists B(a == $a))
then
insert(new B($a)); // which means in the new B object: B.a
= $a
end
I expect this rule to fire every 5 seconds if and only if the LHS is true.
I just insert a few A objects at the beginning.
So I expect this rule to fire ONCE, because it will insert the B event which
makes this rule's LHS evaluate to false in the future.
BUT, reality is, this rule fires every 5 seconds, no matter what.
Using the deprecated duration operator with "duration(5s)" instead of the
timer operator, it works as expected.
I assume, that timer works differently compared to duration. So I conclude
that duration should coexist. Or am I missing something here on the usage of
the timer operator?
Thanks in advance.
Oliver
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/timer-and-duration-tp...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 4 months
Accumulating over a list of collected events (bug?)
by OlliSee
Hi folks, another bug discovered here?
This rule yields a really nice exception
rule "Test"
when
$list : List() from collect ( A() over window:time(5s) )
Number($avg : doubleValue) from accumulate( A($num : num)
from $list, average($num))
then
...
end
whereas
Number($avg : doubleValue) from accumulate( A($num : num) over
window:time(5s), average($num))
works fine.
So it seems I can't accumulate over the list. But would be quite handy if I
had more than one accumulation to do and didn't want to rewrite all the
constraints in each accumulation statement. I could just use the list, but
that results in the exception below.
Exception in thread "Thread-5" org.drools.RuntimeDroolsException: Unexpected
exception executing action
org.drools.rule.SlidingTimeWindow$BehaviorExpireWMAction@46fef3
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1473)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1159)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:1123)
at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:917)
at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:251)
at trafficsys.SessionInterface.insertAndFire(SessionInterface.java:144)
at
trafficsys.cep.SensorEventGenerator.generateEvents(SensorEventGenerator.java:80)
at de.trafficsimulation.MicroStreet.update(MicroStreet.java:393)
at de.trafficsimulation.SimCanvas.run(SimCanvas.java:401)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at org.drools.reteoo.AccumulateNode.getFirstMatch(AccumulateNode.java:967)
at org.drools.reteoo.AccumulateNode.splitList(AccumulateNode.java:920)
at
org.drools.reteoo.AccumulateNode.removePreviousMatchesForLeftTuple(AccumulateNode.java:874)
at
org.drools.reteoo.AccumulateNode.retractLeftTuple(AccumulateNode.java:205)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.doPropagateRetractLeftTuple(CompositeLeftTupleSinkAdapter.java:238)
at
org.drools.reteoo.CompositeLeftTupleSinkAdapter.propagateRetractLeftTupleDestroyRightTuple(CompositeLeftTupleSinkAdapter.java:138)
at
org.drools.reteoo.AccumulateNode.retractLeftTuple(AccumulateNode.java:212)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:217)
at
org.drools.reteoo.SingleLeftTupleSinkAdapter.propagateRetractLeftTuple(SingleLeftTupleSinkAdapter.java:91)
at
org.drools.reteoo.AccumulateNode.evaluateResultConstraints(AccumulateNode.java:648)
at
org.drools.reteoo.AccumulateNode.removePreviousMatchesForRightTuple(AccumulateNode.java:903)
at
org.drools.reteoo.AccumulateNode.retractRightTuple(AccumulateNode.java:303)
at
org.drools.rule.SlidingTimeWindow.expireTuples(SlidingTimeWindow.java:167)
at
org.drools.rule.SlidingTimeWindow$BehaviorExpireWMAction.execute(SlidingTimeWindow.java:329)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1471)
... 9 more
--
View this message in context: http://drools-java-rules-engine.46999.n3.nabble.com/Accumulating-over-a-l...
Sent from the Drools - User mailing list archive at Nabble.com.
15 years, 4 months
Drools: Compound Value Restriction in Decision Table
by David Smith
Hi,
I am pocing/learning drools and I am trying to implements Compound Value
Restrictions using 'In' in a decision table.
I can do this in a rule like
rule "CoverType Example"
when
$risk : Data( coverType in ("A","B", "C", "D"))
then
result.add("CoverType was one of A, B C or D");
end
I can also implement this in a decision table in a long winded fashion
Condition, Action
Data, result
coverType, add("$param")
A, CoverType was one of A, B C or D
B, CoverType was one of A, B C or D
C, CoverType was one of A, B C or D
D, CoverType was one of A, B C or D
Is there a compact way to do this using a Compound Value Restriction using
in?
Something like:
Condition, Action
Data, result
coverType in, add("$param")
"A,B,C,D", CoverType was one of A, B C or D
What goes in the script part "coverType in"?
The number of items in the list can be variable, so don't want to write
something that has $1, $2, $3, $4
Thanks
David
15 years, 4 months