I should note that hopefully you can limit this to something like $list :
ODAList (  )  (a specific extends type of list where you could specify some
criteria to be more specific with) or can assure that you only have one
List in play at that time, or you're going to spend some execution going
through every List in memory to check for these occurrences.

Jeremy


On Wed, Jan 16, 2013 at 10:50 AM, Jeremy Ary <[email protected]> wrote:

> Argh...Sorry, wrong key too early...here's the full changes:
>
> rule "Combine ODMAnswers"
>
>     when
>         $list : List(  )
>         $a1:ODMAnswer( some check ) from $list
>         $a2:ODMAnswer( assuming something making this one different than
> $a1 ) from $list
>     then
>         $list.add(new ODMAnswer(  ));
>         $list.remove($a1);
>         $list.remove($a2);
> end
>
>
> On Wed, Jan 16, 2013 at 10:47 AM, Jeremy Ary <[email protected]> wrote:
>
>> Try this;
>>
>> rule "Combine ODMAnswers"
>>
>>     when
>>         $a1:ODMAnswer( some check )
>>         $a2:ODMAnswer( assuming something making this one different than
>> $a1 )
>>
>>
>>         eval(odmList contains $a1 && odmList contains $a2)
>>     then
>>         ODMAnswer answer = new ODMAnswer(  );
>>         odmList.add(answer);
>>         odmList.remove($a1);
>>         odmList.remove($a2);
>> end
>>
>>
>> On Wed, Jan 16, 2013 at 10:41 AM, Bojan Janisch <
>> [email protected]> wrote:
>>
>>> rule "Combine ODMAnswers"
>>>
>>>     when
>>>         $a1:ODMAnswer(  )
>>>         $a2:ODMAnswer(  )
>>>
>>>         eval(odmList contains $a1 && odmList contains $a2)
>>>     then
>>>         ODMAnswer answer = new ODMAnswer(  );
>>>         odmList.add(answer);
>>>         odmList.remove($a1);
>>>         odmList.remove($a2);
>>> end
>>>
>>
>>
>>
>
_______________________________________________
rules-users mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/rules-users

Reply via email to