I suspect Person 1 and Person 2, plus Person 2 and Person 1 are matching. Try putting a sysout in the RHS showing the people matched to confirm.

sent on the move

On 29 Mar 2012 08:16, "arup" <arup4u2007@gmail.com> wrote:

i have one drl like below:

rule "FirstNameDifference"
no-loop true
lock-on-active true
       when
               person1: Person( $firstName1: firstName )
               person2: Person( firstName != $firstName1 )

       then
               dataDifferenceVO.getDataDiffArray().add("Person/FirstName");
end

i'm passing a list of objects in which i have 2 person type objects. my aim
is to check if the firstnames are same or different. if its different i need
to add one String to the DataDiffArray that is declared inside
DataDifferenceVO class.

but as i pass 2 person objects in the WM the rule is getting executed twice.
i.e, the string "Person/FirstName" is getting added twice in the array list.
why is this happening?... the rule should compare 2 firstnames and return
one String...is not that?... what step should i take to achive what i
want....
Thanks a lot i advance... :) :) :)

--
View this message in context: http://drools.46999.n3.nabble.com/drl-execution-problem-tp3866929p3866929.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users