<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
  <info>
    <name>foreign_diploma_constants_flow_repeat</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/09/21 21:27:15.216</created_date>
    <modified_user>-</modified_user>
    <modified_date>2025/09/21 21:27:15.216</modified_date>
  </info>
  <notepads>
  </notepads>
  <order>
    <hop>
      <from>get_max_country_oksm_update_date</from>
      <to>country_oksm_input</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>country_oksm_input</from>
      <to>country_oksm</to>
      <enabled>Y</enabled>
    </hop>
  </order>
  <transform>
    <name>country_oksm</name>
    <type>InsertUpdate</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <commit>10000</commit>
    <connection>ervu-dashboard</connection>
    <lookup>
      <key>
        <condition>=</condition>
        <field>code</field>
        <name>code</name>
      </key>
      <schema>ervu_dashboard</schema>
      <table>country_oksm</table>
      <value>
        <name>code</name>
        <rename>code</rename>
        <update>N</update>
      </value>
      <value>
        <name>value</name>
        <rename>value</rename>
        <update>Y</update>
      </value>
      <value>
        <name>actual</name>
        <rename>actual</rename>
        <update>Y</update>
      </value>
      <value>
        <name>update_date</name>
        <rename>update_date</rename>
        <update>Y</update>
      </value>
    </lookup>
    <update_bypassed>N</update_bypassed>
    <attributes/>
    <GUI>
      <xloc>688</xloc>
      <yloc>240</yloc>
    </GUI>
  </transform>
  <transform>
    <name>country_oksm_input</name>
    <type>TableInput</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <connection>ervu_nsi</connection>
    <execute_each_row>N</execute_each_row>
    <limit>0</limit>
    <lookup>get_max_country_oksm_update_date</lookup>
    <sql>SELECT
    key as code,
    value ->> 'value' as value,
    NOT hidden as actual,
    updated_at as update_date
FROM classifier_records
WHERE code = 'countriesOKSM'
AND updated_at > ?;</sql>
    <variables_active>N</variables_active>
    <attributes/>
    <GUI>
      <xloc>464</xloc>
      <yloc>240</yloc>
    </GUI>
  </transform>
  <transform>
    <name>get_max_country_oksm_update_date</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
       max(update_date) as max_update_date
FROM ervu_dashboard.country_oksm;
</sql>
    <variables_active>N</variables_active>
    <attributes/>
    <GUI>
      <xloc>240</xloc>
      <yloc>240</yloc>
    </GUI>
  </transform>
  <transform_error_handling>
  </transform_error_handling>
  <attributes/>
</pipeline>
