<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
  <info>
    <name>employer_flow_delta</name>
    <name_sync_with_filename>Y</name_sync_with_filename>
    <description/>
    <extended_description/>
    <pipeline_version/>
    <pipeline_type>Normal</pipeline_type>
    <pipeline_status>0</pipeline_status>
    <parameters>
      <parameter>
        <name>IDM_ID</name>
        <default_value>d229c06e-06d8-4409-82a2-101e088f1649</default_value>
        <description/>
      </parameter>
      <parameter>
        <name>MAX_SOURCE_UPDATE_DATE</name>
        <default_value>2020-09-10</default_value>
        <description/>
      </parameter>
    </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/18 19:01:58.918</created_date>
    <modified_user>-</modified_user>
    <modified_date>2025/08/18 19:01:58.918</modified_date>
  </info>
  <notepads>
  </notepads>
  <order>
    <hop>
      <from>delete_akt_become_null</from>
      <to>update_akt_flag_on_delete</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>upsert_akt</from>
      <to>update_akt_flag</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Create job execution record</from>
      <to>employer_input</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>employer_input</from>
      <to>filter_akt_rows_for_delete</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>employer_input</from>
      <to>filter_akt_rows_for_update</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>employer_input</from>
      <to>filter_pred_rows_for_update</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>filter_akt_rows_for_delete</from>
      <to>Detect empty stream</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Detect empty stream</from>
      <to>delete_akt_become_null</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>filter_akt_rows_for_update</from>
      <to>Detect empty stream 2</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Detect empty stream 2</from>
      <to>upsert_akt</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>filter_pred_rows_for_update</from>
      <to>Detect empty stream 3</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Detect empty stream 3</from>
      <to>upsert_pred</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>update_akt_flag_on_delete</from>
      <to>Filter rows</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>update_akt_flag</from>
      <to>Filter rows</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>upsert_pred</from>
      <to>Filter rows</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Change job status on error</from>
      <to>Abort</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>delete_akt_become_null</from>
      <to>Change job status on error</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>update_akt_flag_on_delete</from>
      <to>Change job status on error</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>upsert_akt</from>
      <to>Change job status on error</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>update_akt_flag</from>
      <to>Change job status on error</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>upsert_pred</from>
      <to>Change job status on error</to>
      <enabled>Y</enabled>
    </hop>
    <hop>
      <from>Filter rows</from>
      <to>Change job status on success</to>
      <enabled>Y</enabled>
    </hop>
  </order>
  <transform>
    <name>Abort</name>
    <type>Abort</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <abort_option>ABORT</abort_option>
    <always_log_rows>Y</always_log_rows>
    <row_threshold>0</row_threshold>
    <attributes/>
    <GUI>
      <xloc>944</xloc>
      <yloc>1264</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Change job status on error</name>
    <type>ExecSql</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <arguments>
      <argument>
        <name>error_description</name>
      </argument>
    </arguments>
    <connection>ervu-dashboard</connection>
    <execute_each_row>Y</execute_each_row>
    <quoteString>N</quoteString>
    <replace_variables>Y</replace_variables>
    <set_params>Y</set_params>
    <single_statement>N</single_statement>
    <sql>UPDATE etl.job_execution
SET status = 'ERROR',
    error_description = ?,
    execution_end_datetime = current_timestamp
WHERE job_name = '${JOB_NAME}' 
and recruitment_id = '${IDM_ID}';

</sql>
    <attributes/>
    <GUI>
      <xloc>768</xloc>
      <yloc>1264</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Change job status on success</name>
    <type>ExecSql</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <arguments>
</arguments>
    <connection>ervu-dashboard</connection>
    <execute_each_row>N</execute_each_row>
    <quoteString>N</quoteString>
    <replace_variables>Y</replace_variables>
    <set_params>N</set_params>
    <single_statement>N</single_statement>
    <sql>UPDATE etl.job_execution
SET status = 'DELTA_SUCCESS',
    execution_end_datetime = current_timestamp
WHERE job_name = '${JOB_NAME}'
and recruitment_id = '${IDM_ID}';

