<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
  <info>
    <name>check_if_job_citizen_criminal_liability_fz53_exists</name>
    <name_sync_with_filename>Y</name_sync_with_filename>
    <description/>
    <extended_description/>
    <pipeline_version/>
    <pipeline_type>Normal</pipeline_type>
    <parameters>
    </parameters>
    <capture_transform_performance>N</capture_transform_performance>
    <transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
    <transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
    <created_user>-</created_user>
    <created_date>2025/06/11 15:20:18.267</created_date>
    <modified_user>-</modified_user>
    <modified_date>2025/06/11 15:20:18.267</modified_date>
  </info>
  <notepads>
  </notepads>
  <order>
    <hop>
      <from>Table input</from>
      <to>Set variables</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Set variables</from>
      <to>Write to log</to>
      <enabled>N</enabled>
    </hop>
  </order>
  <transform>
    <name>Set variables</name>
    <type>SetVariable</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <fields>
      <field>
        <field_name>job_name</field_name>
        <variable_name>PIPE</variable_name>
        <variable_type>PARENT_WORKFLOW</variable_type>
      </field>
      <field>
        <field_name>status</field_name>
        <variable_name>STATUS</variable_name>
        <variable_type>PARENT_WORKFLOW</variable_type>
      </field>
    </fields>
    <use_formatting>Y</use_formatting>
    <attributes/>
    <GUI>
      <xloc>688</xloc>
      <yloc>352</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Table input</name>
    <type>TableInput</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <connection>ervu-dashboard</connection>
    <execute_each_row>N</execute_each_row>
    <limit>0</limit>
    <sql>SELECT 
    COALESCE(job_name, 'job_citizen_criminal_liability_fz53') AS job_name,
    COALESCE(status, 'NEW') AS status,
    current_timestamp::timestamp as record_created
FROM (
    SELECT job_name, status 
    FROM public.etl_checkpoints
    WHERE job_name = 'job_citizen_criminal_liability_fz53'
    
    UNION ALL
    
    SELECT NULL, NULL
    WHERE NOT EXISTS (
        SELECT 1 
        FROM public.etl_checkpoints 
        WHERE job_name = 'job_citizen_criminal_liability_fz53'
    )
) t</sql>
    <variables_active>N</variables_active>
    <attributes/>
    <GUI>
      <xloc>400</xloc>
      <yloc>352</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Write to log</name>
    <type>WriteToLog</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <displayHeader>Y</displayHeader>
    <fields>
</fields>
    <limitRows>N</limitRows>
    <limitRowsNumber>0</limitRowsNumber>
    <loglevel>Basic</loglevel>
    <logmessage>${STATUS}</logmessage>
    <attributes/>
    <GUI>
      <xloc>960</xloc>
      <yloc>240</yloc>
    </GUI>
  </transform>
  <transform_error_handling>
  </transform_error_handling>
  <attributes/>
</pipeline>
