Re: [rules-users] Error Loading Multiple Input Files
by Fnu Mahalakshmi
Hi Greg,
I have my input files inside the src directory of my eclipse project.
I am passing the files as follows:
private static final String DATA_INPUT_FILE = new String []{ "Input1.txt", "Input2.txt"};
private static final String DATA_OUTPUT_FILE = "Output.1.txt";
private static final String RULES_FILES = new String [] {"Rule1.drl", "Rules2.drl"};
public static void main(String[] args) throws Exception {
BufferedReader input = new BufferedReader(new FileReader(DATA_INPUT_FILE));
Converter c = new Converter(DATA_INPUT_FILE); // this reads my input files
Vector<Object> v = new Vector<Object>();
v = c.getFactInput(); // loads all information contained in the input files
new RuleRunner().runStatelessRules(RULES_FILES,null, v,null); FileOutputStream output = new FileOutputStream(DATA_OUTPUT_FILE);
Error Log:
Exception in thread "main" java.io.FileNotFoundException: Input1.txt (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileReader.<init>(Unknown Source)
at com.org.RulesTest.main(RulesTest.java:29)
Can you tell me why that happens??
The file is present.
Thanks.
M
</pre>
<P><hr size=1></P>
<P><STRONG><font color=green>Please consider the environment before printing this email.</font></STRONG></P>
<P><STRONG>Visit our website at <a href="http://www.nyse.com">http://www.nyse.com</a> <br>
*****************************************************************************
<br>
Note: The information contained in this message and any attachment to it is privileged, confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by replying to the message, and please delete it from your system. Thank you. NYSE Euronext.
</STRONG></P><pre>
16 years
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
16 years
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
16 years
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
16 years
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
16 years
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
16 years
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
16 years
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
16 years
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
16 years
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
********************************************
16 years