entity-condition question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

entity-condition question

Muhammad Aamir
If a I pass a social security number, it doesn't bring any thing, however
searching by name works:

        <entity-condition list="parties" entity-name="Person">
            <condition-list combine="and">
                <condition-list combine="or">
                    <condition-expr field-name="firstName" operator="like"
                        value="${parameters.name}%" ignore-case="true" />
                    <condition-expr field-name="middleName" operator="like"
                        value="${parameters.name}%" ignore-case="true" />
                    <condition-expr field-name="lastName" operator="like"
                        value="${parameters.name}%" ignore-case="true" />
                </condition-list>
                <condition-expr field-name="socialSecurityNumber"
                    operator="equals"
from-field="parameters.socialSecurityNumber" ignore-if-empty="true"
ignore-if-null="true"/>
            </condition-list>
        </entity-condition>

Thanks
Muhammad Aamir
Reply | Threaded
Open this post in threaded view
|

Re: entity-condition question

Adrian Crum-2

Maybe your first condition-list element should be:

<condition-list combine="or">

-Adrian

--- On Fri, 5/29/09, Muhammad Aamir <[hidden email]> wrote:

> From: Muhammad Aamir <[hidden email]>
> Subject: entity-condition question
> To: [hidden email]
> Date: Friday, May 29, 2009, 2:19 PM
> If a I pass a social security number,
> it doesn't bring any thing, however
> searching by name works:
>
>         <entity-condition
> list="parties" entity-name="Person">
>            
> <condition-list combine="and">
>                
> <condition-list combine="or">
>                
>     <condition-expr field-name="firstName"
> operator="like"
>                
>         value="${parameters.name}%"
> ignore-case="true" />
>                
>     <condition-expr field-name="middleName"
> operator="like"
>                
>         value="${parameters.name}%"
> ignore-case="true" />
>                
>     <condition-expr field-name="lastName"
> operator="like"
>                
>         value="${parameters.name}%"
> ignore-case="true" />
>                
> </condition-list>
>                
> <condition-expr field-name="socialSecurityNumber"
>                
>     operator="equals"
> from-field="parameters.socialSecurityNumber"
> ignore-if-empty="true"
> ignore-if-null="true"/>
>            
> </condition-list>
>         </entity-condition>
>
> Thanks
> Muhammad Aamir
>



Reply | Threaded
Open this post in threaded view
|

Re: entity-condition question

Muhammad Aamir
Hi Adrian, thanks for the reply but it makes no sense at least to me.

On Sat, May 30, 2009 at 12:54 AM, Adrian Crum <[hidden email]> wrote:

>
> Maybe your first condition-list element should be:
>
> <condition-list combine="or">
>
> -Adrian
>
> --- On Fri, 5/29/09, Muhammad Aamir <[hidden email]> wrote:
>
> > From: Muhammad Aamir <[hidden email]>
> > Subject: entity-condition question
> > To: [hidden email]
> > Date: Friday, May 29, 2009, 2:19 PM
> > If a I pass a social security number,
> > it doesn't bring any thing, however
> > searching by name works:
> >
> >         <entity-condition
> > list="parties" entity-name="Person">
> >
> > <condition-list combine="and">
> >
> > <condition-list combine="or">
> >
> >     <condition-expr field-name="firstName"
> > operator="like"
> >
> >         value="${parameters.name}%"
> > ignore-case="true" />
> >
> >     <condition-expr field-name="middleName"
> > operator="like"
> >
> >         value="${parameters.name}%"
> > ignore-case="true" />
> >
> >     <condition-expr field-name="lastName"
> > operator="like"
> >
> >         value="${parameters.name}%"
> > ignore-case="true" />
> >
> > </condition-list>
> >
> > <condition-expr field-name="socialSecurityNumber"
> >
> >     operator="equals"
> > from-field="parameters.socialSecurityNumber"
> > ignore-if-empty="true"
> > ignore-if-null="true"/>
> >
> > </condition-list>
> >         </entity-condition>
> >
> > Thanks
> > Muhammad Aamir
> >
>
>
>
>
Reply | Threaded
Open this post in threaded view
|

RE: entity-condition question

bsanders1979
Your condition looks like: (firstName like "${parameters.name}%" ||
middleName like "${parameters.name}%" || lastName like
"${parameters.name}%") && socialSecurityNumber equals
parameters.socialSecurityNumber)

You are ANDing the name conditions with the SSN condition when you
should be ORing. So, Adrian is saying that '<condition-list
combine="and">' should be '<condition-list combine="or">'

-----Original Message-----
From: Muhammad Aamir [mailto:[hidden email]]
Sent: Saturday, May 30, 2009 12:20 PM
To: [hidden email]
Subject: Re: entity-condition question

Hi Adrian, thanks for the reply but it makes no sense at least to me.

On Sat, May 30, 2009 at 12:54 AM, Adrian Crum <[hidden email]>
wrote:

>
> Maybe your first condition-list element should be:
>
> <condition-list combine="or">
>
> -Adrian
>
> --- On Fri, 5/29/09, Muhammad Aamir <[hidden email]> wrote:
>
> > From: Muhammad Aamir <[hidden email]>
> > Subject: entity-condition question
> > To: [hidden email]
> > Date: Friday, May 29, 2009, 2:19 PM
> > If a I pass a social security number,
> > it doesn't bring any thing, however
> > searching by name works:
> >
> >         <entity-condition
> > list="parties" entity-name="Person">
> >
> > <condition-list combine="and">
> >
> > <condition-list combine="or">
> >
> >     <condition-expr field-name="firstName"
> > operator="like"
> >
> >         value="${parameters.name}%"
> > ignore-case="true" />
> >
> >     <condition-expr field-name="middleName"
> > operator="like"
> >
> >         value="${parameters.name}%"
> > ignore-case="true" />
> >
> >     <condition-expr field-name="lastName"
> > operator="like"
> >
> >         value="${parameters.name}%"
> > ignore-case="true" />
> >
> > </condition-list>
> >
> > <condition-expr field-name="socialSecurityNumber"
> >
> >     operator="equals"
> > from-field="parameters.socialSecurityNumber"
> > ignore-if-empty="true"
> > ignore-if-null="true"/>
> >
> > </condition-list>
> >         </entity-condition>
> >
> > Thanks
> > Muhammad Aamir
> >
>
>
>
>