Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] Component uses default context value instead of just loaded one

Hello,
I'm loading context from a csv file in a prejob and after it is loaded I print it with tjava component and it shows me a correct value.
However when I try using it in a tSalesforceGetUpdated as a start and end dates, the component seems to use the default dummy values instead of just loaded ones. 
Does anyone has any idea how to fix this?
Any help is very much appreciated!

Gabriele
Labels (4)
9 Replies
Anonymous
Not applicable
Author

Hi,
Could you please give us your job setting screenshots? In this way, we can see if there is something wrong with your setting.
Best regards
Sabrina
Anonymous
Not applicable
Author

Hello, of course: So the dates are correct in the context that I load, but too early in the defaults. It seems like context values are set, but the component still uses the defaults.
0683p000009MFXn.png 0683p000009MFcM.png 0683p000009MFf5.png
Anonymous
Not applicable
Author

Are you sure that the default dates are being used or is that an assumption? Could you set the default dates to the ones you think are correct (the ones you are setting using the tContextLoad) and let us know what happens?
Anonymous
Not applicable
Author

Yes, if I put the same dates I load in context as default values then it runs:
0683p000009MFZm.png
Anonymous
Not applicable
Author

OK. here used to be an issue with setting context variables in code (in tJava) components that would happen like this, but you are using the tContextLoad. This is strange. The only thing I can think of adjusting is to link your subjobs using the OnSubJobOK connectors rather than the OnComponentOK connectors. If that makes a difference, this could be a bug.

Also, could you show us how the Salesforce component is configured if the above doesn't solve your issue.
Anonymous
Not applicable
Author

I changed to onSubjobOk links - nothing changed.

Also, if I do not set any default values for context variables, then it throws an error :
0683p000009MFfA.png
in the java code:

0683p000009MFfF.png
it seems ir can't find any value. Altough tJava component can successfuly print loaded values, but the Salesforce component can't see it.

0683p000009MFMd.png
Anonymous
Not applicable
Author

Yes, the component configuration:

0683p000009MFJC.png
Anonymous
Not applicable
Author

Thank you for your help.
I still don't know why the loaded context can't be reached from the tSalesforceGetUpdated component, but
I was able to get the functionality I needed by setting global Map variable in the tJava with the loaded context value:
globalMap.put("LastCheck", context.timeLast);
and writing expression directly in the tSalesforceGetUpdated component field:
Start Date: (String)globalMap.get("LastCheck")
End Date: TalendDate.getDate("CCYY-MM-DD hh:mm:ss" )
Anonymous
Not applicable
Author

This appears to be a bug with the component. https://jira.talendforge.org/browse/TDI-36865

Just saw your post. Given the description of the problem in their Jira, I am surprised that works. However, if it does that's great!