drools-spring and drools-guice
by Mark Proctor
I'd like to add two sub projects to Drools to enable better spring and
guice support - especially now we have the RuleAgent. Any volunteers for
this? I'd like to try and standardise, as much as possible, how Drools
works and integrates with IoC containers.
Ultimiately the integration should be quite lightweight - mostly about
creating rulebases and working memory and probably the scoping and
caching of these. I guess you could also have some life cycle management
about objects themselves and auto assertion/retraction to named working
memories. We'd need to define a set of agreed annotations to define
these things, that would work across containers. I believe the JBoss MC
people have done some work in this area, I have cc'd to see if they have
any input or documentation pointers.
The core dev team don't have the time and aren't spring/guice
specialists - so anyone willing to take this up? If we can get
reasonable implementations we will add them to subversion (and the
authors commit rights), and make part of the next release - assuming
they are of good enough quality.
So any takers, maybe we could atleast start at defining what this level
of integration should look like?
Mark
16 years, 7 months
Possible deadlock problem with update in place rules
by Zoltan Farkas
I use a Ruleagent with the following params
(rules.properties):
localCacheDir=.
url=.
poll=30
name=eventexpertrules
Here is my session initialization:
RuleAgent agent = RuleAgent.newRuleAgent("/rules.properties");
RuleBase retValue = agent.getRuleBase();
final RuleBase ruleBase = agent.getRuleBase();
session = ruleBase.newStatefulSession();
DroolsLogger drlogger = new DroolsLogger(session); // add logger
//Insert Event Processor Instance as global
session.setGlobal("processor", this);
Here is the stack trace of the thread that updates the rule base
"Timer-2" daemon prio=3 tid=0x0000000002356800 nid=0x24 waiting for monitor entry [0xfffffd7fe28b7000..0xfffffd7fe28b7a20]
java.lang.Thread.State: BLOCKED (on object monitor)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)
- waiting to lock <0xfffffd7feb474680> (a org.drools.reteoo.ReteooStatefulSession)
at org.drools.base.FireAllRulesRuleBaseUpdateListener.beforeRuleBaseUnlocked(FireAllRulesRuleBaseUpdateListener.java:29)
at org.drools.event.RuleBaseEventSupport.fireBeforeRuleBaseUnlocked(RuleBaseEventSupport.java:168)
at org.drools.common.AbstractRuleBase.unlock(AbstractRuleBase.java:351)
at org.drools.agent.PackageProvider.applyChanges(PackageProvider.java:73)
at org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:320)
at org.drools.agent.RuleAgent$2.run(RuleAgent.java:438)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Here is the stack trace of my application that basically inserts facts and fires rules .
"ActiveMQ Session Task" daemon prio=3 tid=0x0000000002564400 nid=0x142e in Object.wait() [0xfffffd7fe01dd000..0xfffffd7fe01ddaa0]
java.lang.Thread.State: WAITING (on object monitor)
at java.lang.Object.wait(Native Method)
- waiting on <0xfffffd7feb49a9e0> (a org.drools.util.concurrent.locks.ReentrantLock$NonfairSync)
at java.lang.Object.wait(Object.java:485)
at org.drools.util.concurrent.locks.ReentrantLock$NonfairSync.lock(ReentrantLock.java:106)
- locked <0xfffffd7feb49a9e0> (a org.drools.util.concurrent.locks.ReentrantLock$NonfairSync)
at org.drools.util.concurrent.locks.ReentrantLock.lock(ReentrantLock.java:195)
at org.drools.common.AbstractWorkingMemory.getGlobal(AbstractWorkingMemory.java:397)
at com.daxtechnologies.optima.fault.eventprocessor.Rule_EventForwarder_0ConsequenceInvoker.evaluate(Unknown Source)
at org.drools.common.DefaultAgenda.fireActivation(DefaultAgenda.java:550)
- locked <0xfffffd7feb49a3f8> (a org.drools.common.DefaultAgenda)
at org.drools.common.DefaultAgenda.fireNextItem(DefaultAgenda.java:514)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:471)
- locked <0xfffffd7feb474680> (a org.drools.reteoo.ReteooStatefulSession)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)
- locked <0xfffffd7feb474680> (a org.drools.reteoo.ReteooStatefulSession)
at com.daxtechnologies.optima.fault.eventprocessor.fault.level2.maps.EventExpertProcessor.processEventVO(EventExpertProcessor.java:147)
- locked <0xfffffd7feb474a18> (a com.daxtechnologies.optima.fault.eventprocessor.fault.level2.maps.EventExpertProcessor)
at com.daxtechnologies.optima.fault.eventprocessor.fault.level2.maps.EventExpertProcessor.doProcessEvent(EventExpertProcessor.java:70)
As you see both threads wait for something.
thanks
--zoly
16 years, 9 months
Teensy spelling error in drools project template
by Greg Barton
In the DroolsTest.java file created by the drools new
project template in Eclipse, there's a teensy spelling
error. The comment:
//this wil parse and compile in one step
...should read...
//this will parse and compile in one step
It shows up in a few files:
documentation/manual/en/Chapter-Examples/Section-Examples.xml
drools-eclipse/drools-eclipse-plugin/src/main/resources/org/drools/eclipse/wizard/project/RuleFlowLauncherSample.java.template
drools-eclipse/drools-eclipse-plugin/src/main/resources/org/drools/eclipse/wizard/project/RuleLauncherSample.java.template
drools-examples/drools-examples-drl/src/main/java/org/drools/examples/sudoku/rules/DroolsUtil.java
drools-examples/drools-examples-drl/src/main/java/org/drools/examples/HelloWorldExample.java
Cheers,
GreG
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
16 years, 9 months
tabs (\t) in pom.xml files
by Geoffrey De Smet
Some of Drools source code has a bunch of \t characters in it.
Some might cause havoc some day, like this one in Scenario.java:
public int\t\tmaxRuleFirings = 100000;
Others are pretty annoying, as they mess up the identitation of the
files on fisheye and make it hard to analyze diffs.
Would you mind terrible if I (or anyone else) replace all \t chars in
the pom.xml files (I don't care about the other files) with 2 spaces on
trunk?
There are not that many tabs in those though :)
BTW:
I've had an issue with a plugin upgrade of Eclipse at work, in which it
overwrote my old tab policy and enabled tabs instead of spaces again.
Maybe some of you have it too?
--
With kind regards,
Geoffrey De Smet
16 years, 9 months
drools-core/repository in subversion
by Geoffrey De Smet
Someone checked in drools-core/repository on the trunk,
which is a simple mistake to make, because:
- it's not ignored (I)
- it's not suppose to be added (A)
So svn doesn't know what to do with it (?) and ask every time.
I don't understand why these maps need to be created in the first place:
drools-core/repository
drools-solver/repository
drools-solver/drools-solver-core/repository
It's a BRMS thing, but I am pretty sure drools solver doesn't need that
map :) Can't it be moved under target so it doesn't bother us anymore?
Thanks :)
--
With kind regards,
Geoffrey De Smet
16 years, 9 months
Status of CEP Work?
by Matt Kendall
I've been reading the mailing list archives and I've even checked out
the temporal_rete branch from SVN. A lot of the work looks promising,
and it looks like a good bit has been accomplished. What I'm trying to
determine is how close Drools is
to having comprehensive CEP capability. I ask because I have a project
that would benefit from the performance enhancements of a Rete engine,
but I can get by (in the short term) without those enhancements. From
looking at the JUnits, it looks like the relational operators and time
windows are still under active development? I may be able to help out
(subject to the approval of my employer) if CEP is close to
completion.
Thanks!
Matt
16 years, 9 months
Re: rules-dev Digest, Vol 14, Issue 2
by siddhartha banik
Hi,
Sorry, the Problem statement did not come with the attchment.
The problem is:
I am serializing working memory(WM). But after deserializing that, if I try
to modify the corresponding RuleBase that is not getting reflected.
I mean, after loading the serialized WM even I add a package to the
corresponding RuleBase, new Rules are not getting fired for newly added
facts. Or I remove a package from the corresponding RuleBase, even removed
Rules are getting fired for newly added facts.
So, Once WM is deserialized any chage to the corresponding RuleBase is
failing.
I have attached the test program & test rules.
Thanks
Siddhartha
On 2/6/08, rules-dev-request(a)lists.jboss.org <
rules-dev-request(a)lists.jboss.org> wrote:
>
> Send rules-dev mailing list submissions to
> rules-dev(a)lists.jboss.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.jboss.org/mailman/listinfo/rules-dev
> or, via email, send a message with subject or body 'help' to
> rules-dev-request(a)lists.jboss.org
>
> You can reach the person managing the list at
> rules-dev-owner(a)lists.jboss.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of rules-dev digest..."
>
>
> Today's Topics:
>
> 1. Facing Problem with Working Memory
> Serialization/DeSerialization (siddhartha banik)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 6 Feb 2008 10:07:50 +0530
> From: "siddhartha banik" <siddhartha.banik(a)gmail.com>
> Subject: [rules-dev] Facing Problem with Working Memory
> Serialization/DeSerialization
> To: rules-dev(a)lists.jboss.org
> Message-ID:
> <c3d0203e0802052037j720df8f0ge33a7fec61953265(a)mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Skipped content of type multipart/alternative-------------- next part
> --------------
> A non-text attachment was scrubbed...
> Name: attach.zip
> Type: application/zip
> Size: 6367 bytes
> Desc: not available
> Url :
> http://lists.jboss.org/pipermail/rules-dev/attachments/20080206/745452f4/...
>
> ------------------------------
>
> _______________________________________________
> rules-dev mailing list
> rules-dev(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-dev
>
>
> End of rules-dev Digest, Vol 14, Issue 2
> ****************************************
>
16 years, 10 months
BRMS and Fit for Rules
by Paul Browne
As part of the some 'stuff' (you may be able to guess!) found myself
needing to integrate FIT for Rules and the BRMS. No big deal in doing
the integration, just plugged in a new BRMSEngine fixture instead of the
existing Engine fixture.
Two questions
a) This code is generic - would you be interested in a copy for the Fit
for Rules project? There are other (minor) updates to the code.
or
b) Do you have something big up your sleeve that will (soon) make this
redundant (i.e. the QA Tab on the BRMS). Trouble is , would like to
write this up now(!). Am I right in assuming the 'QA' tab will
effectively be Fit for Rules integrated into the BRMS? (in which case
the samples will be easy to port later).
Ta
Paul
16 years, 10 months
Facing Problem with Working Memory Serialization/DeSerialization
by siddhartha banik
Hi,
I am serializing working memory(WM). But after deserializing that, if I try
to modify the corresponding RuleBase that is not getting reflected.
I mean, after loading the serialized WM even I add a package to the
corresponding RuleBase, new Rules are not getting fired for newly added
facts. Or I remove a package from the corresponding RuleBase, even removed
Rules are getting fired for newly added facts.
So, Once WM is deserialized any chage to the corresponding RuleBase is
failing.
I have attached the test program & test rules.
Thanks
Siddhartha
16 years, 10 months