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 <jeremy.ary@gmail.com> 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 <jeremy.ary@gmail.com> 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 <bojan.janisch@scai.fraunhofer.de> 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