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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tRunJob does not transfer Context variables when "Use dynamic job" sel

tRunJob does not transfer Context variables when "use dynamic job" selected.
I am running into issue of transfering context variables to SubJob, when tRunJob is set as "Use dynamic job".
The goal is to set up context variables in job "ContextLoad" and pass them through to dynamically changing Subjob.
Scenario:
1) create Main job called "ContextLoad" and add 2 context variables: DataFileFolder, DBName
2) drop 2 components into this job: tJava and tRunJob. connect tJava with tRunJob using "OnSubjobOK"
3) Enter code below to tJava component:

// Define Context variables
//
context.setProperty("DataFileFolder","D:/tmp/Test/");
context.setProperty("DBName","testingDB");
System.out.println("BEFORE the SUBJOB:");
System.out.println("Data File Folder: " + context.getProperty("DataFileFolder"));
System.out.println("DBName: " + context.getProperty("DBName"));

4) Create another Job called "Display_context_vars" and add 2 context variables: DataFileFolder, DBName
5) Drop one tJava componenet into this job.
6) Enter code below into this component:

System.out.println("INSIDE of the SUBJOB:");
System.out.println("Data File Folder: " + context.getProperty("DataFileFolder"));
System.out.println("DBName: " + context.getProperty("DBName"));
7) Save job "Display_context_vars"
😎 go back to job "ContextLoad"
9) configure tJobRun componenet as below:
- check on "Use dynamic job"
- enter "Display_context_vars" to "Context Job" text field
- click "..." button beside "Job" and select job "Display_context_vars" from the list
- click "Transmit whole context" check box
10) run job "ContextLoad". If you received same results as me, than you were able to reproduce my issue:
Starting job ContextLoad at 18:13 01/03/2012.
connecting to socket on port 3991
connected
BEFORE the SUBJOB:
Data File Folder: D:/tmp/Test/
DBName: testingDB
INSIDE of the SUBJOB:
Data File Folder: null
DBName: null
disconnected
Job ContextLoad ended at 18:13 01/03/2012.
Labels (3)
11 Replies
Anonymous
Not applicable
Author

Hi Elena
My TOS is also 5.0.1.
I delved into the code in your job "ContextLoad" and found some useless methods in it.
public void connectionStatsLogsProcess()

This must be due to code generation issue.
Now copy all these components into a new job.
I guess this issue will be fixed.
Regards,
Pedro
Anonymous
Not applicable
Author

Hi Pedro,
Thank you for your detailed review of the code.
I tried your suggestion.
Unfortunately, it did not work for me.
New Job has same issue - it is inconsistent with transferring Context variables to SubJob when Dynamic job is selected.
Please let me know if you have another suggestions.
Thank you in advance,
Elena