Guvnor cluster problems
by jayadev
One of our business users made changes to a rule package - added an excel
sheet, modified few existing excel sheets, but, his changes are not
reflected on the second server [load balancer took him to server1] On his
screen he can see the total number of excel sheets as 41, but, when I login
[and load balancer took me to server2] I see total number of excel sheets as
40.
So, I added a new excel sheet with that name on server2. Now when business
user tries to pull the list of excel sheets he gets an
"InvocationTargetException" What could be the problem?
--
View this message in context: http://drools.46999.n3.nabble.com/Guvnor-cluster-problems-tp3528970p35289...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month
multi-factor rule
by Ronald Albury
Hi - I am a Drools newbie and I apologize in advance if the answer to my
question is intuitively obvious to the casual user.
I have an object that has two fields: location(there are more than 50
locations) and age. I am having difficulty building clean rules for the
following pseudo-code
// Rule One
if(location == "A") {
if(age > 60)
do_something();
}
// Rule Two
else if(location == "B") {
if(age > 70)
do_something();
}
// Rule Three
else if(location == "C") {
if(age > 80)
do_something();
}
// Rule Four
else {
if(age > 65)
do_something();
}
The issue comes with Rule Four. How do I avoid writing the rule so that I
don't have to say (location!="A"&&location!="B"&&location!="C") ? I also
don't want to have to write an explicit rule for every possible location.
I considered an activation-group with salience to have the rules executed
in order, but the problem is that if rules 1-3 do not fire, then rule 4
fires for all locations - I can get a hit if location=="C" and age==70.
Is it possible to have a 'Map' and do something like
(age>map.get(location)) ? I could live with creating a map with all
possible locations for key, although I'd rather not go this route.
This problem is typical for the types of rules I'll be writing ... there
can be completely different sets of rule criteria depending on location.
Thanks in advance for your suggestions and your patience.
13 years, 1 month
Multiple Insert and negative rule
by annam2011
Hello,
I'm a newbie to drools.
I would like to know why i get the following output on the console :
Test Message found!!
No strange message :-)
Test Message found!!
Test Message found!!
NotifyEngineTest.java creates 10 events. Rule "test2" should be activated
with every event,
so that the output should look like this:
Test Message found!!
No strange message :-)
Test Message found!!
No strange message :-)
Test Message found!!
No strange message :-)
Could somebody help me with this ?
I appriciate your help
Thanks in advance,
Anna
// NotifyEngineTest.java//
for (int i = 0; i < 10; i++){
Event e = new Event();
e.setId("ID"+Math.random());
e.setTimestamp(new Date());
e.setCatagory("TEST");
e.setMessage( i + " Test");
e.setSystem("localhost");
ruleEngine.insert(e);
_____________________________________________________________________
// RuleEngine.java//
public void insert(Event e) throws RuleEngineException {
FactHandle factHandle = ksession.insert(e);
int numberOfRules = ksession.fireAllRules();
logger.debug("Rules fired: "+numberOfRules);
}
______________________________________________________________________
// Notify.drl//
rule "test"
salience 10
when
$r: Event(message matches ".*Test.*")
then
System.out.println("Test Message found!! "+ $r);
end
rule "test2"
salience 5
when
not ( Event( (system == "anySystem" && catagory == "anyCatagory" ) ||
(system == "anyHost" && message matches ".*Hello.*")))
then
System.out.println(" No strange message :-) ");
end
____________________________________________________________________
--
View this message in context: http://drools.46999.n3.nabble.com/Multiple-Insert-and-negative-rule-tp353...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month
How to use contains with a function
by Hezi Stern
Hi all,
I encountered the following issue:
As an example TaskConectxt() holds a list of time related objects called
times.
I would like to write a rule which ideally would filter the TaskContext
according to a specific time object.
The problematic restriction is that this time object is derived using a
helper function (imported), in this case called getTimeByID which received
as input an enum ID of a time and returns the desired time object.
Ideally the rule would like something like this:
rule "verify time"
when
$tc: TaskContext(times contains
getTimeByID(ETimeID.NOW))
then
//something
end
unfortunately this does not work.
Is there any way to call a function with a param?
Is there a better alternative method than this one?
Thanks,
Hezi
13 years, 1 month
Rules that cumulate on consequence
by lansyj
hi folks
We are working on a requirement that requires us to have multiple rules that
could fire for a given input and for all the rules that fire, we would want
to cumulate the consequence to reach the final consequence.
As an example, if we want to identify the credit score for a person, based
on his gender you might want to assign/increment/decrement the score, then
based on nationality, and so on.
So, considering the long list of such criteria, having rules that cover all
scenarios and are still mutually exclusive isnt a scalable solution. Could
you please advice on how this could be achieved.
We run Drools 5.1.1 and Guvnor; rules are made using the guided editor with
DSLs.
Awaiting your support,
Best Regards
-lj
--
View this message in context: http://drools.46999.n3.nabble.com/Rules-that-cumulate-on-consequence-tp35...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month