Re: [rules-users] Reusing Rules in a Rule Flow?

2010-08-03 Thread Michael Rhoden
Have you looked at "extends" keyword? You could use a base rule and  
extend it for ruleflows. Not positive it would work for your needs,  
but possibly.

-Michael

On Aug 3, 2010, at 1:59 PM, Jason Davidson   
wrote:

> Is it possible to use a rule in a rule flow without a "ruleflow- 
> group"?
>
> Here's our use case:  We have a base set of rules that are not part of
> a ruleflow-group.  But we want to allow the administrators of the
> system to build custom rule flows that reuse these existing base
> rules.  In most instances the "base" rules will be fired but in some
> instances the ruleflow will be executed too.
>
> What's the best way to reuse a rule in this case?
>
> Thanks!
> Jason
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] fireAllRules performance

2010-07-30 Thread Michael Rhoden
Probably not, work is done on insert not fire. Fire just shows what is  
on the agenda.

-Michael

On Jul 30, 2010, at 8:32 AM, sjoo822  wrote:

>
> I have several thousand objects that gets inserted into a statefull  
> knowledge
> session as show below:
>
>   for (Item item : itemList)
>   {
> session.insert(item);
>   }
>
>   session.fireAllRules();
>
>
> Assuming that all the conditions in the rules only concern with one  
> item at
> a time, will there be a big performance difference if I changed the  
> above to
> as shown below?
>
>  for (Item item : itemList)
>  {
>   session.insert(item);
>   session.fireAllRules();
>  }
> -- 
> View this message in context: 
> http://drools-java-rules-engine.46999.n3.nabble.com/fireAllRules-performance-tp1004415p1004415.html
> Sent from the Drools - User mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools with Guvnor

