how to fire a subset of rules in KB?
by wenjinchao
Hi all,
I'm a newbie for drools.
And i want to know how to fire a subset of rules in KB,
suppose there are three rules named A,B,C, and I want to fire rule A only.
by the way,
suppose there is a drl file containing rule, and i have set up KB, and call fireAllRules through statefulKnowledgeSession. After that, the rule file is changed, how to load rules dynamicly?
Is there any solution?
Thanks in advance!
best regards.
2010-06-07
wenjinchao
15 years, 9 months
Drools 5.1.0.M2 - BPMN2 process issue - Eclipse plugin. -- The method getTextContent() is undefined for the type Node
by Vijay K Pandey
Hi,
I just downloaded the Drools 5.1.0.M2 (have been using the snapshot version of around 16th April 2010) - created a sample "rule flow file(start-->user task-->end) - bpmn2 version". But when I clicked the file to open it gave the following error (image attached)
"The method getTextContent() is undefined for the type Node" .
I understand this error is related to org.w3c.dom.Node where this method was added as part of DOM Level 3 and available in JDK 5+ . My project and eclipse is configured against JDK 6+ . Not sure why this error with M2.
May be it is because of the drools-bpmn2.jar included in the drools eclipse plugin? Can someone shed some light that where it might be going wrong.
[cid:image001.png@01CB05D0.DAC32670]
Thanks
Vijay
15 years, 9 months
Re: [rules-users] Error Loading multiple input files
by Greg Barton
How are you translating the input file into POJOs? Not being able to find a file on your system has little to do with drools.
Can you list the code that throws the FileNotFoundException?
GreG
On Jun 6, 2010, at 9:09 PM, Mahalakshmi <mr2809(a)nyu.edu> wrote:
Hi,
I have 3 separate text files with my input data. I need to load all the input files data to my working memory and then fire the rules on this data.
I am able to work with just 1 input file. But when I try to add multiple files - which I tried by adding an array of input files - my program terminates giving me a FileNotFoundException.
Same problem occurs if I try to add an multiple .drl files ( different rule files).
Can you guys please help me. Not understanding how to solve this error.
Also, how can I add my modified data to a new file. My new file gets created and the rules which are fired do modify my data as required ( printed it on the console)
But how do I store this information back to my working memory and print it out to my output file.
All my input files have only 1 field in common otherwise are not related.
Is it a better option to have all data in only 1 input file??
Thanks you.
-M
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
15 years, 9 months
Error Loading multiple input files
by Mahalakshmi
Hi,
I have 3 separate text files with my input data. I need to load all the
input files data to my working memory and then fire the rules on this data.
I am able to work with just 1 input file. But when I try to add multiple
files - which I tried by adding an array of input files - my program
terminates giving me a FileNotFoundException.
Same problem occurs if I try to add an multiple .drl files ( different rule
files).
Can you guys please help me. Not understanding how to solve this error.
Also, how can I add my modified data to a new file. My new file gets created
and the rules which are fired do modify my data as required ( printed it on
the console)
But how do I store this information back to my working memory and print it
out to my output file.
All my input files have only 1 field in common otherwise are not related.
Is it a better option to have all data in only 1 input file??
Thanks you.
-M
15 years, 9 months
RuleAgent in webservice
by shekharputtur puttur
Hi All,
I am using drools API, and developed a webservice out of it.
I created rule binary package using BRMS Guvnor.
I used RuleAgent to acces the properties file.
ie RuleAgent agent = RuleAgent.newRuleAgent("/
application.properties");
"application.properties" file was stored in current working directory.
I executed my application using eclipse, it was fine .
For testing purpose i deployed the application in tomcat application
server.
Now it is unable to find "application.properties" file. and shows following
in "catalina.out" file:
java.lang.NullPointerException
at java.util.Properties$LineReader.readLine(Properties.java:418)
at java.util.Properties.load0(Properties.java:337)
at java.util.Properties.load(Properties.java:325)
at org.drools.agent.RuleAgent.loadFromProperties(RuleAgent.java:299)
at org.drools.agent.RuleAgent.newRuleAgent(RuleAgent.java:256)
My question is, in which location should i keep the "application.properties"
file , so that RuleAgent can access it.
Could you please tell me the solution.
Thanks & Regards
Shekhar
15 years, 9 months
Feediing events into Drools Fusion
by djerir smail
Hi ,
I am reading about how to put events in and out from Drools fusion , I
have found pipeline as a solution for input events but is it possible
to use pipeline also for output events ? and is there any other
solutions to connect Drools fusion to other event sources ?
Please Help
Smail
15 years, 9 months
Boolean logic fail?
by Matthew Runo
Hello folks -
We noticed something weird today, and was hopeing that someone here might be able to explain it for us a bit.. Here's the rule we had:
eval( -1 < 0 or
8 > 1 or
182 < 0 or
0 == 0);
This was failing, but doesn't it seem like it should work? To get it to work, we tried this:
eval( (-1 < 0) or
(8 > 1) or
(182 < 0) or
(0 == 0));
... but that didn't compile. We then tried this (and it worked!):
eval( (-1 < 0) ||
(8 > 1) ||
(182 < 0) ||
(0 == 0));
So, my question is simply - why? What's the difference between "or" and || - and when should we use them?
Thanks for your time!
Matthew Runo
Software Engineer, Zappos.com
mruno(a)zappos.com - 702-943-7833
15 years, 9 months
Sunday Morning, June 6th, 0600 GMT
by James C. Owen
Greetings:
I know, I know - this is NOT about rules nor rulebased systems nor
anything like that. But, sometimes, we need to reach as many people
as possible who may or may not be interested in what we need to say
and please forgive me for this minor indiscretion. (But, I'll
probably do it again in December)
OK, what’s so special about June 6th? Next Sunday morning at 0600 GMT
- NOT Daylight Savings Time - will mark the 66th year since the
invasion of Europe by the Allied forces at Normandy, France, on June
6, 1944. Remember, the war in England and the rest of Europe had been
going on since September, 1939, when this happened.
Unless you are over 40 (or had a father figure in the military) you
probably don’t know about Normandy and D-Day. I asked 10 or 15 people
at Best Buy the other night and got all blank looks except for one
future-Marine (just enlisted) who knew it had something to do with a
war or a battle or something like that. Look up “D-Day Normandy” on
Google. Or, better yet, go watch “Saving Private Ryan” [there is a
brief blurb is on YouTube at http://www.youtube.com/watch?v=qrjNEReJI2Q&feature=related
] or "The Longest Day” (terrible acting but far more vivid than
anything up until that time) [another brief blurb at http://www.youtube.com/watch?v=s-hzm6lkQPI&NR=1
] - the stuff on YouTube or watching the movie will give you a WAY
more graphical and personal point of view than just reading about it
on the computer screen.
Regardless, having a “Monday in May” (that's what we did in the USA)
for all veterans of all wars doesn’t seem to cover the carnage of D-
Day and Omaha Beach. The U. S. Army Center for Military History
claims over 60,00 USA dead and wounded at Omaha Beach on that one
day. If the Germans could have had another six months to prepare, the
British and Canadians would not have walked ashore at Gold and Juno
beaches nor the other Americans at Utah and Sword beaches, although
the Allies at Utah beach did receive a pretty warm welcome. We can
also be thankful that Adolph totally ignored his Generals and kept the
15th Panzer division locked up at
Total dead (mostly dead – not much in the way of medical aid that day)
and wounded for the USA that day was over 135,000 US Army and
Marines. The UK (a much smaller nation) lost 65,000 of their finest
that day. the Germans lost 320,000 men (30K killed, 80K wounded, 210K
MIA) in the Heer or Wehrmacht regular army, not so much the Waffen SS
who were stationed elsewhere at the time. In addition, there were
12,000 civilian casualties killed or missing. All total: a number
that was over 500,000 humans died in one battle that one day. Please,
try to remember all of them on Sunday morning; USA, UK, Canadian,
French, Polish, Austrian, German, Russian, all of them.
SDG
jco
CoFounder DRG 2000
CoFounder ORF-2008/ORF-2009
http://www.DallasRulesGroup.org
http://www.OctoberRulesFest.org
http://www.RulesFest.org
15 years, 9 months
Re: [rules-users] rules-users Digest, Vol 42, Issue 139
by John Peterson
Checked my file and it was named selectors.properties (with the 's').
Apparently, I made a typo while typing in my issue. The file was there
from my installation (I didn't create it myself). I'm still having the
error, though.
------------------------------
Hi,
the file should be called
selectors.properties and not
selector.properties - I've just fixed that in the tutorial.
Thanks,
Jarek
John Peterson wrote:
> I?m working off of Jaros?aw Kijanowski?s blog post from 7/8/2009 on
> using Selectors:
>
>
_http://www.kijanowski.eu/index.php?site=articles&article=guvnor_selecto
rs&lang=en_
>
<http://www.kijanowski.eu/index.php?site=articles&article=guvnor_selecto
rs&lang=en>
>
> I?ve followed the instructions for a DRL selector, including adding a
> line to the selector.properties file as follows:
>
> onlyNonDraftRules=/NonDraft.drl
>
> Both the NonDraft.drl file and selector.properties file are here:
>
> <parent
>
directory>\jboss-4.2.3.GA\server\default\deploy\drools-guvnor.war\WEB-IN
F\classes
>
> My NonDraft.drl is as follows:
>
> package org.drools.guvnor.server.selector
>
> import org.drools.repository.AssetItem
>
> import org.drools.guvnor.server.selector.Allow
>
> rule 'non draft rules'
>
> dialect 'mvel'
>
> when
>
> AssetItem(stateDescription != "Draft")
>
> then
>
> insert(new Allow());
>
> end
>
> When I try to do a ?Build Package? in Guvnor, I get the following
error:
> ?Name: com.sample, Format: package, Message: The Selector named
> onlyNonDraftRules is not available?
>
> My package in Guvnor has a few rules, only one of which is not in
Draft
> status. Everything is built in Guvnor (including Facts - no code is
> written in Eclipse).
>
> Has anyone seen this error before and know how to correct it? I?m
using
> 5.0.1.
>
>
>
------------------------------------------------------------------------
>
> _______________________________________________
> rules-users mailing list
> rules-users(a)lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
------------------------------
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
End of rules-users Digest, Vol 42, Issue 139
********************************************
15 years, 9 months
Exception handling policy
by Gerret Hansper
Hello,
I have got a question about Exception handling policy in Drools 5.0.
My issue is a case where a client application triggered rule execution on the
server, which was throwing a ConsequenceException.
The client, not having drools libs in its classpath, then had a
ClassNotFoundException.
I would therefore want to catch the ConsequenceException on the server and throw
an Exception with its cause.
I am not sure however if ConsequenceException.getCause() would always yield a
non-drools Exception or if that might be another drools type.
Also, is it always a ConsequenceException that gets thrown from a session or can
there be other Exception types?
Thanks,
Gerret
15 years, 9 months