You are not logged in.
Announcement
Unanswered posts
|
Pages: 1
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

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
Offline
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

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
Offline
Hi ,
I will pass the context as a parameter from tjava to my class .
Thank you for your help.
JosephHasrouni
Pages: 1