[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!
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.
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?
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.
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" )