2010-05-19 Thread Michael Rhoden
Yes and no . Guvnor uses a JCR repository (the default is 
http://jackrabbit.apache.org/) which can not be accessed using hibernate 
directly. We ran into this issue, and the only way to use guvnor as of 6 months 
ago was to have a user go into guvnor and create a DRL file by clicking a few 
buttons. Not a big deal, but it isn't automated. You can then use that DRL as a 
resource in your application. I know there was some working being done to be 
able to pull out DRLs from Guvnor using xml calls, but don't know if that was 
ever completed. 

Michael Rhoden 


- Original Message - 
From: "bbarani"  
To: rules-users@lists.jboss.org 
Sent: Wednesday, May 19, 2010 5:12:57 PM 
Subject: [rules-users] Drools with Guvnor 


Hi, 

I am very new to Drools and very very new to Guvnor. 

I am in the process of creating a rule engine which will fetch the data from 
a source (I am using Hibernate framework to fetch the data) and evaluate the 
data using Drools rule engine. The rules supplied to the Drools rule engine 
are stored in a Rules table in a database. 

Now my question is that can I use Guvnor to store the rules (instead of me 
creating a rule data model) and use Guvnor to supply rules to my Drools 
engine? 

I am trying to find out the best possible way to create / manage a rule 
database (which stores all the rules). 

Thanks, 
BB 
-- 
View this message in context: 
http://drools-java-rules-engine.46999.n3.nabble.com/Drools-with-Guvnor-tp830453p830453.html
 
Sent from the Drools - User mailing list archive at Nabble.com. 
___ 
rules-users mailing list 
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users 
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Category Rules - Guvnor

2010-02-11 Thread Michael Rhoden
The category rule should just extend all child rules in that category.  
If all is working your generated DRL should have "extends" in the  
"tax" (etc) rules.

-Michael

On Feb 11, 2010, at 6:33 PM, Amit Kumar  wrote:

> Hi Folks,
>
> I am looking at the category rules and have a scenario to use it.  
> Goes like this
>
> Person
>Name  String
>City String
>income  int
>
> I want to categorize the rules in states
>
> -US
>-- NewYork
>-- Seatle
>-- SanFrancisco
>
>
> I have created 3 rules
> rule "people living in NY"
> when
>Person(city="NewYork"
> then
> end
>
> rule "people living in Seatle"
> when
>Person(city="Seatle"
> then
> end
>
> rule "people living in SFO"
> when
>Person(city="SanFrancisco"
> then
> end
>
> I associated the above rules with appropriate categories
>
>
> Then I create tax rules
>
> rule "ny tax" -- category "NewYork"
> when
>Person()
> then
>   Log .. Tax = 10%
> end
>
> rule "WA tax" -- category "Seatle"
> when
>Person()
> then
>   Log .. Tax = 20%
> end
>
> rule "ny tax" -- category "NewYork"
> when
>Person()
> then
>   Log .. Tax = 10%
> end
>
>
>
> When I create a object in test scenario of person type .. then all  
> the rules get executed..  The category rule is not having any effect
>
> Is there any documentation on how this works??
>
> Thanks
> Amit
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Server Sizing for Flow and Expert

2009-12-14 Thread Michael Rhoden
You won't need much horsepower. If anything I would go 64 bit and put  
6-8 gigs of ram in the box. CPU won't matter much.

We run 10k rules on an old dual core, but the rulebase takes 2.5 gigs  
of ram.

-Michael

On Dec 14, 2009, at 10:11 AM, Bruce Campbell  
 wrote:

> I will be starting a new project soon and my middleware folks need  
> to size a server for it.  Does anyone have any input as to how they  
> (middleware) can adjust their usual sizing exercise to account for  
> the use of Flow and Expert?  Here are some "facts" that may or may  
> not be relevant...
> We do not have any significant experience with Flow nor Expert
> We will be using the "current" release of Drools as of January 4th  
> 2010
> Websphere in the middle, Oracle in the back
> Our main Expert routine will run every 10 minutes and
>  will determine which of our 10-ish "flows" the work items will travel
>  may contain 500 - 1000 rules (guestimated by a noob)...
>  will process the rules once-through for each item in the batch  
> (little or no rule interactions)
>  a batch would typically contain 10- 100 items to process..
>  but could contain up to 300 after a severe outage.
>  batch size could be controlled if necessary.
>  and will likely run on the same server as the "Flow" application...
> Our internal web application will be primarily Flow driven with...
>50-ish user, 35 concurrent
>10 "flows" with simple to moderate complexity from a processing  
> perspective, mainly human tasks. (much of the time someone will  
> check a few boxes, add some comments, and the work item will flow to  
> the next step/person.)
> I'm hopeful someone can pipe in with how Flow and Expert change the  
> typical sizing exercise, however, I appreciate any input you may  
> have whether related to sizing or not..
> thanks in advance
> Bruce
>
>
> NOTICE: This email message is for the sole use of the intended  
> recipient(s) and may contain confidential and privileged  
> information. Any unauthorized review, use, disclosure or  
> distribution is prohibited. If you are not the intended recipient,  
> please contact the sender by reply email and destroy all copies of  
> the original message.
>
>
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] drl 2.0 invoking drl 6.0

2009-10-30 Thread Michael Rhoden
Convert it to XML on both sides. Drools 2 and 5 both support a xml input, for 
limited operators. Considering you are using 2.x you arent using anything that 
advanced. Section 6.9 of the Drools 4 manual discusses the xml interface (works 
the same in 5). 
http://downloads.jboss.com/drools/docs/4.0.7.19894.GA/html/index.html is the 
url. I'm sure you can find the drools 2 xml manual somewhere, but hopefully 
that will get you started. 

Michael Rhoden 
VP - IT Development 
Franklin American Mortgage Company 
Direct: 615-778-1117 
Fax: 615-778-2766 
Email: mrho...@franklinamerican.com 

- Original Message - 
From: "Peter Williams"  
To: rules-users@lists.jboss.org 
Sent: Friday, October 30, 2009 3:34:15 PM GMT -06:00 US/Canada Central 
Subject: [rules-users] drl 2.0 invoking drl 6.0 




Anyone think of an obvious way for a fixed (legacy) install of a system running 
2.x-era drools to pass control over to modern process (running drls 6). 



Would want to pass the fact base across efficiently, but not the active 
rules/agenda state etc 
___ rules-users mailing list 
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users ___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to create nested rules in Drool Guvnor

2009-08-13 Thread Michael Rhoden


You can do this using the "extends" keyword in your rule. 



Rule "shopping cart total exceeds 4000, give 50% discount" 
       when 
          
       then 
         
end 



Rule "if order between 6 to 9 pm give additional discount of 20 %" extends 
"shopping cart total exceeds 4000, give 50% discount" 

   when 
                
       then 
                
end 



You can also disable the first rule and just use "extends" to limit the amount 
of duplicate conditions in your rules. Note extends basically copies the 
conditions from the first rule to what is being extended, but I believe it will 
do what you are trying to do. 



Michael Rhoden 
VP - IT Development 
Franklin American Mortgage Company 
Direct: 615-778-1117 
Fax: 615-778-2766 
Email: mrho...@franklinamerican.com 

- Original Message - 
From: "Pardeep Ruhil"  
To: rules-users@lists.jboss.org 
Sent: Wednesday, August 12, 2009 2:44:38 PM GMT -06:00 US/Canada Central 
Subject: [rules-users] How to create nested rules in Drool Guvnor 


Hi, 
Thanks for replying. 

I have a scenario like 
Rule "shopping cart total exceeds 4000, give 50% discount" 
       when 
          
       then 
          
         call Rule"if order is  between 6 to 9 pm, give additional 
discount of 20 %" 
end 
Rule "if order between 6 to 9 pm give additional discount of 20 %" 
       when 
                
       then 
                
end 

.. 
Also i have a  query like, Can we make rule like this 

Rule "shopping cart total exceeds 4000 give 50% discount" 
       when 
                
       then 
                

               Rule "if order between 6 to 9 pm give additional discount 
of 20 %" 
                       when 
                                
                       then 
                                
               end 
end 

Can we make rules like above? 



Thanks & Regards 

Pardeep Ruhil 
This email may contain confidential or privileged information for the intended 
recipient(s). If you are not the intended recipient, please do not use or 
disseminate the information, notify the sender and delete it from your system. 
Thanks 

__ 

___ rules-users mailing list 
rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools Guvnor Remoting API

2009-08-04 Thread Michael Rhoden


Michael Neale would know better on the progress, but we discussed this exact 
feature back at Javaone a few months ago. My view is the selectors are still 
experimental, but are very close to being able to use. There have been talks 
about how to harden it up and do just what you are asking for. I believe there 
is a REST api for guvnor as well as webdav, but I dont think they talk to the 
selectors yet, though I could be wrong. 



Given this is a feature we want, and I know Michael Neale has agreed its a good 
idea and needed, what is your interest in Co-developing/Testing something like 
this with us? 

Michael Rhoden 
VP - IT Development 
Franklin American Mortgage Company 
Direct: 615-778-1117 
Fax: 615-778-2766 
Email: mrho...@franklinamerican.com 

- Original Message - 
From: "Steve Ronderos"  
To: rules-users@lists.jboss.org 
Sent: Tuesday, August 4, 2009 10:42:33 AM GMT -06:00 US/Canada Central 
Subject: [rules-users] Drools Guvnor Remoting API 


Hello Again, 

I asked a question similar to this awhile back, David Sinclair answered some of 
my questions, but I'm still looking for a few features. 

Here is my use case. 

We are deploying Guvnor to an enterprise environment.   
We plan on having one Guvnor for our rule authors to create/edit rules in.   
We plan on using selectors to control which rules are included into packages 
that are built for different environments (development, test, production).   
We can't have our application that use rules pointing directly at the Guvnor 
instance. 
We want an automated "deployment" process. 

Here is what I was thinking. 

I would like to be able to invoke a build, using a specified selector, then 
create a snapshot that follows a specific naming convention (ie with the 
selector's name in the snapshot name), in sequence.  In order to do this, I 
would like to, from a remote application, tell Guvnor to do a build, then to do 
a snapshot.  So essentially what I'm asking for is a remoting API for Guvnor's 
features.  I've looked through some of the Guvnor code and I believe I see that 
there is a remote API for the drools-repository that Guvnor sits on, but what I 
need is specifically Guvnor's features to be made available in a remoting API. 

Does anyone know if such a thing exists?  If not is it planned? If not, am I 
even asking for a desirable feature?   

Thanks, 

Steve Ronderos 
___ rules-users mailing list 
rules-users@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-users___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Web based decision tables

2009-06-15 Thread Michael Rhoden
Are you exporting the DRL or just using the view source from guvnor? The view 
source doesn't show the model that must be defined, among other things. I 
havent used the eclipse plugin much but Guvnor itself, has it's own pseudo 
model for handling Web Decision tables. When you finally generate a package it 
will generate correct DRL (not BRL/DT) of that decision table and should have 
everything you need to run it outside of Guvnor. BRL and DT will always create 
DRL when you export the package. So my guess is you should use KB.add on a DRL 
resource type. 

-Michael 

- Original Message - 
From: "Dan Seaver"  
To: rules-users@lists.jboss.org 
Sent: Monday, June 15, 2009 3:32:48 PM GMT -06:00 US/Canada Central 
Subject: [rules-users] Web based decision tables 


Can someone tell me the appropriate way to use web-based decision tables? 
They seem to work fine if I create them in Guvnor, and then build and deploy 
the binary package from Guvnor. However, if I copy the gdst from Guvnor to 
Eclipse and use KnowledgeBuilder.add to attempt to add the resource as a 
DTABLE or BRL resource type, I get a NullPointerException or 
CannotResolveClassException. 

Any help would be appreciated. 

Thanks, 
Dan 
-- 
View this message in context: 
http://www.nabble.com/Web-based-decision-tables-tp24042079p24042079.html 
Sent from the drools - user mailing list archive at Nabble.com. 

___ 
rules-users mailing list 
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users 
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools in the real world

2009-06-12 Thread Michael Rhoden
We have been using Drools since version 2, and currently have well over 10,000 
rules in production. It is a very solid product that can be used anywhere an 
Ilog etc would be considered. Drools Flow is a bit new, although I know there 
are several companies who have it in production. We are currently testing it 
internally, and it shows huge promise. 

-Michael 


- Original Message - 
From: "Ajay Gautam"  
To: rules-users@lists.jboss.org 
Sent: Friday, June 12, 2009 8:28:26 AM GMT -06:00 US/Canada Central 
Subject: [rules-users] Drools in the real world 

Are people actually using Drools Or Drools Flow in production? 

The traffic on this list seems way too low to suggest any serious industry 
consideration. 

OTOH, there are books out there for Drools. Which does suggest serious usage. 

What am I missing? 

Ajay Gautam 
*Please note that my email address may have changed. For all 
future correspondence, please use this address* 


This 
message (including any attachments) is confidential and/or 
privileged. It is to be used by the intended recipients only. If 
you have received it by mistake please notify the sender by return 
e-mail and delete this message from your system. Any unauthorized 
use or dissemination of this message in whole or in part is 
strictly prohibited. Please note that e-mails are inherently 
insecure and susceptible to change. The Royal Bank of Scotland 
Group, plc ("RBS") and its US subsidiaries, and affiliates and 
subsidiary undertakings, including but not limited to, RBS plc New 
York and Connecticut Branches, RBS Securities Inc., ABN AMRO Bank 
N.V. New York and Chicago Branches and, ABN AMRO Incorporated, 
Citizens Financial Group, Inc. and RBS Citizens, N.A., shall not be 
liable for the improper or incomplete transmission of the 
information contained in this communication or Attachment nor for 
any delay in its receipt or damage to your system. RBS does not 
guarantee that the integrity of this communication has been 
maintained nor that this communication is free of viruses, 
interceptions or interference. RBS and its subsidiaries and 
affiliates do not guarantee the accuracy of any email or 
attachment, that an email will be received or that RBS or its 
affiliates and subsidiaries will respond to an email. 

RBS makes no representations that any information contained in this 
message (including any attachments) are appropriate for use in all 
locations or that transactions, securities, products, instruments 
or services discussed herein are available or appropriate for sale 
or use in all jurisdictions, or by all investors or counterparties. 
Those who utilize this information do so on their own initiative 
and are responsible for compliance with applicable local laws or 
regulations.
 

___ 
rules-users mailing list 
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users 
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Introduction to my project

2008-11-16 Thread Michael Rhoden


I think a rules engine could do what you are asking, but you have to ask the 
right questions of it. What any rules engine can do is allow you to declare 
"rules" and then you reason using those rules. Once you setup your rules, I 
would guess you would want to "guess" if a plant can go in a bed, near, X other 
plants and see if you broke the rules. If you are looking for the "best" 
solution you make want to read this blog on drools solver ( 
http://blog.athico.com/search/label/solver ). If you just want to see if your 
plant can go in a certain place you simple brute force the check. Assuming you 
don't have huge amounts of data, and plants you can try all possible solutions 
and you wouldnt have to use anything as fancy as solver. 



So the question you need to answer is do you want a constraint engine (aka 
drools), "can i put x plant here", or a solver type engine that you ask, "where 
do i put all my plants". Hopefully that helps you a bit. 



-Michael 


- Original Message - 
From: "Ari Fainchtein" <[EMAIL PROTECTED]> 
To: "Rules Users List"  
Sent: Sunday, November 16, 2008 12:31:13 PM GMT -06:00 US/Canada Central 
Subject: [rules-users] Introduction to my project 

Hello, 
I would appreciate the opportunity to get your feedback.  The question   
I have is "Is a Rule Engine the best solution to my problem or do i   
have to write a custom algorithm?" 

What follows is a one paragraph background and then the actual problem. 

I live in a farm 90km north of Melbourne.  My farm is my PhD project,   
which i call the Suburban Micro Farm.  The idea is to grow food in the   
farm and have a commercial kitchen (in the farm) to prepare take away   
meals which will  be sold in downtown Melbourne.  I am writing a J2EE   
compliant web based application to control the operation of the farm/ 
delivery service.  THe farm will  be certified organic and is not   
connected to the grid.  All of my intellectual property is opens   
source under the idea of Open Source Franchising. 

The problem at hand is as follow. 

In my vegetable garden, I have planting beds of different sizes.  i   
will plant seedlings in those beds.  i have all the data for how long   
should the seeds be in the seedling trays before transplanting to   
beds.  I have the data for how far apart should be placed and how long   
should they be in the ground.  I also have data as which ones should   
be placed next to which others and which should not be planted   
together.  How should the seedlings be placed in the beds assuming   
that we also need to take into account a rotation of beds across   
seasons? The rotation will be created using rules as "if bed 1 had   
tomatoes then next season plant beans". 

This is a typical problem I need to solve.  Like the problem described   
above, I have many more in different parts of the supply chain.   
Should I use a rules engine or should i write custom algorithms? 


Thanks 
___ 
rules-users mailing list 
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users 
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to monitor what rules are fired

2008-10-27 Thread Michael Rhoden


Not sure if there are any examples around, but you could use 
AgendaEventListener to see any rules firing. 



-Michael 
- Original Message - 
From: "Ravi Krishnamurthy" <[EMAIL PROTECTED]> 
To: "Rules Users List"  
Sent: Monday, October 27, 2008 11:31:40 AM GMT -06:00 US/Canada Central 
Subject: [rules-users] How to monitor what rules are fired 

Hello: 
Would like to monitor what rules are fired, how many times it is fired etc. 

Is it possible to do this with Drools 4.x 

Thanks for your help, 
Ravi 
___ 
rules-users mailing list 
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users 
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] calling custom java code from Guvnor editor

2008-10-27 Thread Michael Rhoden


I don't believe so. This is something we need as well and will likely be 
contributing soon. If this were to be added as a patch do you have a preference 
as to how it would work? On save, call a url with the rule name? What are your 
needs for this? 



-Michael Rhoden 


- Original Message - 
From: "drools newbie" <[EMAIL PROTECTED]> 
To: rules-users@lists.jboss.org 
Sent: Monday, October 27, 2008 4:55:00 PM GMT -06:00 US/Canada Central 
Subject: [rules-users] calling custom java code from Guvnor editor 
  

Hello, 

Is there way to call some java code (that interacts with application db) 
from Guvnor whenever we add or change rule from Guvnor editor? Please 
clarify. 

Thanks 
-- 
View this message in context: 
http://www.nabble.com/calling-custom-java-code-from-Guvnor-editor-tp20197280p20197280.html
 
Sent from the drools - user mailing list archive at Nabble.com. 

___ 
rules-users mailing list 
rules-users@lists.jboss.org 
https://lists.jboss.org/mailman/listinfo/rules-users 
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Drools, Performance issues on 4.0.7 Vs 2.5

2008-09-05 Thread Michael Rhoden
I'll say it before someone else...

Evals are the devil, avoid them. From memory, the newer drools handles old
rules poorly, using extensive use of evals. It's the reason we have not
moved up to the newest version yet. It's probably not pretty but you may
have to rewrite/reconfigure your rules to avoid the use of evals, if that
3x performance is a significant issue.

-Michael

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Rout, Sushanta
(ThoughtMill)
Sent: Friday, September 05, 2008 10:32 AM
To: Rules Users List
Subject: [rules-users] Drools, Performance issues on 4.0.7 Vs 2.5

We were using Drools 2.5 version earlier. Now we have switched to drools
4.0.7. But we see significant issues with performance like drools 4.0.7
is three times slower than 2.5 . Has anybody encountered the issue?

Here is a sample of the rule, we have some more similar to this.
rule "test"
dialect "java"
activation-group "group1"
when
$croNumberDetailsRequest : CRONumberDetailsRequest()
$resdirectPhoneNumber : ResdirectPhoneNumber()
eval($resdirectPhoneNumber.getType().getId() == 5 &&

$resdirectPhoneNumber.isValidForBrand($croNumberDetailsRequest.getBrand(
)) &&
 $croNumberDetailsRequest.getRegion() != null &&

$resdirectPhoneNumber.isValidRegion($croNumberDetailsRequest.getRegion()
) &&
 $croNumberDetailsRequest.getLocale() != null &&


$resdirectPhoneNumber.isValidForLocaleId($croNumberDetailsRequest.getLoc
ale()) &&

$resdirectPhoneNumber.isValidSlot($croNumberDetailsRequest.getSlot()));

then
ResultList.add($resdirectPhoneNumber);
end

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Turning on and off a particular rule

2008-09-02 Thread Michael Rhoden
I'm not sure your use case, but I will answer what I think you are asking.
We had the need of turning on/off rules per time the rules were fired. So
different data may need different rules to fire, and simply too dynamic to
build rules around. It is as simple as a manager may choose to override a
price that has been returned by the engine. To do this we made sure all
rules have unique names with a  number. So it could be foo-bar-123,
foo-bar-124. The transaction ID and the rule ID can then be stored in a
database to persist the override, so transaction ID 987. When the rules
fire for a transaction you check to see if overrides exist and filter out
and rules that should be overridden. The rules still fire, they are just
ignored. For us this has worked well in an environment where we want all
transactions to potentially be overridden and ignored. There may be a more
elegant way to do this purely in the rule, but I haven't seen it.

 

On a side note, it would be awesome if the BRMS had a way to
store/generate unique IDs for each rule, that could be easily
returned/fetched when a rule fired.

 

-Michael

 

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ravi
Krishnamurthy
Sent: Tuesday, September 02, 2008 2:37 PM
To: Rules Users List
Subject: Re: [rules-users] Turning on and off a particular rule

 

Pallav:
the enabled keywork works.

In order to do this, the rules need to be updated at runtime. Wondering if
there is any other way other than updating the rules to get this behavior
during runtime.

Thanks,
Ravi

Ravi wrote: 

Thanks Shyam, will try it out.

  _  

From: [EMAIL PROTECTED]
[EMAIL PROTECTED] On Behalf Of Shyam, Pallav
(MSCIBARRA) [EMAIL PROTECTED]
Sent: Monday, September 01, 2008 12:49 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] Turning on and off a particular rule

To turn off a rule write
enabled false

on the line after the rule name.

Pallav

- Original Message -
From: [EMAIL PROTECTED]

<[EMAIL PROTECTED]>
To: Rules Users List  

Sent: Tue Sep 02 02:20:27 2008
Subject: [rules-users] Turning on and off a particular rule

Hello:
Wondering if it is possible to enable or disable a rule after the rules
are defined in a project.

Thanks,
Ravi

  _  

NOTICE: If received in error, please destroy and notify sender. Sender
does not intend to waive confidentiality or privilege. Use of this email
is prohibited when received in error.

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] two different versions...

2008-02-26 Thread Michael Rhoden
We handled this by dating all rules with a production start/stop date.
Effectively we made all rules have a date condition implicitly added to
control situations like this. I believe the BRMS has this functionality in
it as well.

-Michael

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of hamid
akhtarshenas
Sent: Tuesday, February 26, 2008 9:29 AM
To: rules-users@lists.jboss.org
Subject: [rules-users] two different versions...

Hi,

I have a question, How can i handle with Drools the following case:

i have two different versions of the same rule. The First one is allready
deployed (On classpath, in a J2EE environment). I would like to deploy the
second version, but all existing requests should still process with the
old Version and new incoming requests should process with the new Version.
Thanks a lot.

br,

Hamid
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Using the drools as the backend engine for a service

2008-02-01 Thread Michael Rhoden
You would likely NOT want to create a rulebase per session. Most people
create working memory per session. Rulebases should only be loaded once
per server (context) in my opinion, and you reload it as rules changes.
Loading a rulebase loads rules from a file, and orders your rete tree. For
our installation that takes several minutes.

 

Rulebase = once

Working memory = per user/transaction

 

-Michael

 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Jai Vasanth
Sent: Friday, February 01, 2008 3:23 PM
To: Rules Users List
Subject: [rules-users] Using the drools as the backend engine for a
service

 

Hi,

 I am planning on using Drools as the rules engine for a service that I am
building. I am considering instantiating a stateful session for every
request to the service. The RuleBase would be created when the service
starts. Is this the correct way to  go about incorporating Drools in a
service ? Is session creation an expensive process and if so are there
other efficient ways of doing so ?



Thanks 

Jai 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Drools 4.02 or 4.03 memory leak?

2008-01-06 Thread Michael Rhoden
Try setting your JVM memory higher. Drools tends to use plenty of memory
as well as perm gen space.

What I use:
-Xmx512m -XX:MaxPermSize=512m

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of heroshaojun
Sent: Sunday, January 06, 2008 9:14 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Drools 4.02 or 4.03 memory leak?

When I use profiler to test inserting object to WorkingMemory, outmemory
always occurs.

Who can help me? 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] JBRMS persistence

2007-11-27 Thread Michael Rhoden
Couple questions about the JBRMS persistence layer. I have been trying to
figure out how to upgrade and incorporate the new 4.03 code into my
current app using 2.x and 3.x drools. After many months of off and on
playing with 4.x I want to see if I have some things straight.
 
1)   JBRMS is built atop Jackrabbit. It appears this is the only
option for persistence. Is this correct?
2)   It seems Jack Rabbit and the whole JCR standard, while nice I
guess for coders, seems difficult to integrate with. All objects are
stored as binaries, even in the db persistence manager and there is no way
to access the rules except programmatically. Correct?
3)   Assuming I'm on the right track with the above two items, and
please don't take this the wrong way, I love you guys and what you are
doing, why use Jackrabbit? 
 
 It seems like a real bad idea to have an open system to store
