[rules-users] Please help

Edson Tirelli tirelli at post.com
Fri Sep 28 10:24:02 EDT 2007


   I may be misinterpreting your message bellow, but the way I read it,
being sarcastic instead of explaining what is your problem will not make
people help you.

   I think you need to read the manual, Rule language chapter. To raise only
one exception in case there is on or more matches, use the "exists" CE:

 when
    exists( LineItem( $parent: parentId ) and LineItem( id != $parent ) )
then
    // raise the exception
end

    []s
    Edson

2007/9/28, Bhattacharya, Sougata <sougata.bhattacharya at capgemini.com>:
>
>  Oh yes this raises 30 exceptions if I have 6 Line Items
>
>
>  ------------------------------
>
> *From:* rules-users-bounces at lists.jboss.org [mailto:
> rules-users-bounces at lists.jboss.org] *On Behalf Of *Edson Tirelli
> *Sent:* Friday, September 28, 2007 6:53 PM
> *To:* Rules Users List
> *Subject:* Re: [rules-users] Please help
>
>
>
>
>
> when
>     LineItem( $parent: parentId )
>     LineItem( id != $parent )
> then
>     // raise the exception
> end
>
> 2007/9/28, Bhattacharya, Sougata < sougata.bhattacharya at capgemini.com>:
>
>
>
> Hi All,
>
>   I am using drool to validate my business objects. I have a Business
> object like this
>
> LineItem
>
>    String ID
>
>    String parentId
>
>
>
> I get 5 LineItems in a row and each line item has ID  and a Parent ID, I
> will have to check
>
>
>
> if(parented of Any LineItem ! = ID of any LineITem)
>
> I have to show an exception,
>
> Please help me to solve this
>
>
>
> Cheers
>
> Su
>
> This message contains information that may be privileged or confidential
> and is the property of the Capgemini Group. It is intended only for the
> person to whom it is addressed. If you are not the intended recipient, you
> are not authorized to read, print, retain, copy, disseminate, distribute, or
> use this message or any part thereof. If you receive this message in error,
> please notify the sender immediately and delete all copies of this message.
>
>
>
> This message contains information that may be privileged or confidential
> and is the property of the Capgemini Group. It is intended only for the
> person to whom it is addressed. If you are not the intended recipient, you
> are not authorized to read, print, retain, copy, disseminate, distribute, or
> use this message or any part thereof. If you receive this message in error,
> please notify the sender immediately and delete all copies of this message.
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>
>
>
> --
>   Edson Tirelli
>   Software Engineer - JBoss Rules Core Developer
>   Office: +55 11 3529-6000
>   Mobile: +55 11 9287-5646
>   JBoss, a division of Red Hat @ www.jboss.com
>  This message contains information that may be privileged or confidential
> and is the property of the Capgemini Group. It is intended only for the
> person to whom it is addressed. If you are not the intended recipient, you
> are not authorized to read, print, retain, copy, disseminate, distribute, or
> use this message or any part thereof. If you receive this message in error,
> please notify the sender immediately and delete all copies of this message.
>
>
> _______________________________________________
> rules-users mailing list
> rules-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
>


-- 
  Edson Tirelli
  Software Engineer - JBoss Rules Core Developer
  Office: +55 11 3529-6000
  Mobile: +55 11 9287-5646
  JBoss, a division of Red Hat @ www.jboss.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20070928/12c4b0b9/attachment.html 


More information about the rules-users mailing list