<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
  <info>
    <name>recruitment_five_flow_delta</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/08/11 13:16:11.204</created_date>
    <modified_user>-</modified_user>
    <modified_date>2025/08/11 13:16:11.204</modified_date>
  </info>
  <notepads>
  </notepads>
  <order>
    <hop>
      <from>Append streams</from>
      <to>Sort rows</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>failed_deferment_liberation_permission_idm_ids_on_delta</from>
      <to>Append streams</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>max_update_date_from_deferment_liberation</from>
      <to>failed_deferment_liberation_permission_idm_ids_on_delta</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>max_update_date_from_deferment_liberation</from>
      <to>updated_idm_ids_fromrecruits_deferment</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>updated_idm_ids_fromrecruits_deferment</from>
      <to>Append streams</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Sort rows</from>
      <to>citizen_criminal_liability_fz53_flow_delta.hpl</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Sort rows</from>
      <to>citizen_criminal_liability_fz53_flow_delta.hpl 2</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Sort rows</from>
      <to>citizen_criminal_liability_fz53_flow_delta.hpl 3</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Sort rows</from>
      <to>citizen_criminal_liability_fz53_flow_delta.hpl 4</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Sort rows</from>
      <to>citizen_criminal_liability_fz53_flow_delta.hpl 5</to>
      <enabled>Y</enabled>
    </hop>
  </order>
  <transform>
    <name>Append streams</name>
    <type>Append</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <head_name>failed_deferment_liberation_permission_idm_ids_on_delta</head_name>
    <tail_name>updated_idm_ids_fromrecruits_deferment</tail_name>
    <attributes/>
    <GUI>
      <xloc>768</xloc>
      <yloc>272</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Sort rows</name>
    <type>SortRows</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <directory>${java.io.tmpdir}</directory>
    <prefix>out</prefix>
    <sort_size>100000</sort_size>
    <free_memory/>
    <compress>N</compress>
    <compress_variable/>
    <unique_rows>Y</unique_rows>
    <fields>
      <field>
        <name>recruitment_id</name>
        <ascending>Y</ascending>
        <case_sensitive>N</case_sensitive>
        <collator_enabled>N</collator_enabled>
        <collator_strength>0</collator_strength>
        <presorted>N</presorted>
      </field>
    </fields>
    <attributes/>
    <GUI>
      <xloc>944</xloc>
      <yloc>272</yloc>
    </GUI>
  </transform>
  <transform>
    <name>citizen_criminal_liability_fz53_flow_delta.hpl</name>
    <type>PipelineExecutor</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <run_configuration>local</run_configuration>
    <filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl</filename>
    <filenameInField>N</filenameInField>
    <filenameField/>
    <group_size>1</group_size>
    <group_field/>
    <group_time/>
    <parameters>
      <variable_mapping>
        <variable>IDM_ID</variable>
        <field>idm_id</field>
        <input/>
      </variable_mapping>
      <variable_mapping>
        <variable>MAX_UPDATE_DATE</variable>
        <field>max_update_date</field>
        <input/>
      </variable_mapping>
      <inherit_all_vars>Y</inherit_all_vars>
    </parameters>
    <execution_result_target_transform/>
    <execution_time_field>ExecutionTime</execution_time_field>
    <execution_result_field>ExecutionResult</execution_result_field>
    <execution_errors_field>ExecutionNrErrors</execution_errors_field>
    <execution_lines_read_field>ExecutionLinesRead</execution_lines_read_field>
    <execution_lines_written_field>ExecutionLinesWritten</execution_lines_written_field>
    <execution_lines_input_field>ExecutionLinesInput</execution_lines_input_field>
    <execution_lines_output_field>ExecutionLinesOutput</execution_lines_output_field>
    <execution_lines_rejected_field>ExecutionLinesRejected</execution_lines_rejected_field>
    <execution_lines_updated_field>ExecutionLinesUpdated</execution_lines_updated_field>
    <execution_lines_deleted_field>ExecutionLinesDeleted</execution_lines_deleted_field>
    <execution_files_retrieved_field>ExecutionFilesRetrieved</execution_files_retrieved_field>
    <execution_exit_status_field>ExecutionExitStatus</execution_exit_status_field>
    <execution_log_text_field>ExecutionLogText</execution_log_text_field>
    <execution_log_channelid_field>ExecutionLogChannelId</execution_log_channelid_field>
    <result_rows_target_transform/>
    <result_files_target_transform/>
    <result_files_file_name_field>FileName</result_files_file_name_field>
    <executors_output_transform/>
    <attributes/>
    <GUI>
      <xloc>1264</xloc>
      <yloc>128</yloc>
    </GUI>
  </transform>
  <transform>
    <name>citizen_criminal_liability_fz53_flow_delta.hpl 2</name>
    <type>PipelineExecutor</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <run_configuration>local</run_configuration>
    <filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl</filename>
    <filenameInField>N</filenameInField>
    <filenameField/>
    <group_size>1</group_size>
    <group_field/>
    <group_time/>
    <parameters>
      <variable_mapping>
        <variable>IDM_ID</variable>
        <field>idm_id</field>
        <input/>
      </variable_mapping>
      <variable_mapping>
        <variable>MAX_UPDATE_DATE</variable>
        <field>max_update_date</field>
        <input/>
      </variable_mapping>
      <inherit_all_vars>Y</inherit_all_vars>
    </parameters>
    <execution_result_target_transform/>
    <execution_time_field>ExecutionTime</execution_time_field>
    <execution_result_field>ExecutionResult</execution_result_field>
    <execution_errors_field>ExecutionNrErrors</execution_errors_field>
    <execution_lines_read_field>ExecutionLinesRead</execution_lines_read_field>
    <execution_lines_written_field>ExecutionLinesWritten</execution_lines_written_field>
    <execution_lines_input_field>ExecutionLinesInput</execution_lines_input_field>
    <execution_lines_output_field>ExecutionLinesOutput</execution_lines_output_field>
    <execution_lines_rejected_field>ExecutionLinesRejected</execution_lines_rejected_field>
    <execution_lines_updated_field>ExecutionLinesUpdated</execution_lines_updated_field>
    <execution_lines_deleted_field>ExecutionLinesDeleted</execution_lines_deleted_field>
    <execution_files_retrieved_field>ExecutionFilesRetrieved</execution_files_retrieved_field>
    <execution_exit_status_field>ExecutionExitStatus</execution_exit_status_field>
    <execution_log_text_field>ExecutionLogText</execution_log_text_field>
    <execution_log_channelid_field>ExecutionLogChannelId</execution_log_channelid_field>
    <result_rows_target_transform/>
    <result_files_target_transform/>
    <result_files_file_name_field>FileName</result_files_file_name_field>
    <executors_output_transform/>
    <attributes/>
    <GUI>
      <xloc>1264</xloc>
      <yloc>208</yloc>
    </GUI>
  </transform>
  <transform>
    <name>citizen_criminal_liability_fz53_flow_delta.hpl 3</name>
    <type>PipelineExecutor</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <run_configuration>local</run_configuration>
    <filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl</filename>
    <filenameInField>N</filenameInField>
    <filenameField/>
    <group_size>1</group_size>
    <group_field/>
    <group_time/>
    <parameters>
      <variable_mapping>
        <variable>IDM_ID</variable>
        <field>idm_id</field>
        <input/>
      </variable_mapping>
      <variable_mapping>
        <variable>MAX_UPDATE_DATE</variable>
        <field>max_update_date</field>
        <input/>
      </variable_mapping>
      <inherit_all_vars>Y</inherit_all_vars>
    </parameters>
    <execution_result_target_transform/>
    <execution_time_field>ExecutionTime</execution_time_field>
    <execution_result_field>ExecutionResult</execution_result_field>
    <execution_errors_field>ExecutionNrErrors</execution_errors_field>
    <execution_lines_read_field>ExecutionLinesRead</execution_lines_read_field>
    <execution_lines_written_field>ExecutionLinesWritten</execution_lines_written_field>
    <execution_lines_input_field>ExecutionLinesInput</execution_lines_input_field>
    <execution_lines_output_field>ExecutionLinesOutput</execution_lines_output_field>
    <execution_lines_rejected_field>ExecutionLinesRejected</execution_lines_rejected_field>
    <execution_lines_updated_field>ExecutionLinesUpdated</execution_lines_updated_field>
    <execution_lines_deleted_field>ExecutionLinesDeleted</execution_lines_deleted_field>
    <execution_files_retrieved_field>ExecutionFilesRetrieved</execution_files_retrieved_field>
    <execution_exit_status_field>ExecutionExitStatus</execution_exit_status_field>
    <execution_log_text_field>ExecutionLogText</execution_log_text_field>
    <execution_log_channelid_field>ExecutionLogChannelId</execution_log_channelid_field>
    <result_rows_target_transform/>
    <result_files_target_transform/>
    <result_files_file_name_field>FileName</result_files_file_name_field>
    <executors_output_transform/>
    <attributes/>
    <GUI>
      <xloc>1264</xloc>
      <yloc>288</yloc>
    </GUI>
  </transform>
  <transform>
    <name>citizen_criminal_liability_fz53_flow_delta.hpl 4</name>
    <type>PipelineExecutor</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <run_configuration>local</run_configuration>
    <filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl</filename>
    <filenameInField>N</filenameInField>
    <filenameField/>
    <group_size>1</group_size>
    <group_field/>
    <group_time/>
    <parameters>
      <variable_mapping>
        <variable>IDM_ID</variable>
        <field>idm_id</field>
        <input/>
      </variable_mapping>
      <variable_mapping>
        <variable>MAX_UPDATE_DATE</variable>
        <field>max_update_date</field>
        <input/>
      </variable_mapping>
      <inherit_all_vars>Y</inherit_all_vars>
    </parameters>
    <execution_result_target_transform/>
    <execution_time_field>ExecutionTime</execution_time_field>
    <execution_result_field>ExecutionResult</execution_result_field>
    <execution_errors_field>ExecutionNrErrors</execution_errors_field>
    <execution_lines_read_field>ExecutionLinesRead</execution_lines_read_field>
    <execution_lines_written_field>ExecutionLinesWritten</execution_lines_written_field>
    <execution_lines_input_field>ExecutionLinesInput</execution_lines_input_field>
    <execution_lines_output_field>ExecutionLinesOutput</execution_lines_output_field>
    <execution_lines_rejected_field>ExecutionLinesRejected</execution_lines_rejected_field>
    <execution_lines_updated_field>ExecutionLinesUpdated</execution_lines_updated_field>
    <execution_lines_deleted_field>ExecutionLinesDeleted</execution_lines_deleted_field>
    <execution_files_retrieved_field>ExecutionFilesRetrieved</execution_files_retrieved_field>
    <execution_exit_status_field>ExecutionExitStatus</execution_exit_status_field>
    <execution_log_text_field>ExecutionLogText</execution_log_text_field>
    <execution_log_channelid_field>ExecutionLogChannelId</execution_log_channelid_field>
    <result_rows_target_transform/>
    <result_files_target_transform/>
    <result_files_file_name_field>FileName</result_files_file_name_field>
    <executors_output_transform/>
    <attributes/>
    <GUI>
      <xloc>1264</xloc>
      <yloc>368</yloc>
    </GUI>
  </transform>
  <transform>
    <name>citizen_criminal_liability_fz53_flow_delta.hpl 5</name>
    <type>PipelineExecutor</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <run_configuration>local</run_configuration>
    <filename>${PROJECT_HOME}/info_recruits/citizen_tables/citizen_criminal_liability_fz53/parallel/citizen_criminal_liability_fz53_flow_delta.hpl</filename>
    <filenameInField>N</filenameInField>
    <filenameField/>
    <group_size>1</group_size>
    <group_field/>
    <group_time/>
    <parameters>
      <variable_mapping>
        <variable>IDM_ID</variable>
        <field>idm_id</field>
        <input/>
      </variable_mapping>
      <variable_mapping>
        <variable>MAX_UPDATE_DATE</variable>
        <field>max_update_date</field>
        <input/>
      </variable_mapping>
      <inherit_all_vars>Y</inherit_all_vars>
    </parameters>
    <execution_result_target_transform/>
    <execution_time_field>ExecutionTime</execution_time_field>
    <execution_result_field>ExecutionResult</execution_result_field>
    <execution_errors_field>ExecutionNrErrors</execution_errors_field>
    <execution_lines_read_field>ExecutionLinesRead</execution_lines_read_field>
    <execution_lines_written_field>ExecutionLinesWritten</execution_lines_written_field>
    <execution_lines_input_field>ExecutionLinesInput</execution_lines_input_field>
    <execution_lines_output_field>ExecutionLinesOutput</execution_lines_output_field>
    <execution_lines_rejected_field>ExecutionLinesRejected</execution_lines_rejected_field>
    <execution_lines_updated_field>ExecutionLinesUpdated</execution_lines_updated_field>
    <execution_lines_deleted_field>ExecutionLinesDeleted</execution_lines_deleted_field>
    <execution_files_retrieved_field>ExecutionFilesRetrieved</execution_files_retrieved_field>
    <execution_exit_status_field>ExecutionExitStatus</execution_exit_status_field>
    <execution_log_text_field>ExecutionLogText</execution_log_text_field>
    <execution_log_channelid_field>ExecutionLogChannelId</execution_log_channelid_field>
    <result_rows_target_transform/>
    <result_files_target_transform/>
    <result_files_file_name_field>FileName</result_files_file_name_field>
    <executors_output_transform/>
    <attributes/>
    <GUI>
      <xloc>1264</xloc>
      <yloc>448</yloc>
    </GUI>
  </transform>
  <transform>
    <name>failed_deferment_liberation_permission_idm_ids_on_delta</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>
    <lookup>max_update_date_from_deferment_liberation</lookup>
    <sql>select r.idm_id as recruitment_id,
	? as max_update_date
