how to do things like "distinct"?
by Simon Chen
Hi all,
I have the following problem.
Let's say, I have a class Number3(), with three fields a, b, and c.
I have the following rule:
rule "test3"
when
Number3($a: a, $b: b)
$minvalue: Number()
from accumulate(Number3(a == $a, b == $b, $c: c), min($c))
then
System.out.println($a + " " + $b + " " + $minvalue);
end
Say, I have four objects (1,2,3), (1,2,4), (1,3,4), (1,3,5).
The result shows four lines:
1 3 4.0
1 3 4.0
1 2 3.0
1 2 3.0
But I want the output to be:
1 3 4.0
1 2 3.0
meaning that for each unique pair of a and b, I want the rule to fire only once.
Is this doable?
Thanks.
-Simon
15 years
Create rules programatically
by David Godfrey
Hi,
Can someone point me in the direction of documentation or code examples for
the following? I want to programatically create rules for execution, e.g.
within my application I will hold criteria which users will define, at
runtime I would like to build a component to extract these values (from my
app database) and build rules based on those values. Everything I've seen so
far seems to talk about using DRL files, ideally I want to programatically
create the entire rule in Java, and then call Drools to execute my rule set.
Thanks,
15 years
Java 7 Support
by Sebastian
Hello,
I tried to use Drools with the OpenJDK 7, but I could not get it to work.
After some debugging I found out, that the map nativeVersions in
EclipseJavaCompilerSettings is missing version 1.7 which is actually defined
as a public static variable.
Can you tell me when you plan on adding JDK7 support?
kind regards,
Sebastian
--
View this message in context: http://drools.46999.n3.nabble.com/Java-7-Support-tp3010251p3010251.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
15 years
Re: [rules-users] Reuse of rule
by Küng Sabrina
Thanks for your input. I am looking forward to the plugin.
How can I use a rule in the if-part (or as precondition) of another rule? Is that possible without using a ruleflow?
________________________________
From: Küng Sabrina
Sent: Montag 30 Mai 2011 13:52
To: 'rules-users(a)lists.jboss.org'
Subject: Reuse of rule
Hello
How can I write a rule, that can be used in several other packages resp. rulesets without copying the code?
15 years