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

Announcements
Qlik and ServiceNow Partner to Bring Trusted Enterprise Context into AI-Powered Workflows. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Value from subjob

I'm trying to pass/store a value from one subjob to be used in another subjob, and am trying to find the best way.  

I tried to implement what is described in the below post (pass a Map to the subjob as a context parameter) but ran into unexpected results. 

https://www.talendbyexample.com/talend-returning-values-from-subjobs.html

 

The issue I run into is in the subjob I'm unable to retrieve the context parameter as a Map.  When I check the class of context param it is showing it as java.lang.String instead of java.util.concurrent.ConcurrentHashMap.  If I use a ContextDump -> LogRow the output seems to indicate it's a Map

 

 

Context Parameter Setup

sharedMap (Object)

 

ParentJob

tJava

 

context.sharedMap = new java.util.concurrent.ConcurrentHashMap();

 

 

sharedMap.getClass().getName() = java.util.concurrent.ConcurrentHashMap

 

SubJob

Options

  • Use independent process
  • Transmit whole context

sharedMap.getClass().getName() = java.lang.String

 

ContextDump -> LogRow results indicate the value appears to be a Map

|sharedMap         |{parentJob=parentJob value}                        | 

 

Follow-up questions:

* Why does the Object context param get converted to String when passed to the subjob?

* Is there a different/better way I should be handling what I'm trying to do?  I can't store the value in a globalMap because the globalMap only applies to the job being run.  

Labels (1)
1 Reply
fdenis
Master
Master

you can use tbufferoutput.