This e-mail is subject to the following Legal Notice
Hi Andreas,
The Key-Value variables don’t propagate from ChildJob A to Parent Job (Job A)
To do so, you can “elevate” the data value from child to parent using the global variable step in the child job, I made a basic example:
Parent Job (it calls the child and then prints the global variable generated by the child job):
<joblist> <job> <defaultTab>nodes</defaultTab> <description></description> <executionEnabled>true</executionEnabled> <id>81fc6558-70eb-4e04-8839-056bbf78706f</id> <loglevel>INFO</loglevel> <name>ParentJob</name> <nodeFilterEditable>false</nodeFilterEditable> <plugins /> <scheduleEnabled>true</scheduleEnabled> <sequence keepgoing='false' strategy='node-first'> <command> <exec>echo "hi"</exec> </command> <command> <jobref name='ChildJob' nodeStep='true'> <uuid>29b24a20-b5db-47c8-bc62-f510d854e58c</uuid> </jobref> </command> <command> <exec>echo "I am the parent and this is the child data variable: ${export.myglobal}"</exec> </command> </sequence> <uuid>81fc6558-70eb-4e04-8839-056bbf78706f</uuid> </job> </joblist>Child Job (generates a data value and then “elevates” that data to a global variable)
<joblist> <job> <defaultTab>nodes</defaultTab> <description></description> <executionEnabled>true</executionEnabled> <id>29b24a20-b5db-47c8-bc62-f510d854e58c</id> <loglevel>INFO</loglevel> <name>ChildJob</name> <nodeFilterEditable>false</nodeFilterEditable> <plugins /> <scheduleEnabled>true</scheduleEnabled> <sequence keepgoing='false' strategy='node-first'> <command> <exec>echo "mykey=myvalue"</exec> <plugins> <LogFilter type='key-value-data'> <config> <invalidKeyPattern>\s|\$|\{|\}|\\</invalidKeyPattern> <logData>true</logData> <regex>(.*)=(.*)</regex> <replaceFilteredResult>false</replaceFilteredResult> </config> </LogFilter> </plugins> </command> <command> <step-plugin type='export-var'> <configuration> <entry key='export' value='myglobal' /> <entry key='group' value='export' /> <entry key='value' value='${data.mykey*}' /> </configuration> </step-plugin> </command> <command> <exec>echo "I am the child, this is the global variable from data value: ${export.myglobal}"</exec> </command> </sequence> <uuid>29b24a20-b5db-47c8-bc62-f510d854e58c</uuid> </job> </joblist>The Key-Value variables “RUNDECK:DATA:a_key0=a_value0”can’t transmit from a Node to a Workflow step.
Same, try "elevating" the data value as a global variable. I made two scenarios:
Doesn’t work:
<joblist> <job> <defaultTab>nodes</defaultTab> <description></description> <executionEnabled>true</executionEnabled> <id>7574de32-4bbf-4b7d-b880-bc34f3ec1595</id> <loglevel>INFO</loglevel> <name>TestVariables</name> <nodeFilterEditable>false</nodeFilterEditable> <plugins /> <scheduleEnabled>true</scheduleEnabled> <sequence keepgoing='false' strategy='node-first'> <command> <exec>echo "mykey=myvalue"</exec> <plugins> <LogFilter type='key-value-data'> <config> <invalidKeyPattern>\s|\$|\{|\}|\\</invalidKeyPattern> <logData>false</logData> <regex>(.*)=(.*)</regex> <replaceFilteredResult>false</replaceFilteredResult> </config> </LogFilter> </plugins> </command> <command> <exec>echo ${data.mykey}</exec> </command> <command> <jobref name='AnotherChild'> <arg line='-opt1 ${data.mykey}' /> <uuid>89c160d4-845a-403e-bd58-4bd9b95e8110</uuid> </jobref> </command> </sequence> <uuid>7574de32-4bbf-4b7d-b880-bc34f3ec1595</uuid> </job> </joblist>It Works:
<joblist> <job> <defaultTab>nodes</defaultTab> <description></description> <executionEnabled>true</executionEnabled> <id>7574de32-4bbf-4b7d-b880-bc34f3ec1595</id> <loglevel>INFO</loglevel> <name>TestVariables</name> <nodeFilterEditable>false</nodeFilterEditable> <plugins /> <scheduleEnabled>true</scheduleEnabled> <sequence keepgoing='false' strategy='node-first'> <command> <exec>echo "mykey=myvalue"</exec> <plugins> <LogFilter type='key-value-data'> <config> <invalidKeyPattern>\s|\$|\{|\}|\\</invalidKeyPattern> <logData>false</logData> <regex>(.*)=(.*)</regex> <replaceFilteredResult>false</replaceFilteredResult> </config> </LogFilter> </plugins> </command> <command> <exec>echo ${data.mykey}</exec> </command> <command> <step-plugin type='export-var'> <configuration> <entry key='export' value='mywskey' /> <entry key='group' value='export' /> <entry key='value' value='${data.mykey*}' /> </configuration> </step-plugin> </command> <command> <jobref name='AnotherChild'> <arg line='-opt1 ${export.mywskey}' /> <uuid>89c160d4-845a-403e-bd58-4bd9b95e8110</uuid> </jobref> </command> </sequence> <uuid>7574de32-4bbf-4b7d-b880-bc34f3ec1595</uuid> </job> </joblist>Hope it helps!
Regards.