Rules fired without calling session.fireAllRules()
by Jin Chai
Hi,
I have the following code, which is not working as I expected.
rule "New AlertFacade"
salience 1140
when
$af : AlertFacade();
then
System.out.println($af.getProperties());
end
In the java code:
while (!isFireAllRules)
{
session.insert(alertFacade);
....
}
session.fireAllRules();
But I am seeing the rule "New AlertFacade" is fired everytime I inserted the
fact. Shouldn't it wait until fireAllRules() be called? Am I missing something
here?
Thanks,
Jin
16 years
5.0 GA
by Evans, Jess
Is there an ETA for the Drools 5.0 GA release?
16 years
(interesting) migration problem from Drools 3.0.6 to Drools 4.0.7
by Maxim Veksler
Hello Everyone,
Here's a fun stuff to debug:
In our application we are using the concept of "Dynamic Beans", Drools is
running in a webapp. The servlet container is tomcat6.
Dynamic beans are beans we compile from java code and then load with a
custom class loader. This happens in the following method :
The class that implements ServletContextListener has in his
contextInitialized(...) method a code to do the following: (simplification)
ClassLoader cl = Janino.JavaSourceClassLoader(...)
originalCl = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(cl);
The above code allowed drools3 to find the Dynamic Classes (which didn't
even existed, not to be mention were available to ANY classloader).
Now, inside the .drl files we use properties from these dynamic beans - This
allows us to be dynamic on the properties we can filter by.
All good, but now comes the new Drools4 code. The application is no longer
able to find the mentioned classes.
The only changes the I've done was change Drools version from 3 to 4.
The errors I'm getting are of the form :
Rule Compilation error : [Rule name=X Status, agendaGroup=MAIN, salience=0,
no-loop=false]
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:267) : Only a type
can be imported. com.X.common.dataModel.facts.dynamic.X resolves to a
package
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:334) : Only a type
can be imported. com.X.common.dataModel.facts.dynamic.X resolves to a
package
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:1111) : Only a type
can be imported. com.X.common.dataModel.facts.banner.X resolves to a package
com/X/ruleEngine/filtering/Rule_X_Status_0.java (2:1379) : The import
com.X.common.dataModel.facts.X.X cannot be resolved
...
Anyone has ideas how to over come this?
I'm currently searching for alternatives, I'm thinking about Configuring my
custom class loader at the webapp level or something like that...
Help would be appreciated as I'm not getting much success.
--
Cheers,
Maxim Veksler
"Free as in Freedom" - Do u GNU ?
16 years
Measuring execution time of each rule?
by Maxim Veksler
Hello,
I'm hard at work on improving performance of our Drools setup.
I was wondering if there is some built in way to measure the execution time
of each rule?
Thank you,
Maxim.
--
Cheers,
Maxim Veksler
"Free as in Freedom" - Do u GNU ?
16 years
BRMS in a WAS cluster
by seemamani
We use Drools 4.0.7 in our application which is deployed on a WAS 6.1 cluster
and it is working fine. Now we want to deploy the Drools BRMS also in the
WAS cluster. I went through the Drools and Jackrabbit mailing lists and
documentation. Please confirm if my understanding of how this can be
implemented is correct.
1. By default, JackRabbit uses Apache Derby in-memory database which does
not support clustering
2. We need to configure a persistence manager in JackRabbit that stores data
in a RDBMS like Oracle
3. I need to follow the instructions for JackRabbit clustering given here
http://wiki.apache.org/jackrabbit/Clustering
4. Also, the Drools documentation says that "The BRMS will create the
tables the first time it is started up if it is running against a fresh
(empty) RDBMS - so its important to note that the user credentials supplied
have permissions to create tables (at least initially, on first run, after
that they could be locked down)."
Is it not possible to create the Oracle tables before running the BRMS (we
have permission issues in creating the tables from the application)? I
assume that the DDL for creating the tables is available with the JackRabbit
distribution.
5. Is there anything else I'm missing? Will BRMS work fine in the cluster
with the above setup?
Thanks,
Seema
--
View this message in context: http://www.nabble.com/BRMS-in-a-WAS-cluster-tp20408825p20408825.html
Sent from the drools - user mailing list archive at Nabble.com.
16 years
Introduction to my project
by Ari Fainchtein
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
16 years
Re: [rules-users] Introduction to my project
by 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" <ari(a)lechido.com>
To: "Rules Users List" <rules-users(a)lists.jboss.org>
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(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
16 years
Debug drools 4 application launched from a Servlet Container ?
by Maxim Veksler
Hello
We are using MyEclipse extension to launch a webapp that contains Drools.
I would like to debug the WorkingMemory state of this webapp.
>From reading the user guide I see that suggested method of debugging a
drools application is launching the Main class, as my application is a
webapp the concept of a Main class does not exists.
How should I debug Drools from in this case?
Can I maybe remote connect or instruct Drools to simply treat the running
JVM as a "Drools Application" when in fact it was launched by Apache Tomcat
servlet ?
Thank you,
Maxim.
--
Cheers,
Maxim Veksler
"Free as in Freedom" - Do u GNU ?
16 years
accessing drools 3 documentation and download ?
by Maxim Veksler
Hello list,
I know Drools 3 is legacy but I need the documentation and the final release
3.0.2 jar.
Can someone please point me to an archive where this can be downloaded?
If OTOH someone has this on his local storage and will be willing to upload
it - I can provide and ssh (scp) account.
Thank you,
Maxim.
--
Cheers,
Maxim Veksler
"Free as in Freedom" - Do u GNU ?
16 years
Parallel rule execution in a RuleFlow
by Steven Hale
I've been experimenting with ruleflows and in particular parallel execution. According to the documentation an AND split
"means that the control flow will continue in all outgoing connections simultaneously".
I've been unable to demonstrate this. All my rules in one branch always execute before the rules on the other branch (I have an AND join joining these branches again).
Is this the expected behaviour or am I doing something wrong?
/Steven
16 years