rules and then lock it away. I'm sure you guys have some good reasons but
I'm having a real tough time and quite frankly am disappointed. From my
perspective rules are one of the major assets of my company. I can't allow
them to be locked up in a system. I must be able to access them from a
jdbc source for backups, conversion, referencing, reporting, etc. The data
however complex in structure must be transparent. Say I want to convert
off Drools for another engine, or build around the JBRMS data structure to
extend the app for proprietary purposes, or just want to access the rules
in an indexed way to present them to power users to see the guts of a rule
inside our application. Maybe you can do this now, I just haven't seen the
light.
 
Again I understand JBRMS is still quite new, and my hope Jackrabbit was
just the quick and dirty way to get this deployed.
 
4)   Are there any plans to have a straight jdbc persistence atop a
hibernate (plug the ole JBoss way) backend?
 
Not to leave you with just negative bits. Drools 4.x rocks and regardless
of using the JBRMS we are looking at porting up to the latest version. The
new frontend UI (coming soon) to the JBRMS looks nice too. Thanks for all
the hard work.
 
-Michael
  

 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] JBRMS - Rule IDs/Referencing

2007-06-15 Thread Michael Rhoden
Be happy to help, it just takes a bit to understand your coding
environment and standards. My first goal is to point out the need for
exposed Rule IDs and try to understand the system the way it sits.
 
