camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bilgin Ibryam <bibr...@gmail.com>
Subject Re: Dealing with a bean's return values
Date Wed, 08 Feb 2012 02:27:01 GMT
Hi Geoff,

If I got it right, you are trying to achieve something like this:

        <camel:filter>

<camel:simple>${bean:securityBean?method=interested}</camel:simple>
                <camel:bean ref="secDefConverter" method="convert"/>
                <camel:filter>
                     <camel:simple>${body} != null</camel:simple>
                     <camel:stop/>
                </camel:filter>

                          otherwise continue processing

            </camel:filter>

Just make sure the null check is correct.

HTH
Bilgin






On 7 February 2012 22:33, Gershaw, Geoffrey
<geoffrey.gershaw@credit-suisse.com> wrote:
> Hello,
>
>
>
> Hoping that someone can help me with beans in my route. I have created
> the following route. I am using 3 beans in the route.
>
>
>
> 1.       SecurityDefinitionFilter returns Boolean if we are interested
> in this SecurityDefinition
>
> 2.  SecDefConverter transforms SecurityDefinition to a CXRefData object.
> Returns null if there is a problem during transformation.
>
> 3.  CXRefDataCache caches the CXRefData object. Doesn't handle null.
>
>
>
>            <route >
>
>                  <from uri="direct:processSecurityDefinition" />
>
>                        <filter>
>
>
> <simple>${bean:SecurityDefinitionFilter}</simple><!--  Only process CDX
> -->
>
>                              <bean ref="SecDefConverter"
> method="convert"/><!--  SecDef to CXRefData   -->
>
>                              <bean ref="CXRefDataCache"
> method="put"/><!-- Cache RefData-->
>
>                        </filter>
>
>            </route>
>
> If a null value is returned by SecDefConverter.convert, I would like to
> filter out(stop moving forward in the route).
>
> If a non-null value is returned from SecDefConverter.convert, it  should
> be passed to CXRefDataCache
>
>
>
> Thanks,
>
>
>
> Geoff
>
>
> ===============================================================================
> Please access the attached hyperlink for an important electronic communications disclaimer:
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> ===============================================================================
>

Mime
View raw message