[rules-users] drl problem

Michael Anstis michael.anstis at gmail.com
Mon Apr 2 10:36:21 EDT 2012


Assuming:-

Phone() {
  String number;
  PhoneTC phoneTc;
}

PhoneTC() {
  String tc;
}

Then something like this should work:-

when
  Phone( $n1 : number, $tc : phoneTc.tc )
  Phone( number == $n1, phoneTc.tc != $tc )
then


On 2 April 2012 15:19, arup <arup4u2007 at gmail.com> wrote:

> Hi,
> i'm having some problems(more like i'm just getting confused) while
> creating
> a rule for my project.
> I have 2 classes say Phone() and PhoneTC() like below:
>
> Phone()
> {
> String number;
> }
>
> PhoneTC()
> {
> String tc;
> }
>
> also PhoneTC() is inside the Phone() class. like:
>
> Phone()--String number
>             PhoneTC()--------String tc
>
>
>
> now i need to create a rule like this....
>
> when phone numbers are same and the tc values are different for that number
> then do something.
>
> will this work??
>
> when
> ph1: Phone(number1 : number)
> phtc1: PhoneTC(tc1 : tc)
> Phone(number == number1) and PhoneTC(tc != tc1)
> then
> ........
>
>
> can u suggest better rule for the requirement??.... thanks in advance... :)
> :) :)
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/drl-problem-tp3877814p3877814.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20120402/a2898747/attachment.html 


More information about the rules-users mailing list