StatefulKnowledgeSessions
by alim
Hi everyone,
I'm trying to find a solution to the following situation:
- KnowledgeBase with approx. 1000 rules
- Approx. 200 users (hence 200 simultaneous sessions) whereas each session
might most likely have different values for the working memory facts
So let's say we create a KnowledgeBase (with those 1000 rules) and out of
this one KnowledgeBase we create for each existing session its own
StatefulKnowledgeSession.
Now, how expensive (memory-wise) are these StatefulKnowledgeSessions? Is it
reasonable to have more than just a few StatefulKnowledgeSessions?
Or is there an other, better approach?
Thank you very much!
--
View this message in context: http://n3.nabble.com/StatefulKnowledgeSessions-tp688305p688305.html
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months
(Urgent) Runtime error: java.lang.RuntimePermission createClassLoader
by Gaurav
Hi All,
I need urgent help in resolving this run time error.
This is the first time we are deploying drools to websphere 6.1 and getting
following error.
Our organization does not allow us to do 'createClassLoader' in was.policy.
Can some one please help.
java.security.AccessControlException: Access denied
(java.lang.RuntimePermission createClassLoader)
at
java.security.AccessController.checkPermission(AccessController.java:108)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:558)
at
com.ibm.ws.security.core.SecurityManager.checkPermission(SecurityManager.java:212)
at
java.lang.SecurityManager.checkCreateClassLoader(SecurityManager.java:620)
at java.lang.ClassLoader.<init>(ClassLoader.java:136)
at
org.drools.rule.CompositeClassLoader.<init>(CompositeClassLoader.java:16)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:249)
at org.drools.compiler.PackageBuilder.<init>(PackageBuilder.java:142)
at
org.drools.builder.impl.KnowledgeBuilderProviderImpl.newKnowledgeBuilder(KnowledgeBuilderProviderImpl.java:29)
at
org.drools.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:29)
Thanks,
Gaurav
--
View this message in context: http://n3.nabble.com/Urgent-Runtime-error-java-lang-RuntimePermission-cre...
Sent from the Drools - User mailing list archive at Nabble.com.
14 years, 9 months
Performance of compiler
by Christian Nedregård
Hi.
My environment: Win XP SP3, 2x2.13 GHz cpu, 3GB RAM, Drools 4.0.7, JDK
1.4.2_11, java compiler: JANINO, dialect: java.
We have about 850 drl's with 5 - 10 conditions in each. 0 -2 evals in each.
The drl's only contain one rule each.
We are using Drools programatically by compiling the drls using
PackageBuilder.addPackageFromDrl and adding them to a RuleBase using
RuleBase.addPackage(PackageBuilder.getPackage())
When we are building our rule base we are never able to compile more than 1
-2 rules per second, which means we need over 10 minutes (at 100% cpu) to
build our rulebase.
Profiling shows 68% cpu time in
org.drools.rule.builder.GroupElementBuilder.build and 18% cpu time in
org.codehaus.janino.Compiler.compile.
We have experimented by changing the compiler to ECLIPSE and the dialect to
mvel but the results are the same.
We have experimented using one PackageBuilder instance per drl or grouping
drls by package and sharing a builder per package. Same result in both
scenarios.
We have also expermimented with compiling concurrently in serveral threads.
Again, about the same result.
My question is: Is this the performance we can expect from the compiler or
are we doing something fundamentally wrong?
Below is an example of one of our drls. This one contains no evals, but
still takes more than 1 second to compile. If anyone can spot some issues
with the way we are doing things the feedback would be much apreciated :)
------------------------------------
package domain.core.productoffer.rules.subscriptiontype
import type.productoffer.ProductOfferRuleEvent
import domain.core.subscription.Subscription
import domain.core.subscription.SubscribedService
import type.subscription.ActionTypeEnum
import domain.core.productoffer.ProductOffer
import domain.rules.RuleEvent
global domain.core.productoffer.RuleValidationReport validationResult
rule "RequiredVProducts"
when
ProductOfferRuleEvent(id == '3')
ProductOffer(id.value == 31963)
$subscription:Subscription()
not ( SubscribedService(status != ActionTypeEnum.REMOVE_CANCEL &&
productId.value in (57, 69) ) from
$subscription.getAllChildSubscribedServices())
then
validationResult.addValidationMessage("2069", "For product offer
rule event with id '3' and product offer with id=31963 subscription must
have one of the following VProducts: 57, 69.");
end
------------------------------------
Regards
Christian Nedregård
14 years, 9 months
refactoring drools
by Franz Schwab
Hi,
I'm a computer science student and am writing the related-work part for
my diploma thesis and would be interested in (scientific) papers or
information about refactoring or transformation possibilities which can
be done with drools / jboss rules. I have to admit that I never worked
with one of them, as I said I just need that for the related-work part.
Could you please give me some hints?
Thanks,
Franz
14 years, 9 months
refactoring drools
by Franz Schwab
Hi,
I'm a computer science student and am writing the related-work part for
my diploma thesis and would be interested in (scientific) papers or
information about refactoring or transformation possibilities which can
be done with drools / jboss rules. I have to admit that I never worked
with one of them, as I said I just need that for the related-work part.
Could you please give me some hints?
Thanks,
Franz
14 years, 9 months
Sliding Windows - Error
by Paul R.
Hi,
I'm using an accumulate on a sliding window to count the number of events,
which occur in a 30 second window;
the events are inserted every 5 seconds - so with a 30 second window, I
would expect 6 events to occur.
The rule below never fires, though from the log output, it looks as though
the condition has matched successfully?
declare Foo
@role ( event )
@expires ( 60s )
@timestamp ( date )
end
rule "Count Foo"
when
c : Number(intValue > 5) from accumulate
$f : Foo()
over window:time ( 30s )
from entry-point ChannelDataStream,
count($f))
then
System.out.println("Count [30s] = " + c);
end
OBJECT ASSERTED value:com.test.DroolsTest$Foo@c52200 factId: 1
OBJECT ASSERTED value:com.test.DroolsTest$Foo@128edf2 factId: 3
OBJECT ASSERTED value:com.test.DroolsTest$Foo@1dddba factId: 4
OBJECT ASSERTED value:com.test.DroolsTest$Foo@c7e8a7 factId: 5
OBJECT ASSERTED value:com.test.DroolsTest$Foo@7b4703 factId: 6
ACTIVATION CREATED rule:Count Foo activationId:Count Foo [2, 0]
declarations: c=6(2)
OBJECT ASSERTED value:com.test.DroolsTest$Foo@1732ed2 factId: 7
ACTIVATION CANCELLED rule:Count Foo activationId:Count Foo [2, 0]
declarations: c=6(2)
ACTIVATION CREATED rule:Count Foo activationId:Count Foo [2, 0]
declarations: c=6(2)
OBJECT ASSERTED value:com.test.DroolsTest$Foo@be76c7 factId: 8
ACTIVATION CANCELLED rule:Count Foo activationId:Count Foo [2, 0]
declarations: c=6(2)
ACTIVATION CREATED rule:Count Foo activationId:Count Foo [2, 0]
declarations: c=6(2)
Can anybody explain why this is happening? I've attached a test case, which
demonstrates the problem.
Thanks in advance.
- Paul
14 years, 9 months
User and/or Code problem with insert/retract and salience
by Jared Davis
We have 5 rules that are firing out of salience order for a particular set
of 4 objects. The rules have a branch on the RHS which sometimes retracts
the A object. There are reasons why the branch is not in the LHS not shown
in this sample.
The 5 rules are like the following. The salience values
are 70, 65, 60, 55, 50
rule "a1"
salience 70
agenda-group "b"
when
a: A(name customevaluator "X")
B(name = "B")
then
// sometimes retract
end
There is one B object.
Another rule fires (at salience 0) and inserts 4 A objects.
1) A1 runs rule at salience 70 and is retracted
2) A2 runs rule at salience 70 and is not retracted
3) A3 runs rule at salience 70 and is retracted
4) A4 runs rule at salience 70 and is not retracted
5) A4 runs rule at salience 65 and is retracted
6) A2 runs rule at salience 50 and is retracted
I would have expected step 6 to have A2 run at salience 65 but instead it
went from 70 to 50 skipping 60 and 65. Is my understanding of the rule
rhs firing order wrong?
I'm using a 5.1 snapshot from Dec 23 2009.
I searched the JIRA and did not see anything related.
14 years, 9 months
The "true modify" algorithm - less memory usage, more performance
by Edson Tirelli
Hey all
First of all, I am sorry if I haven't answered many of the e-mails lately
in the list (although I am glad that more and more users are stepping up and
helping others). The reason was we were really busy developing a major
improvement to the Drools algorithm during the last few months and that will
be available in Drools 5.1. For those that haven't seen it yet, we call it
"True Modify" for the lack of a better name:
http://blog.athico.com/2010/03/drools-halves-memory-use-with-new-true.html
The gains are totally dependent on use cases, but if your application
makes heavy use of update/modify on facts, then you will definitively see
major improvements on memory usage and a nice improvements on performance.
In that particular example we reported in the blog (Drools Planner
Examination Benchmark App) we got ~35% perf improvement and a huge memory
usage improvement: while the original algorithm reached the threshold for
"Full GC" 5 times, the new algorithm never reached the threshold (running
with -Xms256M -Xmx256M).
The reason for this e-mail is that we have a limited set of test
applications we can run here and I am looking for users that could give the
new algorithm a try to make sure we got everything covered before we release
5.1 final. From a users perspective, it should be 100% backward compatible,
so what I am looking for is for people that can run a benchmark (perf and
memory usage) of your use case using 5.0.1, then using the snapshot from
trunk, make sure the application ran successfully and provide feedback on
the perf/memory usage differences.
Ping me if you are able to run such a benchmark.
Thanks,
Edson
--
Edson Tirelli
JBoss Drools Core Development
JBoss by Red Hat @ www.jboss.com
14 years, 9 months
Guvnor 5.0 DSL Validation bug (Internet Explorer only)
by Paul R.
Guided Rule validation fails in Guvnor (Internet Explorer only), when Guided
rule contains DSL components.
It looks as though the LHS of the DSL isn't being substituted with the RHS
when validating.
I can't find a JIRA for this, does anybody know whether it's fixed in 5.1
M1?
Thanks and Regards,
Paul
14 years, 9 months