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:
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.
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