from ervu_dashboard.recruitment r
         join etl.job_execution je
              on r.idm_id = je.recruitment_id
where je.status in ('DELTA_ERROR', 'DELTA_PROCESSING')
  and je.job_name = '${JOB_NAME}';</sql>
    <variables_active>Y</variables_active>
    <attributes/>
    <GUI>
      <xloc>560</xloc>
      <yloc>368</yloc>
    </GUI>
  </transform>
  <transform>
    <name>max_update_date_from_deferment_liberation</name>
    <type>TableInput</type>
    <description/>
    <distribute>N</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 max(updated_at) as max_update_date
    from citizen_criminal_liability_fz53;</sql>
    <variables_active>N</variables_active>
    <attributes/>
    <GUI>
      <xloc>368</xloc>
      <yloc>272</yloc>
    </GUI>
  </transform>
  <transform>
    <name>updated_idm_ids_fromrecruits_deferment</name>
    <type>TableInput</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <connection>ervu_person_registry</connection>
    <execute_each_row>N</execute_each_row>
    <limit>0</limit>
    <lookup>max_update_date_from_deferment_liberation</lookup>
    <sql>WITH max_update_date(val) AS (SELECT CAST(? AS timestamp))
SELECT DISTINCT COALESCE(r.current_recruitment, r.target_recruitment) AS recruitment_id,
                mud.val as max_update_date
FROM recruit r
         JOIN infringement i ON i.recruit_id = r.id
         JOIN max_update_date mud ON TRUE
WHERE (mud.val IS NULL OR i.updated_at > mud.val);</sql>
    <variables_active>N</variables_active>
    <attributes/>
    <GUI>
      <xloc>560</xloc>
      <yloc>176</yloc>
    </GUI>
  </transform>
  <transform_error_handling>
  </transform_error_handling>
  <attributes/>
</pipeline>
