#1 2012-07-18 12:10:58

vnodkmar
Member
Registered: 2012-02-10
Posts: 32

retrieve context variables from cbean

From cbean, How do i retrieve context variables that i configured for route?

Offline

#2 2012-12-10 16:46:02

lgaspar
Member
Registered: 2012-12-10
Posts: 13

Re: retrieve context variables from cbean

Hi
Anybody knows how to do this?

Offline

#3 2012-12-11 04:18:36

xdshi
Moderator
Registered: 2012-08-27
Posts: 2127

Re: retrieve context variables from cbean

Hi,

Sorry for the delay, which version do you use? After the Talend upgrade, there is a new component called -cBeanRegister in Talend 5.2 and you can set the "Specify Arguments"in it to retrieve context variables directly.  If you have the lower version, you need use cSetHeader and cBean.
See pics


Best regards
Sabrina


Uploaded Images

Last edited by xdshi (2012-12-11 04:21:55)


What we can do is to make sure that Talend will be your best choice!

Online

#4 2012-12-11 08:08:42

lgaspar
Member
Registered: 2012-12-10
Posts: 13

Re: retrieve context variables from cbean

Thanks for your answer!
I use 5.1, so I can use the cSetHeader + cBean method.

Is there a way to get information back from a bean into a route (header or context) ?

Best regards
Laci

Offline

#5 2012-12-11 08:22:54

gusto2
Member
Company: Apogado
Registered: 2011-09-27
Posts: 164
Website

Re: retrieve context variables from cbean

Hello Laci,

Context variables are intended for configuration purposes and not to dynamically pass data somewhere else, so there are no many means to set context values them in the mediation route.

If you pass an Exchange variable into a bean (a processor), you have access to all information - to the current camel context, in and out messages. What else you need..

Have fun
      Gabriel

Last edited by gusto2 (2012-12-11 08:25:50)


Gabriel Vince
Senior Consultant
Apogado
www.apogado.com

Offline

#6 2012-12-11 10:12:19

lgaspar
Member
Registered: 2012-12-10
Posts: 13

Re: retrieve context variables from cbean

Hi Gabriel
thanks for your answer.

I tried to set a header property in my bean (theExchange.getIn().setHeader("testProperty", "testValue");
but I don't see that property in the following components.

How can I do this?
Or is there another way to do it?

Thanks
Laci

Offline

Board footer

Powered by FluxBB