As a side note, I found a feature to "export to a zip file" under the
Admin->Manage Backups. It doesn't seem to work or maybe it just writes
the file to some default location. I did search my hard drive for any
new Zips so I guess it just doesn't work atm.
 
Thanks,
Michael Rhoden

 
 
 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor
Sent: Friday, June 15, 2007 10:29 AM
To: Rules Users List
Subject: Re: [rules-users] JBRMS - Rule IDs/Referencing


The system is an "asset managemnt system", every item is an asset from
the rule to the package configuration. You can reference any item using
a unique name + package name +  version, each item also has a UUID
(provided by the JCR node). However we don't have any remoting/ws api
access to this info - you would have to build ontop of the programmatic
api provided in drools-repository. The versioning is multi dimensional
too - i.e. a Package configuration  is itself versioned against specific
versions of rules, if you want to update the Package to a new version of
a Rule, you must create a new version of the Package Configuration.

So it sounds like it doesn't do what you want now, but the foundations
are there and you can get involved with us and help us change that.

Mark


Michael Rhoden wrote: 

   I have a question about rule storage and referencing with the JBRMS.
   Mostly this is directed to Michael Neale (since I believe this is his
   baby), but since I cant catch him on IRC I'll post it to here to see
   if others have this similar concern. 
   
   A little history before I get to the question. We have been using
   drools since 2.x (still on 2.x) and have developed much around the
   core engine. The way we currently store rules is in a database, at
   runtime we pull them out and write an xml file. What this allows is
   rule referencing back to the authoring source. We translate from
   DB->XML so the "then" returns the ID. We also use it to create unique
   names for rules. In our editor we have notes, versions and the
   complete rule code, similar to the new JBRMS. When a rule fires in
   our system the purpose may be to show an error or change a price.
   Either way sometimes people ask why did this fire, or further, they
   dispute the rule all together. So in each message or price change we
   track the ID of the rule being fired/applied. 
   
   From that we have developed 2 tools, one to lookup a rule and see a
   great deal of info about that rule (whats/whys), the other is an
   Override tool that allows you, given authority, to associate a rule
   ID to a transaction and have coded so when the engine fires this
   rule, it will be ignored by the system. Obviously how we override is
   not something I expect you to solve, but giving me the ability by
   having a unique ID would be. 
   
   I would think the desire to "Track" and "Override" a rule is pretty
   high for most people using a rule system in an enterprise. What makes
   this possible is exposing a unique identifier in the storage of rules
   (think database and editor) as well as the execution of rules (as
   they fire). I setup the MR2 of the JBRMS and tried to look at the
   storage system to see if a rule had some unique identifier that we
   could use, and found none. Seems like a rulebase is a blob, though
   maybe I'm just looking at it wrong. 
   
   So my question and/or request is there a way to have each rule have a
   unique identifier (by version is fine) in the JBRMS storage system. I
   think this is the first step, the second is harder but make the
   system associate the ID to a rule at execution ("then"). Similar to
   the option of expiring a rule at X date. 
   
   While this may not seem huge, and is definitely not as cool as
   changing semantics in MVEL, it is a huge barrier of adopting this new
   very feature rich JBRMS. 
   
   Thanks, 
   Michael Rhoden 
   
  _  


   ___
   rules-users mailing list
   rules-users@lists.jboss.org
   https://lists.jboss.org/mailman/listinfo/rules-users
 



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] JBRMS - Rule IDs/Referencing

