Re: [rules-users] Rules writing best practice?

2010-02-09 Thread Pegram, Macon
Regarding your comment for DAO's in the WHEN clause. I'd say that's a very strong anti-pattern. In general our approach has been to look for the absence of the fact being inserted, and move the DAO call into the THEN clause. I'm sure you're thinking, "what if my DAO doesn't return anything?"

Re: [rules-users] prevent infinite loops

2010-02-01 Thread Pegram, Macon
We have used a "BreadCrumb" fact to avoid this in the past. We had a situation where there wasn't a direct loop (rule A triggering rule A) but rather a trifecta of facts (Rule A triggers Rule B which trigger Rule C which triggered Rule A). To solve for this we created a simple "RuleBreadCrumb"

Re: [rules-users] Does rule execution block when the Knowlege Agent is rebuild KnowlegeBase???

2010-01-27 Thread Pegram, Macon
We've tested this behavior under load and there is a brief (duration of about 1 - 1.5 seconds) uptick when the rulebase switch happens, but we noticed consistent and rapid recovery. I have not confirmed this but I believe what happens is a new KnowledgeBase is built, and once it's build is complet

Re: [rules-users] KnowledgeAgent doesn't load dsl files and dslrfile from a change-set correctly - JIRA:JBRULES-2377 updated

2010-01-27 Thread Pegram, Macon
e: [rules-users] KnowledgeAgent doesn't load dsl files and dslrfile from a change-set correctly - JIRA:JBRULES-2377 updated I think it is related with https://jira.jboss.org/jira/browse/JBRULES-2350 On Wed, Jan 27, 2010 at 1:20 AM, Pegram, Macon wrote: I have updated the JIRA ticket with more

Re: [rules-users] KnowledgeAgent doesn't load dsl files and dslr file from a change-set correctly - JIRA:JBRULES-2377 updated

2010-01-26 Thread Pegram, Macon
I have updated the JIRA ticket with more detailed information. If this issue is important to you, please vote up its importance so that we can hopefully capture the attention of the development team. You can find the JIRA ticket at: https://jira.jboss.org/jira/browse/JBRULES-2377 Thanks! Macon

Re: [rules-users] KnowledgeAgent doesn't load dsl files and dslr file from a change-set correctly

2010-01-26 Thread Pegram, Macon
I did my trace (which led to the comments below) on 5.1M1, but the I noticed the problem originally on 5.0.1 so I don't believe there's any version that will work for you at this time. Macon -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jbo

Re: [rules-users] KnowledgeAgent doesn't load dsl files and dslr file from a change-set correctly

2010-01-26 Thread Pegram, Macon
That's actually my ticket, and I've been hoping to get it resolved for awhile now. I've posted to this mailing list as well as the actual ticket but haven't heard responses from anyone. I've recently done more research into the issue, and have some updated information that needs to be attached

Re: [rules-users] Testing individual rules

2009-12-02 Thread Pegram, Macon
Yes... We've used a combination of JUnit, and Easymock to test individual rules. At a very high level, we do the following: - In the static setupBeforeClass() method we construct a KnowledgeBuilder, load any necessary rule files, and construct a KnowledgeBase using the KnowledgeB

[rules-users] Can DSL / DSLR be loaded in a changeset?

2009-10-29 Thread Pegram, Macon
All, I asked this question earlier this week, but didn't get a response. I may have provided too much information, so let me distill it down to this simple question Can DSL/DSLR files be loaded and accessed as part of a KnowledgeBase constructed using the KnowledgeAgent / changeset mo

Re: [rules-users] Is there any way to hook-up Drools 4.0 RuleBase(session) to a Drools 5.0 KnowledgeBase (session) ??

