Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
cancel
Showing results for 
Search instead for 
Did you mean: 
JackStrong
Contributor
Contributor

context variables are not populated correctly

Hi All.

I observed that one of my job behaves strange.

I am running the in Talend Studio because I'm testing it. But currently I am not able to test anything because context variables are not populated correctly.

Every time when I am changing values of context variable it looks like it is not propagated to components inside the job. There is still previous (old) value.

What I observed is when I deactivate all components in the job then run the job and then activate all components again, the new value of the context variable is propagated to components/job.

I am changing context variables by "Contexts" tab/view.

The strange thing is that even when I put as the first component in the job tJava component to print values of the context variables, printed values is not correct meaning it is previous/old value.

I don't know why is that. Maybe some old (not up to date) code is generated by java or maybe this is something regarding workspace.

Is there any way to fix it?

Do you know if there is a way to clean and refresh whole java code from the scratch to remove some old (not valid any more) code?

Regards.

Labels (2)
6 Replies
anselmopeixoto
Partner - Creator III
Partner - Creator III

Hello @Michal Swiniarski​ 

 

The Java code and classes generated from your jobs are stored inside the "poms" directory under your workspace/project directory.

 

It is safe to delete what is inside "poms" directory as it will be re-generated again when you run your jobs. But I suggest you do a backup first.

JackStrong
Contributor
Contributor
Author

Hi anselmopeixoto.

Thanks for your input.

 

I have just created the new job from the scratch without copying nothing (no copying components, subjobs, nothing). For all components I added them to job and I configured them manually to avoid any automatic activities in the background.

Unfortunately it didn't help. My new job behaves the same way like original one, meaning it is impossible to change the context variable value in the Context view and then to see and use the changes in the job.

It looks like context variables are not able to pass any changes.

 

But what is strange when I run my job from different job (parent job) I can pass new values (changes) from parent job to child job without any issue (I can pass new values and child job behaves correctly).

So it looks like the issue is only when I want to pass values by Context view/tab.

 

I don't know but maybe the issue is related with tRestClient component. I created a lot of jobs and there are no issue. This one problematic job includes tRestClient component.

 

Did anyone observe similar behaviour and can help to fix the issue?

 

Regards.

jlolling
Creator III
Creator III

First of all: context variables always be used correctly within the component.

To different possible reasons if not:

The context variable value is overwritten by a part of the job before or the implicite context load

The job code is not changed, the studio still use old code and you new changes are not applied. Try to change something significant and check the job afterwards.

You can also printout the context variables with tContextDump on different locations in the job and find out where they are changed.

 

JackStrong
Contributor
Contributor
Author

Hi jlolling.

 

I added tContextDump at the beginning of the job (the first component in the job; second is tLogRow) and at the end of the job (the last but one component in the job; the last one is tLogRow). Both printed values (tLogRows) are not correct, meaning both are old.

Currently I am pretty sure that the problem is with tRestClient. Why? Because when I deactivate tRestClient, I am able to propagate context variables changes.

But when I activate it, it is not possible to propagate context variable changes. The job see the previous values (values as they were before changing).

When I look at the Code view there is nowhere the place where context variables values are hardcoded.

 

Best regards.

jlolling
Creator III
Creator III

I some situations a misconfiguration of a component can prevent the job code from building. Please check the studio logs in workspace/.metadata/.log

If you like please post the content here. There must be something!

jlolling
Creator III
Creator III

The variables get the values from a job internal properties file. Indeed there are no hart coded values in the job code.

The problem is related to a build problem and therefore the internal property files is also not changed. Please take a look at the studio logs. There must be something to find!