• Index
  •  » Talend Open Studio for Data Integration » Component creation
  •  » Usage of context variables in "Routine" creation

#1 2012-07-23 10:24:10

JosephHasrouni
Guest

Usage of context variables in "Routine" creation

Tags: [context]

Hello Admins .

I am using TIS 4.2 .

I am creating a new "Routine" in order to use it in my tjava Component , but I have a problem while using the context in my class !!

the "context.variableName" cause a compilation error .

How to use the context in my class ? Advice Plz



Thanks in advance
JosephHasrouni

#2 2012-07-23 10:32:07

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: Usage of context variables in "Routine" creation

Hi

First, you need to add this context variable in the Talend job.
Switch to the "Contexts" tag below the job design area. And click on "+" button to add it.

Regards,
Pedro


Only Paranoid Survive.

Offline

#3 2012-07-23 11:00:47

JosephHasrouni
Guest

Re: Usage of context variables in "Routine" creation

Hi ,

Thanks for your help !

That works only when using a context in a job m but I want to use the context in a class created by myself
like TalendString , TalendDate ,...

How to use it inside my class ? that is my question .

Thanks
JosephHasrouni

#4 2012-07-23 11:04:35

pedro
Member
Registered: 2011-11-17
Posts: 3682

Re: Usage of context variables in "Routine" creation

Hi

The context variable needs to be based on a Talend job. No job, no context.
So you have to use a parameter in your custom routine.

In short, you cannot use context variable in routine directly. The only way is to pass it as a parameter of a Java method.

Regards,
Pedro


Only Paranoid Survive.

Offline

#5 2012-07-23 11:14:54

josephHasrouni
Guest

Re: Usage of context variables in "Routine" creation

Hi ,

I will pass the context as a parameter from  tjava to my class .

Thank you for your help.
JosephHasrouni

  • Index
  •  » Talend Open Studio for Data Integration » Component creation
  •  » Usage of context variables in "Routine" creation

Board footer

Powered by FluxBB