</sql>
    <attributes/>
    <GUI>
      <xloc>1648</xloc>
      <yloc>912</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Create job execution record</name>
    <type>ExecSql</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <arguments>
</arguments>
    <connection>ervu-dashboard</connection>
    <execute_each_row>N</execute_each_row>
    <quoteString>N</quoteString>
    <replace_variables>Y</replace_variables>
    <set_params>N</set_params>
    <single_statement>N</single_statement>
    <sql>UPDATE etl.job_execution  
SET
    status = 'DELTA_PROCESSING',
    execution_datetime = current_timestamp,
    error_description = NULL
where job_name = '${JOB_NAME}'
and recruitment_id = '${IDM_ID}';</sql>
    <attributes/>
    <GUI>
      <xloc>128</xloc>
      <yloc>944</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Detect empty stream</name>
    <type>DetectEmptyStream</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <attributes/>
    <GUI>
      <xloc>768</xloc>
      <yloc>832</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Detect empty stream 2</name>
    <type>DetectEmptyStream</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <attributes/>
    <GUI>
      <xloc>768</xloc>
      <yloc>944</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Detect empty stream 3</name>
    <type>DetectEmptyStream</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <attributes/>
    <GUI>
      <xloc>768</xloc>
      <yloc>1056</yloc>
    </GUI>
  </transform>
  <transform>
    <name>Filter rows</name>
    <type>FilterRows</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <compare>
      <condition>
        <conditions>