2007-06-15 Thread Michael Rhoden
I have a question about rule storage and referencing with the JBRMS.
Mostly this is directed to Michael Neale (since I believe this is his
baby), but since I cant catch him on IRC I'll post it to here to see if
others have this similar concern. 
 
A little history before I get to the question. We have been using drools
since 2.x (still on 2.x) and have developed much around the core engine.
The way we currently store rules is in a database, at runtime we pull
them out and write an xml file. What this allows is rule referencing
back to the authoring source. We translate from DB->XML so the "then"
returns the ID. We also use it to create unique names for rules. In our
editor we have notes, versions and the complete rule code, similar to
the new JBRMS. When a rule fires in our system the purpose may be to
show an error or change a price. Either way sometimes people ask why did
this fire, or further, they dispute the rule all together. So in each
message or price change we track the ID of the rule being fired/applied.

 
From that we have developed 2 tools, one to lookup a rule and see a
great deal of info about that rule (whats/whys), the other is an
Override tool that allows you, given authority, to associate a rule ID
to a transaction and have coded so when the engine fires this rule, it
will be ignored by the system. Obviously how we override is not
something I expect you to solve, but giving me the ability by having a
unique ID would be.
 
I would think the desire to "Track" and "Override" a rule is pretty high
for most people using a rule system in an enterprise. What makes this
possible is exposing a unique identifier in the storage of rules (think
database and editor) as well as the execution of rules (as they fire). I
setup the MR2 of the JBRMS and tried to look at the storage system to
see if a rule had some unique identifier that we could use, and found
none. Seems like a rulebase is a blob, though maybe I'm just looking at
it wrong.
 
So my question and/or request is there a way to have each rule have a
unique identifier (by version is fine) in the JBRMS storage system. I
think this is the first step, the second is harder but make the system
associate the ID to a rule at execution ("then"). Similar to the option
of expiring a rule at X date.
 
While this may not seem huge, and is definitely not as cool as changing
semantics in MVEL, it is a huge barrier of adopting this new very
feature rich JBRMS.
 
Thanks,
Michael Rhoden
 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] change "assert" to "insert"+ other changes

2007-06-12 Thread Michael Rhoden
I have a question related to this. Is there a way within a rule that you
can add 30 days to a date...
 
//mydate within last 30 days
mydate + 30 > getdate()
then dosomething()
 
I would only want mydate modified for this rule only not re-asserted on
the stack with a new date. Also if someone could point me in the
direction of some good info on dealing with dates in rules, love to see
more examples.
 

---
-MVEL has sugar to do: modify ( person ) { age += 1, location = "london"
}, what actually happens here is it first calls modifyRetract then
applies the setters and then calles modifyAssert.

---
 
Thanks,
-Michael
 

 
 
 

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor
Sent: Tuesday, June 12, 2007 3:39 PM
To: Rules Dev List
Cc: Rules Users List
Subject: [rules-users] change "assert" to "insert"+ other changes


Ok, I'm now doing these changes. 


