This commit is contained in:
Grzegorz Michalski
2026-03-02 09:47:35 +01:00
commit 2c225d68ac
715 changed files with 130067 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
{% macro get_workflow_status() %}
{% if execute %}
{% set run_sql %}
select case when sum(case when tht.load_successful in ('W','Y') then 0 else 1 end) = 0 then 'Y' else 'N' end status
from {{ source('control_tables','A_WORKFLOW_HISTORY') }} wh
join {{ source('control_tables','A_TASK_HISTORY') }} th on wh.a_workflow_history_key = th.a_workflow_history_key and wh.service_name = th.service_name
join {{ source('control_tables','A_TASK_HISTORY_TARGET') }} tht on th.a_task_history_key = tht.a_task_history_key and th.service_name = tht.service_name
where wh.service_name = '{{ var("input_service_name") }}'
and wh.workflow_name = '{{ var("workflow_name") }}'
and wh.orchestration_run_id = '{{ var("orchestration_run_id") }}'
{% endset %}
{% set res = run_query(run_sql) %}
{% set status = res.columns[0].values()[0] %}
{{ return(status) }}
{% endif %}
{% endmacro %}