Re: [rules-users] new user - running examples
by Paul Sentosa
I experienced some problems too when I tried to import the examples for the first time.
I can't remember what I exactly did to solve them, but I end up deleting the project dependencies, and instead I put them(drools compiler, core, and other required plugins - listed in maven, but unfortunately didn't work for me as well) as referenced libraries. Try to clean and re-build your project and it should work
----- Original Message ----
From: Marcin Krol <mrkafk(a)gmail.com>
To: rules-users(a)lists.jboss.org
Sent: Tuesday, August 19, 2008 8:52:56 PM
Subject: [rules-users] new user - running examples
Hello everyone,
I am totally new to Drools (I have basic exposure to Java, nothing
more), hope that someone helps me with the following problem:
I have successfully imported Eclipse plugin and ran the DroolTest.java
example in Eclipse Europa (it worked OK). Then I imported Eclipse
example (4.0.7) project into Eclipse workspace.
But most of .drl files show error markers with messages like:
Rule 01:Unable to resolve ObjectType 'Cashflow' (example4.drl)
Now when I try to run Example4.java, I get the error:
The project: drools-compiler which is referenced by the classpath,
does not exist.
In Eclipse: menu Project | Properties | Java Build Path | Projects tab
shows drools-core and drools-compiler with yellow warning icons. Button
Edit is grayed out, there's nothing I can do to fix those items.
I have added drools-core-4.0.7.jar and drools-compiler-4.0.7.jar in Add
External JARs on Libraries tab, but this does nothing to resolve the
problem.
How do I fix those problems so I can run examples?
Regards,
Marcin
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users
16 years, 4 months
some basic questions to grouping
by psentosa
Hi,
I'm having some difficulty to understand the concept of grouping, but maybe
it's only because of my understanding of the terms, so please apologize for
the silly question
1. when you are saying "rules fire", does this mean: matching/checking the
LHS of rule, or executing the RHS of rule
2. I plan to use the grouping features of drools, but still not sure
whether(and how) to use the agenda or activation group (or even the
rule-flow). My problem domain is actually quite simple:
- rules are applied based on e.g age of a person. Now, there are some rules
for 17-year-or older, and some for 30-year-old person, if I'm to use the
agenda group, I'd define the following:
rule1
agenda-group "17 years-old or older"
when
p:Person (Age > 17)
....
rule2
agenda-group "17 years-old or older"
when
p:Person (Age > 17)
.....
rule3
agenda-group "30 years-old or older"
when
p:Person (Age > 30)
......
rule4
agenda-group "30 years-old or older"
when
p:Person (Age > 30)
......
If I assert a person into the WM to check his/her age, I want that only the
rules in 30-years-old agenda are CHECKED (and eventually executed when the
other constraints are fulfilled), bcs they are surely older than 17 as well.
And this is not only for comparing ages. Another example, some rules are
only for Gender.MALE, and some only for Gender.FEMALE. So if a person is
asserted, only the rules with corresponding gender will be checked and no
need of checking/matching the other group
The main purpose is just to skip checking unrelevant rules (imagine if there
is only 1 rule for MALE and 1000 rules for FEMALE with 1000 times WHEN
person (gender == FEMALE) checking for an asserted male-object).
How can I do this effectively? Or will ALL rules checked and only the order
of checking (and eventually exection of their RHS) is defined by the
grouping?
I hope I've described my problem clearly and I'll try to explain this again
in case of difficulty :)
Thanks in advance
Regards
--
View this message in context: http://www.nabble.com/some-basic-questions-to-grouping-tp19048066p1904806...
Sent from the drools - user mailing list archive at Nabble.com.
16 years, 4 months
new user - running examples
by Marcin Krol
Hello everyone,
I am totally new to Drools (I have basic exposure to Java, nothing
more), hope that someone helps me with the following problem:
I have successfully imported Eclipse plugin and ran the DroolTest.java
example in Eclipse Europa (it worked OK). Then I imported Eclipse
example (4.0.7) project into Eclipse workspace.
But most of .drl files show error markers with messages like:
Rule 01:Unable to resolve ObjectType 'Cashflow' (example4.drl)
Now when I try to run Example4.java, I get the error:
The project: drools-compiler which is referenced by the classpath,
does not exist.
In Eclipse: menu Project | Properties | Java Build Path | Projects tab
shows drools-core and drools-compiler with yellow warning icons. Button
Edit is grayed out, there's nothing I can do to fix those items.
I have added drools-core-4.0.7.jar and drools-compiler-4.0.7.jar in Add
External JARs on Libraries tab, but this does nothing to resolve the
problem.
How do I fix those problems so I can run examples?
Regards,
Marcin
16 years, 4 months
Using nested properties on guided editor
by Vinicius Carvalho
Hello there! I'm trying Guvnor 5.0M1 (really nice :)) after reading :
http://blog.athico.com/2008/08/machine-learning-and-apache-mahout.html
I thought I could use nested objects in my rules. For instance, I have a
technical rule:
when
$t: Trabalho( situacao.dscSituacao == "AGUARDANDO APROVAÇÃO" )
Situacao( dscSituacao == "EM APROVAÇÃO" )
then
$t.setSituacaoValida(true);
But I can't find a way to bind this using guided editor. I add the fact
Trabalho, bind it to $t variable, but when selecting a restriction to a
field, it ends on situacao, not letting me navigate deeper on the graph. Is
this possible? Do I need a latest version on the SVN in order to use this?
Best Regards
--
"In a world without fences and walls, who needs Gates and Windows?"
16 years, 4 months
DroolsTab plugin to Protege update
by Руслан Сорокин
Hello drools-users,
DroolsTab plugin to Protege update is published on http://oogis.ru/component/option,com_remository/Itemid,34/func,fileinfo/i...
New features:
- parallel-consecutive "tasks" instead of only consecutive "phases",
- "signal transmission" between scenarios and/or rule sets,
- using Protege server for remote signal transmission,
- better documentation,
- scenario development support.
New examples:
- "Terrorist Location Distribution",
- "Road Traffic",
- "Remote Police Work" (using Protege server),
- spatial scenario simulation server.
Comments are welcome.
Sincerely,
Ruslan Sorokin
sorokin(a)oogis.ru
16 years, 4 months
Drools 3.0.6 support for enum's on jdk 1.5 ?
by Maxim Veksler
Hello list,
I have a rule that generally speaking looks like this :
rule "ABC"
when
$f : FilteringStateConnector($campaignId : campaignId)
$campaign : Campaign(code == $campaignId
,$limitTypeEnum : limitTypeEnum, $limitByEventType :
limitByEventType)
// Check Budget limit pass conditions:
(
eval(BooleanLogging.trace(log, "DEBUG: " + ($limitTypeEnum ==
ENUM1.BudgetLimitFlag))) and
eval(BooleanLogging.trace(log, "DEBUG: Always here, right now"))
and
eval(BooleanLogging.trace(log, "DEBUG: " + ($limitByEventType ==
ENUM2._2_EXPOSED))) and
Campaign(code == $campaignId, limitTypeEnum ==
ENUM1.BudgetLimitFlag, limitByEventType == ENUM2._2_EXPOSED) and
eval(BooleanLogging.trace(log, "DEBUG: Right here, right now"))
) or (
...
)
then
...
end
The line """ eval(BooleanLogging.trace(log, "DEBUG: " +
($limitTypeEnum == ENUM1.BudgetLimitFlag))) """ evaluates to "true" in the
logs.
The line """ eval(BooleanLogging.trace(log, "DEBUG: " +
($limitByEventType == ENUM2._2_EXPOSED))) """ as well. These are java (eval)
checks for truth. If I try to use Drools to gain the rete optimization by
writing :
""" Campaign(code == $campaignId, limitTypeEnum ==
ENUM1.BudgetLimitFlag, limitByEventType == ENUM2._2_EXPOSED) """, It never
reachers past that line. why is that? Can't Drools 3 check for truthness of
Enum conditionals ?
I would love to supply more information if required.
Help is highly appreciated,
Maxim.
--
Cheers,
Maxim Veksler
"Free as in Freedom" - Do u GNU ?
16 years, 4 months
Queries with bound variables
by Senlin Liang
In the following program, i want to compute the paths:
<code>
rule "base"
when
edge : Edge(x : first, y : second)
not Path(first == x, second == y)
then
insert(new Path(edge.getFirst(), edge.getSecond()));
end
rule "recursive"
when
edge : Edge(x : first, z : second)
path : Path(first == z, y : second)
not Path(first == x, second == y)
then
insert(new Path(edge.getFirst(), path.getSecond()));
end
</code>
My question: How to express the query "path(cityA, X)?" efficiently in drools?
Since the first element is bound to 'cityA', I am wondering whether
drools can make use of it. I think there should be more efficient way
than firing all rules.
Thanks,
Senlin Liang
16 years, 4 months