Mark Proctor wrote: 

   I've had no further feedback on this, so I'm going to make this
   change as part of the next milestone release (this week) - these
   changes are considerable.
   
   assert will change to insert
   -avoid the constant keyword collision with "assert", most languages
   are seem to support this now
   -will change in both the drl and working memory api
   
   modify to become update
   -instead of workingMemory.modify(FactHandle, Object) it will be
   workingMemory.update(FactHandle, Object), will change modify to
   update in drl.
   -this method is now only used for ShadowFact objects, it's  a method
   to let the engine know that an external object has been updated and
   to update it's internal cache. and reprocess.
   -avoid keyword collision in MVEL which has nice "modify" sugar now
   
   insertObject, retractObject and updateObject to beome insert, retract
   and update
   -the Object part seems superflous, might as well remove it,
   especially as we start to support none Object fact types
   -drl and working memory api will now use the same method names.
   
   added new WorkingMemory modifyRetract and modifyAssert methods
   -allows for non shadow fact objects.
   -When not using shadow facts (although will ofcourse work with shadow
   facts) you cannot call 'update', or what use to be called 'modify',
   because we need to know the "old" value of fields so we can retract
   the from the workign memory. The only safe way is to first retract
   the object and then assert it. However with the existing api this
   adds extra work and results in new fact handle. modifyRetract and
   modifyAssert can now be used together to "simulate" a modify on a
   none shadow fact object in two parts. First call modifyRetract, then
   change your field values, then call modifyAssert.
   -MVEL has sugar to do: modify ( person ) { age += 1, location =
   "london" }, what actually happens here is it first calls
   modifyRetract then applies the setters and then calles modifyAssert.
   
   Mark
   
   Greg Barton wrote: 

  I think it's a good idea, so ya, change to "insert"
  
  GreG
  
  --- Mark Proctor <[EMAIL PROTECTED]> wrote:
  


 We have been getting querries with regards to jdk
 assert collision and 
 jboss rules assert, for this reason we are thinking
 of changing it to 
 insert for 4.0. Further to that its causing language
 integrations issues 
 for us as we expand pluggeable dialects. For this
 reason we are thinking 
 of chaning assert to insert, this would be an api
 change and a language 
 level change. I'd thought I'd throw this out to the
 community before we 
 do it. This of course breaks backwards
 compatability.
 
 Mark
 ___
 rules-dev mailing list
 [EMAIL PROTECTED]
 https://lists.jboss.org/mailman/listinfo/rules-dev
 
 

  
  
  
 
  __
  __Get the free Yahoo! toolbar and rest assured
  with the added security of spyware protection.
  http://new.toolbar.yahoo.com/toolbar/features/norton/index.php
  ___
  rules-dev mailing list
  [EMAIL PROTECTED]
  https://lists.jboss.org/mailman/listinfo/rules-dev
  



   
  _  


   ___
   rules-dev mailing list
   [EMAIL PROTECTED]
   https://lists.jboss.org/mailman/listinfo/rules-dev
 



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] name

2007-06-08 Thread Michael Rhoden
Wonderful idea. D-rules or some variant is much better than the previous 
2 names :)

Telling an exec we saved a lot of time & money using this system called 
"Drools" always got me a few looks. Likewise I dont go around saying 
the new version of JBoss Hibernate is out.

-Michael

 

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Mark Proctor
Sent: Friday, June 08, 2007 3:38 PM
To: Rules Users List
Subject: [rules-users] name

I've asked this on dev, thought i'd also ask on user - what's your 
opinions on the email below?

Mark
Mark Proctor wrote:
> So it's over a year since we changed the name from Drools to JBoss 
> Rules. Personally I really dislike  +  
> naming schemes; especially so for Open Source projects. It's not the 
> vendor prefix I dislike, as that adds weight in corporate brand 
> recognition, but the generic postfix - leaving you no choice but to 
> refer to the project by the full name "JBoss Rules" in all 
> communication and throughout that communication; which I find 
> tiresome. Where as ideally, say in a presentation, you introduce the 
> project as JBoss +  first and then further references in 
> your presentation can just use the shortened ; emails on 
> the mailing list, being more casual, can just drop to the shortened 
>  straight away. It's not just a lazyiness of having to 
> use two words, but I feel it makes it generally easier on the ears and 

> eyes. With 4.0 coming up we have taken the next steps into the world 
> of Declarative programming, so was thinking of JBoss DRules or JBoss 
> D-Rules or JBoss drules - allowing the DRules to be used standalone to 

> refer to the project in more casual communication. Anyone have any 
> thoughts on a year of the "JBoss Rules" name?
>
> Mark
> ___
> rules-dev mailing list
> [EMAIL PROTECTED]
> https://lists.jboss.org/mailman/listinfo/rules-dev
>

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Tracking non-matches...

2007-04-17 Thread Michael Rhoden
Store all rules with a unique id (rule id) and keep dates of when rules 
were put in/out of production. Store your net matches in a database, 
after a run, and you can easily pull the delta to show what didn't 
"match" on a particular day. 

-Michael

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of jdepaul
Sent: Tuesday, April 17, 2007 1:57 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Tracking non-matches...


I was hoping for some opinions on the following:

Client will have many rules (about 1000) per RuleBase.  The primary goal 
is to assert Facts and find Matches in one or more rules.  The secondary 
goal may be to keep track of those Facts that did not produce Matches.  
I was wondering what the best solution may be in this case?!

The benefit in keeping track of the non-matches would be periodic 
analysis of the non-matches to discover patterns and perhaps provide 
some proactive
monitoring and notification.   An additional benefit may be to spot a 
trend
and setup additional rules to reduce the number of non-matches.  

So I would need to not only spot the no-match condition, I also need to 
persist the no-match event in the database for tracking and later 
reporting.

One way I can see is to assert a new Match fact the instance a single 
rule is matched and then test for the presence/absence of the Match() 
fact. 
Efficiency and speed are paramount in our case, so I'm wondering if 
there is an alternate approach that would work here.

Thanks,
James


--
View this message in context: 
http://www.nabble.com/Tracking-non-matches...-tf3596042.html#a10044235
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] How to pre compile rule files for production

2007-04-15 Thread Michael Rhoden
Yes something like that should work fine. I'm not to up on the 
"synchronized" call you're making but if you can access some app scoped 
memory, what you have will work fine. I might suggest you try and cache 
the rulebases [call execute(String ruleFile, Object [] objects)] well 
before you expect them to perform well, maybe at app startup. It seems, 
for us anyway, that the rulebase building takes hundreds of times longer 
than the rest. 

-Michael

-Original Message-
From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of 
[EMAIL PROTECTED]
Sent: Sunday, April 15, 2007 4:23 AM
To: Rules Users List
Subject: Re: [rules-users] How to pre compile rule files for production

Hi Michael,

  Thanks very much  for the instant reply. In my application, I have 
number of .drl files for differnt kinds of domain problems and i pass 
the .drl file name to the RuleExecuter from the EJB. The RuleExecuter 
will fetch and load the rule file into RuleBase and then execute the 
rule.

  So, if i rewrite the code to store the RuleBase in a static HashMap 
(with synchronized put) when it is created for the first time and then 
get it from there for subsequent use,  whether it will be fine? My code 
will now look like the below one. Please give your advice on this.

Thanks and Regards,

 -- Abhilash.

  // This HashMap will act as the cache for RuleBase instances of each 
rule in .drl file
  private static HashMap ruleBaseCache =  null;

  static {
ruleBaseCache = new HashMap();
  }


  /**
* @param ruleFile   - Name of the rule file (.drl file)
* @param objects- Fact objects for the rule
* @return
* @throws AppException
*/

  private static RuleResultVO execute( String ruleFile, Object [] 
objects
) throws AppException {

 /* This will contain the execution result of the rule. Every 
rule will have reference to
  * this object and will finally store the result in this object
  */
RuleResultVO ruleResult = new RuleResultVO();

try {


//See whether the ruleBase for this rule file is in cache.
Theoretically, this also should be synchrnoized, but will be a 
performance overhead.
RuleBase ruleBase = (RuleBase) ruleBaseCache.get( ruleFile 
);

if ( ruleBase == null ) {  // First time access. Create the 
ruleBase and put it in cache

synchronized( RuleExecuter.ruleBaseCache ) {
//Read the rule source file
InputStream in = 
ResourceLoader.getResourceAsStream(ruleFile);
Reader reader = new InputStreamReader(in);
DrlParser parser = new DrlParser();
PackageDescr packageDescr = parser.parse( 
reader );

//pre build the package
PackageBuilder builder = new PackageBuilder();
builder.addPackage( packageDescr );
Package pkg = builder.getPackage();

//add the package to a rulebase
ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage( pkg );

//Add the RuleBase to the cache so that the 
subsequent calls will use it from there.
ruleBaseCache.put( ruleFile, ruleBase );
}
}


//create the WorkingMemory
WorkingMemory workingMemory = 
ruleBase.newWorkingMemory();

//Supply the fact objects for the rule
for ( int i = 0; i < objects.length; i++ ) {
workingMemory.assertObject( objects[i] );
}

workingMemory.assertObject( ruleResult );

// go !
workingMemory.fireAllRules();


}catch( Exception e ) {
e.printStackTrace();
ExceptionUtil.throwAppException( 
"RuleExecuter.executeRule() :
Exception Occured :[" +e.getMessage()+"]");
}

  return ruleResult;
  }







___
rules-users mailing list
[EMAIL PROTECTED]
https://lists.jboss.org/mailman/listinfo/rules-users




___
rules-users mailing list
[EMAIL PROTECTED]
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] How to pre compile rule files for production

