Hi Team,
we are trying to loop the dict values in the Orquesta workflows .however we got the error.
Variable name : sql_server_report
output:
run:
exit_code: 0
result:
output: "{1=>‘DESTD01__SQLHealthCheckResults2021-08-05.html’,2=>‘GSQL01__SQLHealthCheckResults2019-06-24T06.00.01.8333200-0600.html’}
"
Error :
result:
errors:
- message: ‘YaqlEvaluationException: Unable to evaluate expression ‘’<%
dict(ctx().sql_server_report).values() %>’’. NoMatchingFunctionException: No functi
on “dict” matches supplied arguments’
workflow design :
next:
- when: “{{ succeeded() }}”
publish:
- sql_server_report: “{{ result().output.run.result.output | to_json_string }}”
- report_file_check: true
- run: “{{ result().output.run }}”
do:
- report_file_content
- when: “{{ failed() }}”
publish:
- error_message: “{{ result().output.run.result.details.result_set[0].value._error.msg + ‘\n’ }}”
- error_output: “{{ result().output.run.result.details.result_set[0].value._output if ‘_output’ in
result().output.run.result.details.result_set[0].value else ‘’ }}”
- run: “{{ result().output.run.result.details.result_set[0].value._error.msg }}”
- run_error: true
- report_file_check: false
do:
- fail
report_file_content:
with: <% dict(ctx().sql_server_report).values() %>
action: core.echo message=<% item() %>
next:
- when: “{{ succeeded() }}”
do:
- noop
- when: “{{ failed() }}”
do:
- noop
while execute the command with: <% dict(ctx().sql_server_report).values() %> got the below error.
result:
errors:
-
message: 'YaqlEvaluationException: Unable to evaluate expression ‘’<% dict(ctx().sql_server_report).values()
%>’’. NoMatchingFunctionException: No functi
on “dict” matches supplied arguments’