Variable value not updated when passed to custom task
Posted: Tue Jan 20, 2015 8:50 am
Hi, we have an problem within a forEachLoop. A variable is updated from a record of the recordset itemsVariable used in the loop. We print its value with a print task and can see in the log it is updated for each record.
We also pass it to a custom task where we also log the passed variable, but here we see only the first value, but not the ones from the subsequent records.
Also in the custom task we log what the attributes we have in internalValidate()
1st run in the loop:
20-1-15 14:17:27 INFO Executing task 'print 1.0 (logTextSQL)'
20-1-15 14:17:27 INFO SQL statement : select TXT_XML CLOB1 from lxuvra where nr_ber = 78179124
20-1-15 14:17:27 INFO Finished task 'print 1.0 (logTextSQL)'
20-1-15 14:17:27 INFO getOracleCLOB Task started
20-1-15 14:17:27 INFO before expandVariables SQL is [select TXT_XML CLOB1 from lxuvra where nr_ber = ${curBerichtNr}]
20-1-15 14:17:27 INFO after expandVariables SQL is [select TXT_XML CLOB1 from lxuvra where nr_ber = 78179124]
20-1-15 14:17:27 INFO getOracleCLOB [select TXT_XML CLOB1 from lxuvra where nr_ber = 78179124]
20-1-15 14:17:27 INFO getOracleCLOB finished
2nd run in the loop
20-1-15 14:17:27 INFO Executing task 'print 1.0 (logTextSQL)'
20-1-15 14:17:27 INFO SQL statement : select TXT_XML CLOB1 from lxuvra where nr_ber = 78526229
20-1-15 14:17:27 INFO Finished task 'print 1.0 (logTextSQL)'
20-1-15 14:17:27 INFO getOracleCLOB Task started
20-1-15 14:17:27 INFO before expandVariables SQL is [select TXT_XML CLOB1 from lxuvra where nr_ber = 78179124]
20-1-15 14:17:27 INFO after expandVariables SQL is [select TXT_XML CLOB1 from lxuvra where nr_ber = 78179124]
20-1-15 14:17:27 INFO getOracleCLOB [select TXT_XML CLOB1 from lxuvra where nr_ber = 78179124]
20-1-15 14:17:27 INFO getOracleCLOB finished
It seems the setattribute does not get called at all after the first run. The second run there is no variable ${xyz} syntax present in the attribute text before expansion.
Is there something we need to do in the custom task to make this happen? Or is it a problem on the calling side of the custom task? I would not expect the latter, since the print task seems to work OK with the current variable value.
Cheers,
Joop
We also pass it to a custom task where we also log the passed variable, but here we see only the first value, but not the ones from the subsequent records.
Also in the custom task we log what the attributes we have in internalValidate()
1st run in the loop:
20-1-15 14:17:27 INFO Executing task 'print 1.0 (logTextSQL)'
20-1-15 14:17:27 INFO SQL statement : select TXT_XML CLOB1 from lxuvra where nr_ber = 78179124
20-1-15 14:17:27 INFO Finished task 'print 1.0 (logTextSQL)'
20-1-15 14:17:27 INFO getOracleCLOB Task started
20-1-15 14:17:27 INFO before expandVariables SQL is [select TXT_XML CLOB1 from lxuvra where nr_ber = ${curBerichtNr}]
20-1-15 14:17:27 INFO after expandVariables SQL is [select TXT_XML CLOB1 from lxuvra where nr_ber = 78179124]
20-1-15 14:17:27 INFO getOracleCLOB [select TXT_XML CLOB1 from lxuvra where nr_ber = 78179124]
20-1-15 14:17:27 INFO getOracleCLOB finished
2nd run in the loop
20-1-15 14:17:27 INFO Executing task 'print 1.0 (logTextSQL)'
20-1-15 14:17:27 INFO SQL statement : select TXT_XML CLOB1 from lxuvra where nr_ber = 78526229
20-1-15 14:17:27 INFO Finished task 'print 1.0 (logTextSQL)'
20-1-15 14:17:27 INFO getOracleCLOB Task started
20-1-15 14:17:27 INFO before expandVariables SQL is [select TXT_XML CLOB1 from lxuvra where nr_ber = 78179124]
20-1-15 14:17:27 INFO after expandVariables SQL is [select TXT_XML CLOB1 from lxuvra where nr_ber = 78179124]
20-1-15 14:17:27 INFO getOracleCLOB [select TXT_XML CLOB1 from lxuvra where nr_ber = 78179124]
20-1-15 14:17:27 INFO getOracleCLOB finished
It seems the setattribute does not get called at all after the first run. The second run there is no variable ${xyz} syntax present in the attribute text before expansion.
Is there something we need to do in the custom task to make this happen? Or is it a problem on the calling side of the custom task? I would not expect the latter, since the print task seems to work OK with the current variable value.
Cheers,
Joop