2007-04-14 Thread Michael Rhoden
Typically you would want to create a rulebase at server load or at the 
application scope and store that rulebase as a singleton. Then at runtime 
get a workingmemory, assert your objects and fire rules.

For our application loading rules into a rulebase takes from 10 to 180 
seconds , but working memory, asserting a few objects and firing the rules 
takes less than 100ms.

-Michael

.. Original Message ...
On Sat, 14 Apr 2007 06:44:15 -0700 (PDT) <[EMAIL PROTECTED]> 
wrote:
>Hello,
>
>  I am using 3.0 RC 2 version of DROOLS in one of our project. (JDK 1.4.2
>and JBoss 3.2.7) When we deployed the application into production, we
>are facing performance issues that seems to be because of class loading
>and GC collection of rule classes that are created at runtime. So I went
>back to the docs and wiki and decided to try the pre-compile and caching
>options. Eventhough i searched the wiki, mailing list archives and doc,
>i was not able to find any advice on how can I do this. Ours is a J2EE
>application and the EJBs call a static method in an helper class which
>will laod the .drl file, build the PackageBuilder and Rulebase, create
>the WorkingMemory and execute the rule.
>
>  Any pointers on how to pre compile the rule and then execute it will be
>really helpful. Below is the current code that executes the rule.
>
>Thanks and Regards,
>
>-- Abhilash.
>
>
>private static RuleResultVO execute( String ruleFile, Object [] objects )
>throws AppException {
>
>
>   RuleResultVO ruleResult = new RuleResultVO();
>   try {
>
>   //read in the source
>   InputStream in = ResourceLoader.getResourceAsStream(ruleFile);
>   Reader reader = new InputStreamReader(in);
>   DrlParser parser = new DrlParser();
>   PackageDescr packageDescr = parser.parse( reader );
>
>   //pre build the package
>   PackageBuilder builder = new PackageBuilder();
>   builder.addPackage( packageDescr );
>   Package pkg = builder.getPackage();
>
>   //add the package to a rulebase
>   RuleBase ruleBase = RuleBaseFactory.newRuleBase();
>   ruleBase.addPackage( pkg );
>
>   //load up the rulebase
>
>   WorkingMemory workingMemory = ruleBase.newWorkingMemory();
>
>   //go !
>
>   for ( int i = 0; i < objects.length; i++ ) {
>   workingMemory.assertObject( objects[i] );
>   }
>
>
>   workingMemory.assertObject( ruleResult );
>
>   workingMemory.fireAllRules();
>
>
>   }catch( Exception e ) {
>   e.printStackTrace();
>   ExceptionUtil.throwAppException( 
> "RuleExecuter.executeRule() :
>Exception Occured :[" +e.getMessage()+"]");
>   }
>
>return ruleResult;
>   }
>
>
>___
>rules-users mailing list
>[EMAIL PROTECTED]
>https://lists.jboss.org/mailman/listinfo/rules-users
>
>

___
rules-users mailing list
[EMAIL PROTECTED]
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Rules Design Question

2007-04-06 Thread Michael Rhoden
Please give a better example or some pseudo code of what you are trying
to do.
 
-Michael

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ronald R.
DiFrango
Sent: Friday, April 06, 2007 8:15 AM
To: Rules Users List
Subject: [rules-users] Rules Design Question


All,

I have a rules design question for the community.  I have 3 lists of
different types of objects that I need to sum if a certain attribute is
present on each one of them.  Then after the summing has taken place
execute other rules based upon the results of the summation. 

Is there a way that I can accomplish this via salience or agenda groups?

Thanks in advance,

Ron


___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Rule Organization suggestions

2007-03-19 Thread Michael Rhoden
We currently are using an older version of drools, 2.x maybe at the
moment and have a few thousand rules that load through xml files. I have
loaded all my old rules in the latest JBoss Rules version, but we have
to eval() on most everything. It worked fine but this is not the path we
want to continue for new rules repositories. We currently have a
homebrew brms that handles the generation of "RuleIDs". Given the xml
standard has changed dramatically and it appears we would be better
served writing new contextual rules in DRLs, does anyone have a
suggestion as to manage large amounts of rules? The main 2 things I need
are:
 
1) A way to write rules that will give me unique IDs for each rule. The
main need for this is to "Override" a rule. In our business (as in many)
we have the need for rules to control business logic, IE "amount > 100"
then "stop transaction". What we use today is a rules override system
where certain business users can put in the rule Id and the transaction
number and the rule that fires will be ignored moving forward. Just
looking for a stop gap measure to auto generate rule ids, I guess I'm
hoping I've overlooked a DRL plugin ;) Potentially I was wondering if
the DRL Rule has an attribute to put a ruleID and once a consequence
fired I could look up the ID.
 
2) We want to use the new jbrms when it's released, but wondered what
the most appropriate format for new rules would be. Meaning if I create
DRL rules will I be able to import them in the new system? Will it
create Rules IDs for these rules then?
 
Thanks for the help.
 
-Michael Rhoden

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] advice is needed: rule based processing ofinterconnected facts

2007-02-01 Thread Michael Rhoden
Can you post a couple of example conditions with a dataset you want to
check?

-Michael

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Olenin, Vladimir
(MOH)
Sent: Thursday, February 01, 2007 4:04 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] advice is needed: rule based processing
ofinterconnected facts

Hi,

 

I need some pointer as to where to start with the problem below.

 

The system should be able to validate the balancing data based on around 400
different rules. To simplify the task, the data facts are essentially the
debit/credit transactions on different accounts. The rules describe the
correlation between different facts:

-  eg, all debit transactions minus all credit transaction must be
equal 0

-  if one account got credited, there should be another account
(within the same dataset) which was debited

-  if there are accounts starting with some letter combination,
there also should be

-  etc

 

In other words, each rule describes

-  the subset of facts to be analyzed

-  the rules to be checked against this subset

 

It seems basically like each fact is a set of Account Number, Transaction
Type, Transaction Amount information, Secondary Account Number (which
sometimes needs to be validated against some other account number within the
same data set). But I couldn't find a way to relate between multiple data
facts.

 

On one hand rule engine seems to be a good solution in here, but I'm not
sure how to deal with 'dynamic selection' of the subset of facts. Can this
kind of task be reformulated somehow?

 

Any pointers into the DROOLS documentation or hints on a general approach
would be greatly appreciated!

 

