Problem with running examples from drools-distribution-5.2.0
by Scholz. Ulrich
Dear all,
I try to run the examples given in http://download.jboss.org/drools/release/5.2.0.Final/drools-distribution-... (Drools 5.2.0 final downloads)
I've installed the plugin and the example as given in ReadMeDrools.txt
Nevertheless, I get many Eclipse errors (1913) and cannot run the example. For example, the first error is
Description Resource Path Location Type
[ERR 102] Line 56:49 mismatched input '&&' expecting ')' in rule "Free Fish Food Sample" PetStore.drl /drools-examples/src/main/resources/org/drools/examples/petstore line 56 Drools Error
If I run the example despite the errors, I get the message "Could not find the main class: org.drools.examples.DroosExamplesApp. Program will exit."
What could I do?
Thanks, Ulrich
--
Eclipse Java EE IDE for Web Developers.
Version: Indigo Release
Build id: 20110615-0604
(c) Copyright Eclipse contributors and others 2005, 2011. All rights reserved.
Visit http://www.eclipse.org/webtools
--
Graphical Editing Framework GEF 3.7.0.v20110425-2050-777D-81B2Bz0685C3A6E34272 org.eclipse.gef.feature.group Eclipse Modeling Project
Graphical Editing Framework Draw2d 3.7.0.v20110425-2050-46-7w3122153603161 org.eclipse.draw2d.feature.group Eclipse Modeling Project
JBoss Drools Core 5.2.0.v20110116-0638-H14 org.drools.eclipse.feature.feature.group JBoss by Red Hat
JBoss Drools Guvnor 5.2.0.v20110116-0638-H14 org.guvnor.tools.feature.feature.group JBoss by Red Hat
JBoss Drools Task 5.2.0.v20110116-0638-H14 org.drools.eclipse.task.feature.feature.group JBoss by Red Hat
--
...
SEEBURGER AG Vorstand/Seeburger Executive Board:
Sitz der Gesellschaft/Registered Office: Bernd Seeburger, Axel Haas, Michael Kleeberg
Edisonstr. 1
D-75015 Bretten Vorsitzender des Aufsichtsrats/Chairperson of the Seeburger Supervisory Board:
Tel.: 07252 / 96 - 0 Dr. Franz Scherer
Fax: 07252 / 96 - 2222
Internet: http://www.seeburger.de Registergericht/Commercial Register:
e-mail: info(a)seeburger.de HRB 240708 Mannheim
Dieses E-Mail ist nur f?r den Empf?nger bestimmt, an den es gerichtet ist und kann vertrauliches bzw. unter das Berufsgeheimnis fallendes Material enthalten. Jegliche darin enthaltene Ansicht oder Meinungs?u?erung ist die des Autors und stellt nicht notwendigerweise die Ansicht oder Meinung der SEEBURGER AG dar. Sind Sie nicht der Empf?nger, so haben Sie diese E-Mail irrt?mlich erhalten und jegliche Verwendung, Ver?ffentlichung, Weiterleitung, Abschrift oder jeglicher Druck dieser E-Mail ist strengstens untersagt. Weder die SEEBURGER AG noch der Absender ( Scholz. Ulrich ) ?bernehmen die Haftung f?r Viren; es obliegt Ihrer Verantwortung, die E-Mail und deren Anh?nge auf Viren zu pr?fen.
The present email addresses only the addressee which it targets and may contain confidential material that may be protected by the professional secret. The opinions reflected herein are not necessarily the one of the SEEBURGER AG. If you are not the addressee, you have accidentally got this email and are not enabled to use, publish, forward, copy or print it in any way. Neither SEEBURGER AG , nor the sender (Scholz. Ulrich) are liable for viruses, being your own responsibility to check this email and its attachments for this purpose.
14 years, 11 months
Globals from functions...
by bob.breitling
I have a global defined and I am trying to use it from a function. When my
rule gets loaded into my knowledge base, I always get an error complaining
about the global not being resolved.
---- simplified snippet ----
global int x;
function void foo(int n) {
x = n;
}
------------------------------
I get this kind of error "Function Compilation error: foo (line:20) x can
not resolved".
Should this work?
TIA,
Bob
--
View this message in context: http://drools.46999.n3.nabble.com/Globals-from-functions-tp3186882p318688...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 11 months
[Drools4]: Filter executed rules by *.drl file
by magendo
Before I start do explain my problem I should say that I have already
searched through the older posts and found similiar problems but not exactly
the following one:
My Application has multiple RuleFiles (*.drl each with its own package)
which can be dynamically added/removed. Based on a context (lets say String
foo = "bar") only the rulepackage which fits to "bar" should be executed.
Usually that isnt a problem, because drools just executes the rules with the
fitting facts. But in this case all the rules in the rulepackages check the
same type of facts.
Currently I am using an AgendaFilter (if rulepackage == xyz { accept =
true}) to achieve this goal, but firstly it doesnt effect inserting of facts
(LHS of every rule is executed) and secondly I have read that it should only
be used for unit testing, since it couples java code with rule behavior.
While reading older posts I have found two possible solutions that could
work:
1. Using a contextObject which has foo and is checked in the first rule of
each rulepackage. This first rule and the remaining rules in the rulepackage
have the same agenda group. So if the first rule doesnt fit, the other rules
wont be executed, either (does this really work? ;)).
2. Putting every rulepackge in its own rulebase. Then I would check the
context in java and execute the fitting rulebase.
Let's say I have about 300 *.drl files. Which solution would be better?
Maybe there is a better solution 3) of which I didnt think yet. Then dont
hesitate and tell it to me :)
Thanks in advance for any help.
--
View this message in context: http://drools.46999.n3.nabble.com/Drools4-Filter-executed-rules-by-drl-fi...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 11 months
Unexpected variable binding behavior and conditional logic
by ChrisG
Apologies if this has been addressed elsewhere: I couldn't find anything
quite like my issue.
My (greatly simplified and completely made-up) example:
Let's say I have this java class:
public class BaseballPitcher
{
public String getName();
public boolean isRightHanded();
public boolean isKnuckleBaller();
}
Multiple instances of this class are created with a variety of combinations
for the name and two boolean parameters.
Now I have a rule:
rule "Match pitchers: righties or knuckle-ballers"
when
$kbPitcher1 : BaseballPitcher($name: name, $righty: rightHanded == true
||
$knuckleballer: knuckleBaller == true)
$kbPitcher2: BaseballPitcher(name != $name, rightHanded == $righty,
knuckleBaller == $knuckleballer)
then
// Do something with these two pitchers $kbPitcher1 and $kbPitcher2
end
I am getting the curious result that this rule fires its conclusion when
$kbPitcher1 is in fact NEITHER right-handed nor a knuckle-baller (i.e.
rightHanded == false && knuckleBaller == false).
I've worked around this by changing the first condition in either of the
following two ways:
*// eval() the condition*
$kbPitcher1 : BaseballPitcher($name: name, $righty: rightHanded,
$knuckleballer: knuckleBaller,
*eval(isRightHanded() == true || isKnuckleBaller() == true)*)
...or....
*// bind the variables before checking values*
$kbPitcher1 : BaseballPitcher($name: name, $righty: rightHanded,
$knuckleballer: knuckleBaller,
*rightHanded == true || knuckleBaller == true*)
Does this make sense? Both are easy workarounds, and I believe the second
option (i.e. the one NOT using the eval) is the better solution from a
performance perspective, allowing the engine to index the these facts rather
than dynamically evaluate the condition every time.
But I'm a little surprised the first approach didn't work. Any ideas why
not?
--
View this message in context: http://drools.46999.n3.nabble.com/Unexpected-variable-binding-behavior-an...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 11 months
I'm on google+ follow me there
by Mark Proctor
follow me at google+ on mdproctor(a)gmail.com. Mention you are a expert
system person, so I add you to the right circle.
Mark
14 years, 11 months
Sheriff rota
by Mark Proctor
Toni, Jervis, Michael, Geoffrey,
Starting from next month I'd like a Guvnor "sheriff" rota. I want you
each to take it in turns, a month at a time, to wear the Sheriff badge.
That person is then responsible for keeping the build blue, managing
jira (keeping it up to date) and chasing people to fix bugs. So in
general handling communications and keeping the project running
smoothley. Also they will be responsible for the minute taking of the
weekly minutes, so it's not all geoffrey.
Please work out a rota between yourselves and update that "holiday"
google sheet that michael made with that information. I also suggest you
update #guvnor with that month's Sheriff. Make sure john and prakash
have access to that google sheet.
Mark
14 years, 11 months
concurrent modification of a rule by more than one user in Guvnor
by puja nandamuri
Hi All,
I am currently testing 5.2.0.CR1 version of Guvnor.
Can multiple users modify a rule in Guvnor at the same time? what are the issues involved in say, two users trying to change
1. the same row in a decision Table at the same time and saving it.
2. different rows in a decision table at the same time and saving it.
Are there any documentation or articles to get more information on concurrent access within Guvnor?
Thank You,
ram.
14 years, 11 months
BPMN editor not working
by Jamie
I'm trying to move from Drools 5.1.1 to 5.2 and I'm reworking my .rf files
into .bpmn files, but I've run into an issue - I use the wizard to create a
new file like MainFlow.bpmn. After I create it, I open it using the BPMN2
process editor and all is well. However, if I add anything to the diagram
and close it, I get an error when I try to reopen it. "An exception
occurred while reading in the RuleFlow XML:null See the error log for more
details".
Any ideas what might be wrong? Where would I find the error log?
--
View this message in context: http://drools.46999.n3.nabble.com/BPMN-editor-not-working-tp3182776p31827...
Sent from the Drools: User forum mailing list archive at Nabble.com.
14 years, 12 months
priority based on object properties
by Simon Chen
Hi all,
I am curious if we can inform Drools' execution based on properties
within objects.
In particular, the salience value is defined for each rule, in the
sense that rule A has priority over rule B to execute. I am wondering
if we can define some kinda of salience metric, such that object X has
higher priority than object Y to be executed in the same rule.
To give an example, I am (still) playing with implementing shortest
path using a few rules. I have a rule for selecting a shortest path on
a node (among all the paths received from its neighbors) to a source
node, and another rule for propagating the shortest path on a node to
neighboring nodes. When I have many nodes in my graph, I found that
the paths propagated (via the second rule) are not always the
shortest, while Dijkstra's algorithm always "propagate" from the node
with the shortest distance to the source. The effect is that my rules
are wasting most of the time propagating paths that would be dropped
in the end anyway...
Any ideas?
Thanks.
-Simon
14 years, 12 months