2009-10-27 Thread Pegram, Macon
To accomplish this is largely a "renaming" operation. They are syntactically the same. I did a similar thing a few months ago and it mostly involved renaming everything from RuleXXX to KnowledgeXXX. From: rules-users-boun...@lists.jboss.org [mailto:rules-u

[rules-users] DSL, DSLR and Changesets...

2009-10-26 Thread Pegram, Macon
All, Are DSL and DSLR files supported by the KnowledgeAgent / Changeset code. Here's the details of my test case: I have a Changeset file I'm trying to load which looks like the following: There's a single DSL and a single DSLR file in this folder.

Re: [rules-users] Rule is not firing

2009-10-26 Thread Pegram, Macon
Assuming a proper classpath, the attached jar file runs from the commandline. java -cp test-case.jar TestDrive I suspect your issue may stem from the setup code calling your rule instead of the rules themselves. I've included source code in the jar file, but I'll include it inline in this

[rules-users] New DSL question...Interpreting constants...

2009-10-22 Thread Pegram, Macon
Given the following rules (contrived example): rule "Monetary 1" when Currency(typeID in (CurrencyConst.DOLLAR, CurrencyConst.EURO, CurrencyConst.YEN)) then insert(new Fact()); end rule "Monetary 2" when Currency(typeID in (C

Re: [rules-users] DSL questions....

2009-10-22 Thread Pegram, Macon
ot get any overhead at runtime because all the interpretation happens at compilation, as you says lucaz El 22/10/2009, a las 11:28, Pegram, Macon escribió: All, Given the following rule: rule "Add ABC123 Feature" when not MyFeature(testCD == &quo

[rules-users] DSL questions....

2009-10-22 Thread Pegram, Macon
All, Given the following rule: rule "Add ABC123 Feature" when not MyFeature(testCD == "ABC123") UserRequest(someValue == "ABC123_FEATURE") $eligible : FeatureEligible(testCD == "ABC123") then insert(new MyFeature($eligible));

Re: [rules-users] How to deploy Guvnor on Weblogic 9.x / 10.x - Fixing depdencies

2009-10-16 Thread Pegram, Macon
libs inside the war. 2009/10/16 Pegram, Macon I was asked how I deployed Guvnor on Weblogic 10.x. I believe the procedure will be the same for both 9.x and 10.x... You will have to make some changes to the WAR file. 1. Create a weblogic.xml file like the one below and put it in W

[rules-users] How to deploy Guvnor on Weblogic 9.x / 10.x

2009-10-16 Thread Pegram, Macon
I was asked how I deployed Guvnor on Weblogic 10.x. I believe the procedure will be the same for both 9.x and 10.x... You will have to make some changes to the WAR file. 1. Create a weblogic.xml file like the one below and put it in WEB-INF\ http://www.bea.com/ns/weblogic/weblogic-w

Re: [rules-users] Drool 5 API and Agenda Listeners

2009-10-12 Thread Pegram, Macon
ouldn't do me any good. Do you see why I'm having trouble doing anything useful with the new API? In Drool 5, are you supposed to approach this in a different way (not in an agenda listener?) Pegram, Macon wrote: > > The primary reason to move to the "Knowledge APIs" ap

Re: [rules-users] Drool 5 API and Agenda Listeners

2009-10-11 Thread Pegram, Macon
The primary reason to move to the "Knowledge APIs" apart from what you've already mentioned is that they help to bring together the newest features of Drools. In a single KnowledgeBase you can now have not only rules, but Flows, and Complex Event Processing. As to tracking activity on the agen

Re: [rules-users] (no subject)

2009-10-01 Thread Pegram, Macon
What you need to do is implement your own SystemEventListener implementation to override the default one. Before you do anything meaningful with Drools, you'll want to override the default by calling: SystemEventListenerFactory.setSystemEventListener(); Here's a basic no-op listener:

Re: [rules-users] Push model for rule updates?

2009-09-29 Thread Pegram, Macon
There are a host of other options. You just need some way to make your resources available via a URL of some type. The Rules resources could just as easily be deployed in a web server, FTP or in Guvnor. -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-bou

Re: [rules-users] Push model for rule updates?

2009-09-29 Thread Pegram, Macon
It's actually not terribly difficult to pull off. The key things you'll want to do are: - Initialize and start the ResourceChangeNotifierService. - Initialize but DO NOT start the ResourceChangeScanner service. - Determine how you're going to trigger your rescan. -

Re: [rules-users] persistent java objects in working memory

2009-09-24 Thread Pegram, Macon
Chris, I believe in one of your earlier emails you said that there were several MyDataObject instances in working memory. (I seem to recall you saying there were 3). When you do an "update" (or a retract, or insert) you're notifying Drools that the state of it's working memory has changed.

Re: [rules-users] Support on Weblogic?

2009-09-23 Thread Pegram, Macon
users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Mel Odeus Sent: Wednesday, September 23, 2009 4:23 PM To: Rules Users List Subject: Re: [rules-users] Support on Weblogic? May i ask what kind of application you use drools for? 2009/9/23 Pegram, Macon I am

Re: [rules-users] Support on Weblogic?

2009-09-23 Thread Pegram, Macon
n Wed, Sep 23, 2009 at 3:52 PM, Pegram, Macon wrote: The short answer is "YES". I have had success running both Guvnor and a Drools application on Weblogic. Guvnor took a little configuration, but it will run on Weblogic. As for straight Drools... It's just an API, so there

Re: [rules-users] Support on Weblogic?

2009-09-23 Thread Pegram, Macon
The short answer is "YES". I have had success running both Guvnor and a Drools application on Weblogic. Guvnor took a little configuration, but it will run on Weblogic. As for straight Drools... It's just an API, so there's nothing special about it that should present a problem for any type of

Re: [rules-users] KnowledgeAgent Log Level

2009-09-11 Thread Pegram, Macon
I had been wondering the same thing, so I finally decided to take a look @ the Drools source. These log message are provided by the SystemEventListener interface. There's no direct way (that I can see) in the code to set and enforce an actual "log level" (Someone please tell me I'm wrong h

Re: [rules-users] Looking for attributes on an element obtainedfroma Map

2009-08-21 Thread Pegram, Macon
p ($item : this[$upc] != null) from $stock Item (onSale == true) from $item then // Buy stuff End -Original Message- From: rules-users-boun...@lists.jboss.org [mailto:rules-users-boun...@lists.jboss.org] On Behalf Of Pegram, Macon Sent: Friday, August 21, 2009 2:15 PM To: Rule

Re: [rules-users] Looking for attributes on an element obtainedfrom a Map

2009-08-21 Thread Pegram, Macon
upc : upc != null) Item(onSale == true, upc == $upc) then Buy stuff end --- On Fri, 8/21/09, Pegram, Macon wrote: > From: Pegram, Macon > Subject: [rules-users] Looking for attributes on an element obtained from a > Map > To: &quo

[rules-users] Looking for attributes on an element obtained from a Map

2009-08-21 Thread Pegram, Macon
I was hoping the recent conversation regarding maps this would come up, but so far it hasn't. How do I check for conditions on the element referenced in the map? So given the following scenario: SearchItem is the item being searched for by the user Item has the attributes: UPC

Re: [rules-users] Hooray! Re: Drools library - updating Drools jar

2009-08-20 Thread Pegram, Macon
se, but I think that did it. If it reverts back to the old problem, I will try your brand new runtime folder suggestion then, Macon. Thanks again for everyone's help. Edson Tirelli-3 wrote: > >Cool, living and learning! Thanks, > >Edson > > 2009/8/20 Pegram,

Re: [rules-users] Drools library - updating Drools jar

2009-08-20 Thread Pegram, Macon
There's another way. In the Eclipse Plugin Preferences (Eclipse -> Preferences -> Drools -> Installed Drools Runtime) you point to the location of the Drools runtime you want to use. If you swap out the MVEL file at the location of your Drools Runtime it should pick up the right version of

[rules-users] Is "emptieness" supported in Drools 5 (LHS)

2009-08-18 Thread Pegram, Macon
According to MVEL they've added a convenience for checking the "emptiness" of a value (see: http://mvel.codehaus.org/Value+Tests ) In MVEL you'd simply write: myMap == empty This seemed like a MUCH cleaner way to write some of the LHS of the rules, so I thought I'd try it out. Given