Hi,
On Wed, Oct 31, 2012 at 10:42 PM, Wolfgang Laun <wolfgang.laun(a)gmail.com> wrote:
Yes, you can create a query and call it in a function, as you'd
call
it in Java - see the Expert documentation.
I'm sorry, I could not find this syntax in the documentation - could
someone share the link?
Alternatively, consider using an insertLogical as in your Rule1,
putting the list into a simple wrapper class declared in DRL.
Or simply use "extends Rule1" in all the rules needing the collected
list, omitting the insert from Rule1.
These are OK. Thanks!
I think you can omit the first pattern from Rule1.
Yes, this is correct.
Cheers,
Miguel
On 31/10/2012, Miguel Paraz <mparaz(a)gmail.com> wrote:
> Hi,
> I have a rule like:
>
> rule "Rule1"
> when
> $fact: Fact1()
> $allFacts: ArrayList() from collect(Fact1())
>
> then
> insert(new Fact2($allFacts.size()));
> end
>
>
> I want to compute $allFacts inside a function since I will use it across
> different rules.
> This doesn't work because it is not valid Java syntax:
>
> function int size() {
> ArrayList a = ArrayList() from collect(InQueuePredicate());
> return a.size();
> }
>
> Could I put this in a named query, and call it from a function?
>
> Thanks!
> Miguel
>
_______________________________________________
rules-users mailing list
rules-users(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users