</conditions>
        <function>=</function>
        <leftvalue>last_row</leftvalue>
        <negated>N</negated>
        <operator>-</operator>
        <value>
          <isnull>N</isnull>
          <length>-1</length>
          <name>constant</name>
          <precision>-1</precision>
          <text>Y</text>
          <type>Boolean</type>
        </value>
      </condition>
    </compare>
    <send_true_to>Change job status on success</send_true_to>
    <attributes/>
    <GUI>
      <xloc>1440</xloc>
      <yloc>912</yloc>
    </GUI>
  </transform>
  <transform>
    <name>delete_akt_become_null</name>
    <type>Delete</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>source_id</field>
        <name>source_id</name>
      </key>
      <key>
        <condition>=</condition>
        <field>actual_employer</field>
        <name>delete_akt</name>
      </key>
      <schema>ervu_dashboard</schema>
      <table>employer</table>
    </lookup>
    <attributes/>
    <GUI>
      <xloc>944</xloc>
      <yloc>832</yloc>
    </GUI>
  </transform>
  <transform>
    <name>employer_input</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>
    <sql>WITH fd AS (SELECT ri.recruit_id,
                   (ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' ->> 'id')         AS source_id,
                   ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat'  AS akt_rabotodat,
                   ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' AS pred_rabotodat
            FROM ervu_dashboard.recruits_info ri
            WHERE ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' IS NOT NULL
              AND (
                to_date(ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'aktRabotodat' ->> 'dataSved',
                        'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}'
                    OR to_date(ri.info -> 'svedFL' -> 'svedRabotodat' -> 'rabotodat' -> 'predRabotodat' ->> 'dataSved',
                               'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}'
                )
              AND (ri.current_recruitment_id = '${IDM_ID}' or (ri.current_recruitment_id is null and ri.target_recruitment_id = '${IDM_ID}'))
)
SELECT fd.recruit_id,
	pred_rabotodat ->> 'id'                                                               as pred_source_id,
       to_date(pred_rabotodat ->> 'dataSved', 'YYYY-MM-DD')                                  as pred_source_update_date,
       COALESCE(pred_rabotodat -> 'extend' ->> 'statusRabotodat' = '1', false)               as pred_status,
       pred_rabotodat -> 'extend' ->> 'adresRabotodat'                                       as pred_address,
       pred_rabotodat -> 'extend' ->> 'tipPodrazdRabotodat'                                  as pred_separate_unit_type,
       pred_rabotodat -> 'extend' ->> 'adresPodrazdRabotodat'                                as pred_separate_unit_address,
       case
           when pred_rabotodat ->> 'svedIP' is not null and pred_rabotodat ->> 'svedIP' != 'null'
               then 'Индивидуальный предприниматель'
           when pred_rabotodat ->> 'svedYUL' is not null and pred_rabotodat ->> 'svedYUL' != 'null'
               then 'Юридическое лицо'
           when pred_rabotodat ->> 'svedGlKFH' is not null and pred_rabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ'
           when pred_rabotodat ->> 'svedPlatFL' is not null and pred_rabotodat ->> 'svedPlatFL' != 'null'
               then 'Физическое лицо'
           end                                                                               as pred_employer_category_name,
       pred_rabotodat -> 'svedYUL' -> 'naimOrg'                                              as pred_name,
       case
           when pred_rabotodat ->> 'svedIP' is not null and pred_rabotodat ->> 'svedIP' != 'null'
               then pred_rabotodat -> 'svedIP' ->> 'innfl'
           when pred_rabotodat ->> 'svedYUL' is not null and pred_rabotodat ->> 'svedYUL' != 'null'
               then pred_rabotodat -> 'svedYUL' ->> 'innyul'
           when pred_rabotodat ->> 'svedGlKFH' is not null and pred_rabotodat ->> 'svedGlKFH' != 'null'
               then pred_rabotodat -> 'svedGlKFH' ->> 'innfl'
           when pred_rabotodat ->> 'svedPlatFL' is not null and pred_rabotodat ->> 'svedPlatFL' != 'null'
               then pred_rabotodat -> 'svedPlatFL' ->> 'innfl'
           end                                                                               as pred_inn,
       case
           when pred_rabotodat ->> 'svedIP' is not null and pred_rabotodat ->> 'svedIP' != 'null'
               then pred_rabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn'
           when pred_rabotodat ->> 'svedYUL' is not null and pred_rabotodat ->> 'svedYUL' != 'null'
               then pred_rabotodat -> 'svedIP' ->> 'ogrnip'
           end                                                                               as pred_ogrn,
       case
           when pred_rabotodat ->> 'svedYUL' is not null and pred_rabotodat ->> 'svedYUL' != 'null'
               then pred_rabotodat -> 'extend' -> 'svedYUL' ->> 'kpp'
           end                                                                               as pred_kpp,
       coalesce(pred_rabotodat -> 'svedYUL' -> 'extend' ->> 'priznakOpk' = '1', false)       as pred_is_opk_org,
       to_date(fd.pred_rabotodat ->> 'dataSved', 'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}' AS pred_need_update,


       akt_rabotodat ->> 'id'                                                                as akt_source_id,
       to_date(akt_rabotodat ->> 'dataSved', 'YYYY-MM-DD')                                   as akt_source_update_date,
       COALESCE(akt_rabotodat -> 'extend' ->> 'statusRabotodat' = '1', false)                as akt_status,
       akt_rabotodat -> 'extend' ->> 'adresRabotodat'                                        as akt_address,
       akt_rabotodat -> 'extend' ->> 'tipPodrazdRabotodat'                                   as akt_separate_unit_type,
       akt_rabotodat -> 'extend' ->> 'adresPodrazdRabotodat'                                 as akt_separate_unit_address,
       case
           when akt_rabotodat ->> 'svedIP' is not null and akt_rabotodat ->> 'svedIP' != 'null'
               then 'Индивидуальный предприниматель'
           when akt_rabotodat ->> 'svedYUL' is not null and akt_rabotodat ->> 'svedYUL' != 'null'
               then 'Юридическое лицо'
           when akt_rabotodat ->> 'svedGlKFH' is not null and akt_rabotodat ->> 'svedGlKFH' != 'null' then 'Глава КФХ'
           when akt_rabotodat ->> 'svedPlatFL' is not null and akt_rabotodat ->> 'svedPlatFL' != 'null'
               then 'Физическое лицо'
           end                                                                               as akt_employer_category_name,
       akt_rabotodat -> 'svedYUL' -> 'naimOrg'                                               as akt_name,
       case
           when akt_rabotodat ->> 'svedIP' is not null and akt_rabotodat ->> 'svedIP' != 'null'
               then akt_rabotodat -> 'svedIP' ->> 'innfl'
           when akt_rabotodat ->> 'svedYUL' is not null and akt_rabotodat ->> 'svedYUL' != 'null'
               then akt_rabotodat -> 'svedYUL' ->> 'innyul'
           when akt_rabotodat ->> 'svedGlKFH' is not null and akt_rabotodat ->> 'svedGlKFH' != 'null'
               then akt_rabotodat -> 'svedGlKFH' ->> 'innfl'
           when akt_rabotodat ->> 'svedPlatFL' is not null and akt_rabotodat ->> 'svedPlatFL' != 'null'
               then akt_rabotodat -> 'svedPlatFL' ->> 'innfl'
           end                                                                               as akt_inn,
       case
           when akt_rabotodat ->> 'svedIP' is not null and akt_rabotodat ->> 'svedIP' != 'null'
               then akt_rabotodat -> 'extend' -> 'svedYUL' ->> 'ogrn'
           when akt_rabotodat ->> 'svedYUL' is not null and akt_rabotodat ->> 'svedYUL' != 'null'
               then akt_rabotodat -> 'svedIP' ->> 'ogrnip'
           end                                                                               as akt_ogrn,
       case
           when akt_rabotodat ->> 'svedYUL' is not null and akt_rabotodat ->> 'svedYUL' != 'null'
               then akt_rabotodat -> 'extend' -> 'svedYUL' ->> 'kpp'
           end                                                                               as akt_kpp,
       coalesce(akt_rabotodat -> 'svedYUL' -> 'extend' ->> 'priznakOpk', '0') = '1'          as akt_is_opk_org,
       jsonb_typeof(akt_rabotodat) IS NULL                                                   as delete_akt,
       to_date(fd.akt_rabotodat ->> 'dataSved', 'YYYY-MM-DD') > '${MAX_SOURCE_UPDATE_DATE}'  as akt_need_update
FROM fd;</sql>
    <variables_active>Y</variables_active>
    <attributes/>
    <GUI>
      <xloc>336</xloc>
      <yloc>944</yloc>
    </GUI>
  </transform>
  <transform>
    <name>filter_akt_rows_for_delete</name>
    <type>FilterRows</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <compare>
      <condition>
        <conditions>
</conditions>
        <function>=</function>
        <leftvalue>delete_akt</leftvalue>
        <negated>N</negated>
        <operator>-</operator>
        <value>
          <isnull>N</isnull>
          <length>-1</length>
          <name>constant</name>
          <precision>-1</precision>
          <text>Y</text>
          <type>Boolean</type>
        </value>
      </condition>
    </compare>
    <send_true_to>Detect empty stream</send_true_to>
    <attributes/>
    <GUI>
      <xloc>592</xloc>
      <yloc>832</yloc>
    </GUI>
  </transform>
  <transform>
    <name>filter_akt_rows_for_update</name>
    <type>FilterRows</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <compare>
      <condition>
        <conditions>
</conditions>
        <function>=</function>
        <leftvalue>akt_need_update</leftvalue>
        <negated>N</negated>
        <operator>-</operator>
        <value>
          <isnull>N</isnull>
          <length>-1</length>
          <name>constant</name>
          <precision>-1</precision>
          <text>Y</text>
          <type>Boolean</type>
        </value>
      </condition>
    </compare>
    <send_true_to>Detect empty stream 2</send_true_to>
    <attributes/>
    <GUI>
      <xloc>592</xloc>
      <yloc>944</yloc>
    </GUI>
  </transform>
  <transform>
    <name>filter_pred_rows_for_update</name>
    <type>FilterRows</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <compare>
      <condition>
        <conditions>
</conditions>
        <function>=</function>
        <leftvalue>pred_need_update</leftvalue>
        <negated>N</negated>
        <operator>-</operator>
        <value>
          <isnull>N</isnull>
          <length>-1</length>
          <name>constant</name>
          <precision>-1</precision>
          <text>Y</text>
          <type>Boolean</type>
        </value>
      </condition>
    </compare>
    <send_true_to>Detect empty stream 3</send_true_to>
    <attributes/>
    <GUI>
      <xloc>592</xloc>
      <yloc>1056</yloc>
    </GUI>
  </transform>
  <transform>
    <name>update_akt_flag</name>
    <type>Update</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <commit>10000</commit>
    <connection>ervu-dashboard</connection>
    <error_ignored>N</error_ignored>
    <lookup>
      <key>
        <condition>&lt;></condition>
        <field>employed</field>
        <name>akt_need_update</name>
      </key>
      <key>
        <condition>=</condition>
        <field>recruit_id</field>
        <name>recruit_id</name>
      </key>
      <schema>ervu_dashboard</schema>
      <table>citizen</table>
      <value>
        <name>employed</name>
        <rename>akt_need_update</rename>
      </value>
    </lookup>
    <skip_lookup>N</skip_lookup>
    <use_batch>Y</use_batch>
    <attributes/>
    <GUI>
      <xloc>1136</xloc>
      <yloc>944</yloc>
    </GUI>
  </transform>
  <transform>
    <name>update_akt_flag_on_delete</name>
    <type>Update</type>
    <description/>
    <distribute>Y</distribute>
    <custom_distribution/>
    <copies>1</copies>
    <partitioning>
      <method>none</method>
      <schema_name/>
    </partitioning>
    <commit>10000</commit>
    <connection>ervu-dashboard</connection>
    <error_ignored>N</error_ignored>
    <lookup>
      <key>
        <condition>=</condition>
        <field>employed</field>
        <name>delete_akt</name>
      </key>
      <key>
        <condition>=</condition>
        <field>recruit_id</field>
        <name>recruit_id</name>
      </key>
      <schema>ervu_dashboard</schema>
      <table>citizen</table>
      <value>
        <name>employed</name>
        <rename>akt_need_update</rename>
      </value>
    </lookup>
    <skip_lookup>N</skip_lookup>
    <use_batch>Y</use_batch>
    <attributes/>
    <GUI>
      <xloc>1136</xloc>
      <yloc>832</yloc>
    </GUI>
  </transform>
  <transform>
    <name>upsert_akt</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>source_id</field>
        <name>source_id</name>
      </key>
      <schema>ervu_dashboard</schema>
      <table>employer</table>
      <value>
        <name>recruit_id</name>
        <rename>recruit_id</rename>
        <update>N</update>
      </value>
      <value>
        <name>source_id</name>
        <rename>akt_source_id</rename>
        <update>N</update>
      </value>
      <value>
        <name>source_update_date</name>
        <rename>akt_source_update_date</rename>
        <update>Y</update>
      </value>
      <value>
        <name>status</name>
        <rename>akt_status</rename>
        <update>Y</update>
      </value>
      <value>
        <name>address</name>
        <rename>akt_address</rename>
        <update>Y</update>
      </value>
      <value>
        <name>separate_unit_type</name>
        <rename>akt_separate_unit_type</rename>
        <update>Y</update>
      </value>
      <value>
        <name>separate_unit_address</name>
        <rename>akt_separate_unit_address</rename>
        <update>Y</update>
      </value>
      <value>
        <name>employer_category_name</name>
        <rename>akt_employer_category_name</rename>
        <update>Y</update>
      </value>
      <value>
        <name>name</name>
        <rename>akt_name</rename>
        <update>Y</update>
      </value>
      <value>
        <name>inn</name>
        <rename>akt_inn</rename>
        <update>Y</update>
      </value>
      <value>
        <name>ogrn</name>
        <rename>akt_ogrn</rename>
        <update>Y</update>
      </value>
      <value>
        <name>kpp</name>
        <rename>akt_kpp</rename>
        <update>Y</update>
      </value>
      <value>
        <name>is_opk_org</name>
        <rename>akt_is_opk_org</rename>
        <update>Y</update>
      </value>
      <value>
        <name>actual_employer</name>
        <rename>akt_need_update</rename>
        <update>Y</update>
      </value>
    </lookup>
    <update_bypassed>N</update_bypassed>
    <attributes/>
    <GUI>
      <xloc>944</xloc>
      <yloc>944</yloc>
    </GUI>
  </transform>
  <transform>
    <name>upsert_pred</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>source_id</field>
        <name>source_id</name>
      </key>
      <schema>ervu_dashboard</schema>
      <table>employer</table>
      <value>
        <name>recruit_id</name>
        <rename>recruit_id</rename>
        <update>N</update>
      </value>
      <value>
        <name>source_id</name>
        <rename>pred_source_id</rename>
        <update>N</update>
      </value>
      <value>
        <name>source_update_date</name>
        <rename>pred_source_update_date</rename>
        <update>Y</update>
      </value>
      <value>
        <name>separate_unit_type_code</name>
        <rename>pred_separate_unit_type</rename>
        <update>Y</update>
      </value>
      <value>
        <name>separate_unit_address</name>
        <rename>pred_separate_unit_address</rename>
        <update>Y</update>
      </value>
      <value>
        <name>address</name>
        <rename>pred_address</rename>
        <update>Y</update>
      </value>
      <value>
        <name>employer_category_name</name>
        <rename>pred_employer_category_name</rename>
        <update>Y</update>
      </value>
      <value>
        <name>name</name>
        <rename>pred_name</rename>
        <update>Y</update>
      </value>
      <value>
        <name>inn</name>
        <rename>pred_inn</rename>
        <update>Y</update>
      </value>
      <value>
        <name>ogrn</name>
        <rename>pred_ogrn</rename>
        <update>Y</update>
      </value>
      <value>
        <name>kpp</name>
        <rename>pred_kpp</rename>
        <update>Y</update>
      </value>
      <value>
        <name>is_opk_org</name>
        <rename>pred_is_opk_org</rename>
        <update>Y</update>
      </value>
      <value>
        <name>status</name>
        <rename>pred_status</rename>
        <update>Y</update>
      </value>
    </lookup>
    <update_bypassed>N</update_bypassed>
    <attributes/>
    <GUI>
      <xloc>1136</xloc>
      <yloc>1056</yloc>
    </GUI>
  </transform>
  <transform_error_handling>
    <error>
      <source_transform>delete_akt_become_null</source_transform>
      <target_transform>Change job status on error</target_transform>
      <is_enabled>Y</is_enabled>
      <nr_valuename/>
      <descriptions_valuename>error_description</descriptions_valuename>
      <fields_valuename/>
      <codes_valuename/>
      <max_errors/>
      <max_pct_errors/>
      <min_pct_rows/>
    </error>
    <error>
      <source_transform>update_akt_flag</source_transform>
      <target_transform>Change job status on error</target_transform>
      <is_enabled>Y</is_enabled>
      <nr_valuename/>
      <descriptions_valuename>error_description</descriptions_valuename>
      <fields_valuename/>
      <codes_valuename/>
      <max_errors/>
      <max_pct_errors/>
      <min_pct_rows/>
    </error>
    <error>
      <source_transform>update_akt_flag_on_delete</source_transform>
      <target_transform>Change job status on error</target_transform>
      <is_enabled>Y</is_enabled>
      <nr_valuename/>
      <descriptions_valuename>error_description</descriptions_valuename>
      <fields_valuename/>
      <codes_valuename/>
      <max_errors/>
      <max_pct_errors/>
      <min_pct_rows/>
    </error>
    <error>
      <source_transform>upsert_akt</source_transform>
      <target_transform>Change job status on error</target_transform>
      <is_enabled>Y</is_enabled>
      <nr_valuename/>
      <descriptions_valuename>error_description</descriptions_valuename>
      <fields_valuename/>
      <codes_valuename/>
      <max_errors/>
      <max_pct_errors/>
      <min_pct_rows/>
    </error>
    <error>
      <source_transform>upsert_pred</source_transform>
      <target_transform>Change job status on error</target_transform>
      <is_enabled>Y</is_enabled>
      <nr_valuename/>
      <descriptions_valuename>error_description</descriptions_valuename>
      <fields_valuename/>
      <codes_valuename/>
      <max_errors/>
      <max_pct_errors/>
      <min_pct_rows/>
    </error>
  </transform_error_handling>
  <attributes/>
</pipeline>
