Hello,
I
am trying to achieve something like a SQL statement equivalent of:
SELECT r.property1 AS
p1, r.property2 AS p2, SOME_CALCULATION(r.property3) AS p3
FROM right AS
r
GROUP BY p2, p3
I
am not sure if this is valid SQL since I am grouping by a calculated value, but
that aside.
I
am asserting the Rights objects into the working memory and then would like to
execute a rule on the objects based
on
a grouping of objects. The first property is directly accessible from the
object right.getProperty2() but the
second
property is only accessible through a lookup MyClass.staticMethod(right.getProperty3()).
As
far as I have it the rule should make use of something like collect or accumulate but I do not know how to
achieve
this without also asserting the properties objects into the memory as well. And
even if I assert the properties
objects
into the working memory I do not know how to group by the second property.
rule "Calculate something"
no-loop
when
$rights:
ArrayList( )
from collect( Right( ) );
then
// execute rule
end
Could
you please give me some assistance?
Regards
Juan