using drool in tomcat
by kamal@mpower.co.in
hi to all,
I am new to drool but i want to learn drool,in my company it is told to
use tomcat server so can any one tell me how to use it in step by step to
generate a simple web application.
Thanks in advance.
u can mail me at kamal.shiva(a)gmail.com as well.
with thanks & refards
kamalkant
--------------------------------------------------------------------
mail2web.com Enhanced email for the mobile individual based on Microsoft®
Exchange - http://link.mail2web.com/Personal/EnhancedEmail
16 years, 7 months
Negating a constraint group?
by Dirk Bergstrom
I want to write a rule that says "Find all long-eared dogs that do not have
short, black hair". This seems like the simple way to do it:
collect( Dog( ears=="long", not (hair=="short" && color=="black") )
But that doesn't parse. Some digging through the archives unearthed a mention
of De Morgan's laws, which leads to:
http://en.wikipedia.org/wiki/De_Morgan's_laws
Which explains that I can instead write:
collect( Dog( ears=="long", (hair!="short" || color!="black") )
Which, after some mental effort, turns out to be the right thing.
However, had I not found the reference to De Morgan's Law, it would have taken
me a long time to get there (if indeed I ever would have). The end result is
also quite difficult to parse if you're not a logician, and thus not very
user-friendly.
Does anyone think it would be worthwhile to open a Jira requesting the ability
to negate a constraint group? And, if I did open such a thing, do the
developers think it would be reasonably easy to implement?
--
Dirk Bergstrom dirk(a)juniper.net
_____________________________________________
Juniper Networks Inc., Computer Geek
Tel: 408.745.3182 Fax: 408.745.8905
16 years, 7 months
Issues when comparing attribute values to null
by Joshua Undesser
I am not sure if anyone else is having this issue or not, but I can not do
in-line attribute compares to null.
For instance.....
when
ObjectA(
objectBKey == null
)
then
....
objectBKey is a String in this case.
This doesn't evaluate properly as the rule was firing even though the slot
contained the key of ObjectB.
Then I did this as a test....
when
ObjectA(
$objBKey : objectBKey
)
not ObjectB(
objectBKey == $objBKey
)
then
.....
This works because if the slot is populated there must be an ObjectB in the
system with that unique key. If the $objBKey is null then there obviously
is not an ObjectB in the system.
I tried searching through the archieve but couldn't find anything for this
issue. Also for what it's worth I'm using the official 4.0.5 release.
Thanks in advance!
Joshua
--
View this message in context: http://www.nabble.com/Issues-when-comparing-attribute-values-to-null-tp16...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 7 months
RE: Hot Deployment
by Brian Trezise
Ok, that helped. However, I now have a different exception. Does the rule
agent have the ability to monitor changes to the drl files in a directory,
or do I have to serialize the rules before it works? Our goal is to deploy
the .drl files to our server and have the agent detect modified time stamps
or new files and auto-load them into the rule base
___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
3173 s. uravan way
aurora, colorado 80013
T: 720.524.4864
brian.trezise(a)intellidata.net
-----Original Message-----
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of
rules-users-request(a)lists.jboss.org
Sent: Monday, April 07, 2008 3:30 PM
To: rules-users(a)lists.jboss.org
Subject: rules-users Digest, Vol 17, Issue 18
Send rules-users mailing list submissions to
rules-users(a)lists.jboss.org
To subscribe or unsubscribe via the World Wide Web, visit
https://lists.jboss.org/mailman/listinfo/rules-users
or, via email, send a message with subject or body 'help' to
rules-users-request(a)lists.jboss.org
You can reach the person managing the list at
rules-users-owner(a)lists.jboss.org
When replying, please edit your Subject line so it is more specific
than "Re: Contents of rules-users digest..."
Today's Topics:
1. RE: Hot Deployment (Nico Schlebusch)
----------------------------------------------------------------------
Message: 1
Date: Mon, 7 Apr 2008 23:29:23 +0200
From: "Nico Schlebusch" <nicos(a)zieto.co.za>
Subject: RE: [rules-users] Hot Deployment
To: "Rules Users List" <rules-users(a)lists.jboss.org>
Message-ID: <BEEEB43B72EFA94A941C0D71C02752F82AE607(a)tacora.dot.co.za>
Content-Type: text/plain; charset="us-ascii"
Hi Brian,
>> The goal here is to monitor the directory above for any changes to
the files or additional files that show up. Any help would be
appreciated.
If you want to monitor a local dir try using the "dir" property instead
of "url". In your case you would then have something like:
Properties prop = new Properties();
prop.setProperty("dir",
"c:/svn/code/sleuth/src/net/intellidata/sleuth/description/rules/");
prop.setProperty("poll", "300"); // poll every 300 seconds
for hot deployment.
I'm not sure if you would need these properties.
prop.setProperty("newInstance", "true");
prop.setProperty("localCacheDir", ".");
Have a look at Section 7.1.1. Deployment using the RuleAgent of the
online manual at
http://downloads.jboss.com/drools/docs/4.0.6.19326.GA/html/index.html
Regards,
Nico
From: rules-users-bounces(a)lists.jboss.org
[mailto:rules-users-bounces@lists.jboss.org] On Behalf Of Brian Trezise
Sent: 07 April 2008 10:19 PM
To: paulb(a)firstpartners.net; 'Rules Users List'
Subject: RE: [rules-users] Hot Deployment
Ok... I put that in but I'm having trouble getting it to recognize the
uri I'm passing in... I'm passing in
"file:///c:/svn/code/sleuth/src/net/intellidata/sleuth/description/rules
/" and I'm getting the following exception:
RuleAgent(default) INFO (Mon Apr 07 13:14:40 MDT 2008): Configuring with
newInstance=true, secondsToRefresh=300
RuleAgent(default) INFO (Mon Apr 07 13:14:40 MDT 2008): Configuring
package provider : URLScanner monitoring URLs:
file:/c:/svn/code/sleuth/src/net/intellidata/sleuth/description/rules/
with local cache dir of .
java.lang.ClassCastException:
sun.net.www.protocol.file.FileURLConnection
at
org.drools.agent.HttpClientImpl.checkLastUpdated(HttpClientImpl.java:26)
at
org.drools.agent.URLScanner.hasChanged(URLScanner.java:141)
at
org.drools.agent.URLScanner.getChangeSet(URLScanner.java:108)
at
org.drools.agent.URLScanner.loadPackageChanges(URLScanner.java:88)
at
org.drools.agent.RuleAgent.checkForChanges(RuleAgent.java:330)
at
org.drools.agent.RuleAgent.refreshRuleBase(RuleAgent.java:298)
at org.drools.agent.RuleAgent.configure(RuleAgent.java:284)
at org.drools.agent.RuleAgent.init(RuleAgent.java:208)
at
org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:176)
at
org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:148)
at
net.intellidata.sleuth.description.rules.DescriptionRuleLoader.loadRules
(DescriptionRuleLoader.java:48)
at
net.intellidata.sleuth.description.rules.DescriptionRuleLoaderTest.testD
escriptionRuleLoader(DescriptionRuleLoaderTest.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown
Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at
junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUn
it3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.ja
va:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:196)
The goal here is to monitor the directory above for any changes to the
files or additional files that show up. Any help would be appreciated.
___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
3173 s. uravan way
aurora, colorado 80013
T: 720.524.4864
brian.trezise(a)intellidata.net
From: Paul Browne [mailto:paulb@firstpartners.net]
Sent: Friday, April 04, 2008 3:56 PM
To: Brian.Trezise(a)intellidata.net; Rules Users List
Subject: Re: [rules-users] Hot Deployment
Brian,
I'm guessing that you mean the RuleAgent Class. The Javadoc on this
class gives more info.
Code sample (assuming that you have the BRMS setup as per the doc).
You'll need to change to whatever settings are appropriate for your
BRMS.
Properties prop = new Properties();
prop.setProperty("url",uri);
prop.setProperty("newInstance", "true");
prop.setProperty("localCacheDir", ".");
prop.setProperty("poll", "300"); // poll every 300 seconds
for hot deployment.
//Get a new RuleBase using these properties
RuleAgent agent = RuleAgent.newRuleAgent(prop);
RuleBase rb = agent.getRuleBase();
Then use the RuleBase as normal
Paul
Brian Trezise wrote:
In the What's New? Section of the Drools 4.0 documentation there is a
reference in 1.1.2 to a "Rules Engine Agent for hot deployment and BRMS
integration". This would be ideal for the application I am currently
developing. However, this is the only mention of this agent anywhere in
the documentation. Does anybody know anything about this, how to use
it, any documentation about it?
Thanks,
___________________________________________________
Brian Trezise
Staff Software Engineer
IntelliData, Inc
3173 s. uravan way
aurora, colorado 80013
T: 720.524.4864
brian.trezise(a)intellidata.net
________________________________
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
16 years, 7 months
short data type validation
by jack wu
there is a regression in the latest 4.0.6 code base. with 4.0.2 the following rule would fail with an exception because i have defined a java "short" type for the variable "vshort" and the value "9999999999" is too large for a short type. but now this rule will execute without exceptions. is it intended? thanks.
rule "checkshort"
dialect "java"
when
Message( vshort < 9999999999 )
then
System.out.println( "===check short ok===" );
end
---------------------------------
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
16 years, 7 months
decision tables and attributes as parameters in function calls
by Jonathan Guéhenneux
hi,
I have no problem for this kind of rule :
rule "Primitive support"
when
$c : Cheese( price < 10 )
then
$c.setPrice( 10 )
end
but I would like to know what is the decision table for this small rule
rule "Primitive support"
when
$c : Cheese( $price : price )
then
$c.setPrice( $price * 2 )
end
I've tried a lot of syntax and I read the section abour the decision table in the manual but ididnt find anything.
_________________________________________________________________
Découvrez les profils Messenger de vos amis !
http://home.services.spaces.live.com/
16 years, 7 months
refire all rules
by Sibylle Duerr
Hi there,
is there a way to "reset" the working memory so that all the rules are
run again when fireAllRules() is called?
I know that normaly rules will only be run again when there was a change
and the fact was updated. but in my case I like to run all rules again
in some situations without having a change on the facts.
so is there a way to do this?
best regards
sibylle
16 years, 7 months
Rules File Design Consideration
by Chong Minsk Goh
Hi,
Any help to the problem below is much appreciated : )
Here is the problem:
I have a set of rules. Intially these rules are evaluated individually.
However, now there is a need to fire these rules in groups which is similar
to a logic gate AND or OR. And, the results of this "groups of rules" are
collected and returned to the user/
For example:
There are 4 rules:
Rule 1
Rule 2
Rule 3
Rule 4
Now, need to evaluate (Rule 1 AND Rule 2 AND Rule 3) OR Rule 4
And I need to know what are the results of Rule 1 to Rule 4 individually.
What is the best way to implement a AND or OR using Drools?
Best regards
Chong Minsk
16 years, 7 months
Short circuiting evaluations on LHS
by Newman, Jason
I am currently using Drools 4.0 to determine the best choice out of a data set
based on business rules. The rules eliminate (retract) facts until a single fact
survives, and is used for additional processing. I have found Drools to be a
great solution for this problem, and plan to role it out for additional survivor
rules. My problem is in optimization - this is essentially a batch processing
application, and speed is very important (of course it is - show me the case
where it isn't, right?).
Some of the later evaluations in the rules are fairly expensive (invoking
complex queries from the database), and generally apply to only a small set of
the use cases. For most use cases, the survivor will have been determined after
the first or second rule, so I only want to perform the expensive evaluations if
necessary. I have not found a way to avoid or schedule the LHS evaluations from
firing when inserting the fact into the working memory. I have played around
with agenda groups and rule flows, but haven't had any luck. The only way I can
think of at this point is to break my rules into separate rule bases, and
"manually" copy survivors from one working memory to the next, performing my own
short circuiting outside of the rules being fired.
Is there any other technique that I have missed? From a maintenance standpoint,
I would prefer to be able to use one rule base/rule flow to manage the rules
(there are only about 10 total rules, so the base is not very large - and I
would have to break it into 4 or 5 different rule bases, which seems like it
will be a pain across the 5 different areas I need to implement the rules.)
Thanks,
-Jason
The information transmitted (including attachments) is
covered by the Electronic Communications Privacy Act,
18 U.S.C. 2510-2521, is intended only for the person(s) or
entity/entities to which it is addressed and may contain
confidential and/or privileged material. Any review,
retransmission, dissemination or other use of, or taking
of any action in reliance upon, this information by persons
or entities other than the intended recipient(s) is prohibited.
If you received this in error, please contact the sender and
delete the material from any computer.
16 years, 7 months
Simple question
by Saleem Lakhani
Hi,
I am having trouble with accessing two same objects with different data
in working memory. When I print the list of working memory I see two
objects:
Com.model.PersonTO
Com.model.PersonTO
But I am not sure how to access each of them individually e.g; Person
object exists = person: PersonTO()
Please help.
Saleem Lakhani
16 years, 7 months