Thanks.

 

Vlad

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] What if Rules change frequently...

2007-01-31 Thread Michael Rhoden
We have done what I believe you are describing. Running under tomcat we load
our rules at server load. So in the contextloader we create several RuleBase
instances (just one for each different type of rule base we need). We store
our rules in a database initally, so loading involves pulling all rules by
date/status. This is something we had to create outside drools/jboss. Having
that date allows multiple rules to be loaded and only span certain areas of
time with no overlap. So if a rule that adds/subtracts to a price, for
instance were $1.00 from say Jan 1 12:00am - Jan 31 4:04pm and now there is
a new rule that is $1.25 it should begin Jan 31 4:04pm. This way both rules
are in the rulebase at once. Since we build the rules dynamically it was as
simple as adding a new condition to each rule that described the date the
rule should fire.

As far as loading...

Setup your rulebase from your DRL or various datasource, then
context.setAttribute("pricingRuleBase",ruleBase);

When we call the engine amongst the data we will use to setup the situation
we pass..

priceBase =
(RuleBase)this.getServletContext().getAttribute("pricingRuleBase")

And then..

WorkingMemory wmPrice = priceBase.newWorkingMemory();
FactHandle fhPrice = wmPrice.assertObject(xyz);
retePrice.fireAllRules( );   
fhPrice.doSomethingWithResults();

When we need to reload based on whatever situation, error or emergency
change etc you simply (click a form) to call a similar method to load the
new rulebase in question locally and set it to the context. This overrides
your "pointer" for the next call to the engine. To make sure this happens
smoothly we pad all our dates on rules 15 minutes, so our deploy procedure
"deploys" rules with the current time (or whatever you request) plus 15
minutes. It then calls a reload on the system, so in fact the new rules will
show in about 15 minutes time. You really don't need this but for our
application it made business users feel better.

We are using drools 2.x so things are a little better now, but for ~4k rules
we translate in about 30 seconds to a DRL, and then load that DRL in about
30 seconds, so a change could happen with-in a few minutes in reality. If it
needs to be faster than that I would take Edson's advice and assert new
facts versus loading the whole rulebase again. You would still have to
engineer some date check into your rule logic and possibly figure out a way
to re-assert current rules firing with different dates so as to basically
turn them off.

BTW we have been using this method above for over a year with zero problems.
Hope this helps.

-Michael

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of jdepaul
Sent: Wednesday, January 31, 2007 3:18 PM
To: rules-users@lists.jboss.org
Subject: Re: [rules-users] What if Rules change frequently...



Edson Tirelli-3 wrote:
> ... you need to be aware that such activations will be created even if 
> it was already fired for the old rule...

Edson -  could you please expand your explanation a bit - would like to know
a little better what you meant above.

FYI - my goal is to assert each new Fact against the latest set of Rules
with minimum latency when rules change.  I would like to assert each
Event/Fact individually (not in an on-going conversation).  I want each
assertion to result in exactly ONE or ZERO matches to the current set of
rules in place and act on it only if Match occurs.

I envision having a component that holds Drools' RuleBase object as a
Singleton with current set of rules retrieved from the DataBase at
application initialization - the Singleton, would be used by multiple
threads in the ApplicationServer for each request.  Each thread would get a
RuleBase reference from the Singleton and create newWorkingMemory() EVERY
time, assert the Fact and FireAllRules and then be all done until the next
Event arrived...   By creating newWorkingMemory() every time for each Fact,
I'm hoping to achieve "isolation" of events - that is preventing multiple
rules being activated and firing.When rules change, I'm hoping for some
mechanism (JBoss or custom) to update the RuleBase and its packages.  Is
this achievable using dynamic rules with JBoss?  

Please comment -

--
View this message in context:
http://www.nabble.com/What-if-Rules-change-frequently...-tf3149726.html#a873
7858
Sent from the drools - user mailing list archive at Nabble.com.

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


RE: [rules-users] Problem downloading source from SVN

2007-01-29 Thread Michael Rhoden
I was able to pull source just fine from my house. It appears this may be a
firewall issue at my office. Disregard my previous post.
 
-Michael

  _  

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael Rhoden
Sent: Monday, January 29, 2007 3:30 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Problem downloading source from SVN


I'll admit I'm more of a CVS guy than Subversion but it appears the anon SVN
may have an issue at the moment. I have followed all the steps in the docs
2.2-2.3 using 3 different subversion tools including tortoise 1.4.2 and get
various errors below:
 
Trying to checkout to a new folder using
<http://anonsvn.labs.jboss.com/labs/jbossrules/trunk>
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk as the repo:
Error: REPORT request failed on '/!svn/vcc/default'  
Error: REPORT of '/!svn/vcc/default': 400 Bad Request
(http://anonsvn.labs.jboss.com)  
 
Trying to checkout to a new folder using
<http://anonsvn.labs.jboss.com/labs/jbossrules/trunk>
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-repository as the
repo:
Error: REPORT request failed on '/!svn/vcc/default'  
Error: REPORT of '/!svn/vcc/default': 400 Bad Request
(http://anonsvn.labs.jboss.com)  

Trying to browse the repo using Tortoise:
Error * REPORT request failed on
'http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-repository'
REPORT of
'http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-repository': 400
Bad Request (http://anonsvn.labs.jboss.com)
 
When I use  <https://svn.labs.jboss.com/labs/jbossrules/trunk/>
https://svn.labs.jboss.com/labs/jbossrules/trunk/ to try and checkout I get
the username/password which I guess is fine, but I dont have an account,
tried anonymous as user with various other things.
 
Could use some advice as to how to checkout some code, or confirmation
something is broke at jboss.
 
Thanks,
Michael Rhoden
 
 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Problem downloading source from SVN

2007-01-29 Thread Michael Rhoden
I'll admit I'm more of a CVS guy than Subversion but it appears the anon SVN
may have an issue at the moment. I have followed all the steps in the docs
2.2-2.3 using 3 different subversion tools including tortoise 1.4.2 and get
various errors below:
 
Trying to checkout to a new folder using
<http://anonsvn.labs.jboss.com/labs/jbossrules/trunk>
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk as the repo:
Error: REPORT request failed on '/!svn/vcc/default'  
Error: REPORT of '/!svn/vcc/default': 400 Bad Request
(http://anonsvn.labs.jboss.com)  
 
Trying to checkout to a new folder using
<http://anonsvn.labs.jboss.com/labs/jbossrules/trunk>
http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-repository as the
repo:
Error: REPORT request failed on '/!svn/vcc/default'  
Error: REPORT of '/!svn/vcc/default': 400 Bad Request
(http://anonsvn.labs.jboss.com)  

Trying to browse the repo using Tortoise:
Error * REPORT request failed on
'http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-repository'
REPORT of
'http://anonsvn.labs.jboss.com/labs/jbossrules/trunk/drools-repository': 400
Bad Request (http://anonsvn.labs.jboss.com)
 
When I use  <https://svn.labs.jboss.com/labs/jbossrules/trunk/>
https://svn.labs.jboss.com/labs/jbossrules/trunk/ to try and checkout I get
the username/password which I guess is fine, but I dont have an account,
tried anonymous as user with various other things.
 
Could use some advice as to how to checkout some code, or confirmation
something is broke at jboss.
 
Thanks,
Michael Rhoden
 
 

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users