Need Help: Errors while running FibonacciExample
by venkatesh devalapura nagabhushana
Hi,
After successfully compiling the example code FibnacciExample.java, I
tried to run it, I get the following error, let me know how to solve it:
java FibonacciExample
Exception in thread "main" java.lang.ExceptionInInitializerError
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
at org.drools.semantics.java.RuleBuilder.<clinit>() (Unknown Source)
at java.lang.Class.initializeClass() (/usr/lib/libgcj.so.6.0.0)
at
org.drools.compiler.PackageBuilder.addRule(org.drools.lang.descr.RuleDescr) (Unknown Source)
at
org.drools.compiler.PackageBuilder.addPackage(org.drools.lang.descr.PackageDescr) (Unknown Source)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(java.io.Reader)
(Unknown Source)
at FibonacciExample.main(java.lang.String[]) (Unknown Source)
at gnu.java.lang.MainThread.call_main() (/usr/lib/libgcj.so.6.0.0)
at gnu.java.lang.MainThread.run() (/usr/lib/libgcj.so.6.0.0)
Caused by: java.util.regex.PatternSyntaxException: At position 2 in
regular expression pattern:
expected end of character class
(.*)\bmodify\s*\(([^)]+)\)(.*)
^
at java.util.regex.Pattern.Pattern(java.lang.String, int)
(/usr/lib/libgcj.so.6.0.0)
at java.util.regex.Pattern.compile(java.lang.String, int)
(/usr/lib/libgcj.so.6.0.0)
at org.drools.semantics.java.KnowledgeHelperFixer.<clinit>() (Unknown
Source) at java.lang.Class.initializeClass()
(/usr/lib/libgcj.so.6.0.0)
...8 more
Is it require to place .drl file in the same directory as that of the
source code ?
Thanks,
Venkatesh
The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments.
WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.
www.wipro.com
17 years, 5 months
PropertyChangeListeners vs. modify()
by Dirk Bergstrom
Reading through the sources, it looks like property change listeners simply end
up calling modify(). This implies that you're better off not using them if
you'll be changing more than one property at a time, since you'll just be
calling modify() a bunch of times. Better to change all the properties, then
call modify() once.
Is this a fair reading, or am I missing something?
--
Dirk Bergstrom dirk(a)juniper.net
_____________________________________________
Juniper Networks Inc., Computer Geek
Tel: 408.745.3182 Fax: 408.745.8905
17 years, 9 months
retracting a fact after all interested rules have fired??
by Justine Hlista
Need some instruction for retraction strategies. We have an application that
receives messages about the status of various things in the system, and at
the moment I am asserting these messages as facts. The rules are written
against these messages. Various rules might be interested in various values
in the message, and they all fire independently. The problem is that after
all the existing rules that are interested in the message have fired, I want
to retract the message. How do I ensure that all the interested rules have
fired first??
At the moment, I am trying to use a salience value of -1 to make sure a
simple "cleanup" rule fires last:
rule "cleanupMessage"
no-loop true
salience -1
when
msg : MyMessage()
then
retract(msg)
end
Does this sound like a reasonable solution? Is there a better one??
Thanks!
17 years, 9 months
Converting this DRL into a Decision Table
by Vargas, Michael E
Hi,
I'm currently trying to convert this Rules into a Decision
Table:
rule "JobLevel"
when
p : Person( status == Person.NOTRUN, age == "27", person)
then
System.out.println(p.getJobLevel());
p.setJobLevel("You're a rookie");
p.setStatus(Person.RUN);
modify(p);
System.out.println(p.getJobLevel());
end
The thing I can't seem to figure out is how to bind the p variable to an
object person. Any help would be much appreciated!!
Regards,
Michael Vargas
17 years, 9 months
Newbie: Is this feasible w/ Drools?
by Alexander Richter
Hello,
I work in a bioinformatics group and we're interested in using Drools
for setting up an assertion engine for biological processes.
We have over 300 genomes ( == sets of facts), each with upwards of
10K genes/features with annotations ( == facts). We want to be able
to predict whether various biological processes exist, based on
presence of the annotated genes that are the components of the
process. Asserted processes are not black and white; we may have
various levels of certainty, based on the percentage of component
genes found (because we can't be certain that not finding a certain
annotation means the the gene isn't in the genome -- it could mean
that we just didn't find it). In addition, processes tend to be
composed of sub-processes. The assertions then get used to make
additional annotations on the features, which we then use to help us
look for missing components. Therefore, we need to be able to display
the decisions that led to a specific assertion, as well as the
features that went into the component assertions.
In addition, we regularly add new processes, as we get new ways to
annotate genes, or read about newly worked-out processes. We really
don't want to have to run all rules against all the genomes every
time we add a new rule, but just add that rule.
We would like to define the actual rules for the assertions in
Drools, but don't know how we would do certain parts.
1) Can one walk through the rule hierarchy from a given rule and
tease out the hierarchy of rules and the facts that went into that rule?
2) Is it possible to add a rule, or set of interacting rules, and
have them incrementally evaluated, instead of forcing full
evaluation? Alternatively, can the rulesets be individually defined
and run in such a way that they interact?
Thanks,
Alexander Richter
17 years, 9 months
RuleBaseImpl Error - Help needed
by kingston
Hi,
I am a beginner.
I am using DSL Syntax. I get errrors like
org.drools.rule.InvalidRulePackage: unknown:7:48 mismatched token:
[@16,48:49='&&',<55>,1:48]; expecting type ')'
unknown:8:0 Unable to expand: ;. Due to Expression was not expandable:
at org.drools.rule.Package.checkValidity(Unknown Source)
at org.drools.reteoo.RuleBaseImpl.addPackage(Unknown Source)
at student.DroolsStudent.main(DroolsStudent.java:50)
Where can i get the API documentation for RuleBaseImpl classs and other
classes like WorkingMemoryImpl ?
Are there any sets of DO's and DONT's to be followed frame rules in DSL
Syntax ?
--
View this message in context: http://www.nabble.com/RuleBaseImpl-Error---Help-needed-tf3308727.html#a92...
Sent from the drools - user mailing list archive at Nabble.com.
17 years, 9 months