Merge branch 'ERVU-528' into develop

This commit is contained in:
adel.kalimullin 2025-09-04 12:42:18 +03:00
commit e99c248f2c
34 changed files with 3289 additions and 7752 deletions

View file

@ -1,124 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>branching_prosecution</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/09 09:54:43.724</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/09 09:54:43.724</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Set variables 2</from>
<to>Write to log 2</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Set variables 2</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Set variables 2</name>
<type>SetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<field_name>pipeline</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>1056</xloc>
<yloc>256</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
status as STATUS,
job_name AS PIPELINE
from public.etl_checkpoints
where job_name = 'job_prosecution'</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>816</xloc>
<yloc>256</yloc>
</GUI>
</transform>
<transform>
<name>Write to log 2</name>
<type>WriteToLog</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<displayHeader>Y</displayHeader>
<fields>
<field>
<name>pipeline</name>
</field>
<field>
<name>status</name>
</field>
</fields>
<limitRows>N</limitRows>
<limitRowsNumber>0</limitRowsNumber>
<loglevel>Basic</loglevel>
<logmessage>${PIPE}
${STATUS}</logmessage>
<attributes/>
<GUI>
<xloc>1280</xloc>
<yloc>256</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_to_processing_delta</name>
<name>check_if_need_to_repeat_job</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
@ -13,22 +13,22 @@
<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/16 13:42:26.494</created_date>
<created_date>2025/08/08 12:27:51.630</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 13:42:26.494</modified_date>
<modified_date>2025/08/08 12:27:51.630</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<to>Set variables</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<name>Set variables</name>
<type>SetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
@ -37,37 +37,18 @@
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<fields>
<field>
<field_name>need_to_repeat_job</field_name>
<variable_name>NEED_TO_REPEAT_JOB</variable_name>
<variable_type>ROOT_WORKFLOW</variable_type>
</field>
</fields>
<use_formatting>Y</use_formatting>
<attributes/>
<GUI>
<xloc>1248</xloc>
<yloc>352</yloc>
<xloc>624</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
@ -84,16 +65,19 @@
<connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>SELECT
'PROCESSING' AS status,
'delta_prosecution' AS job_name,
current_timestamp AS record_created
--FROM public.etl_checkpoints</sql>
<sql>SELECT EXISTS (SELECT 1
FROM ervu_dashboard.recruitment r
LEFT JOIN etl.job_execution je
ON r.idm_id = je.recruitment_id
and job_name = 'prosecution_job'
where je.status is null or je.status in ('ERROR', 'PROCESSING')
limit 1
) as need_to_repeat_job;</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>832</xloc>
<yloc>352</yloc>
<xloc>336</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform_error_handling>

View file

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_delta_prosecution_error</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/16 12:20:06.191</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 12:20:06.191</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1152</xloc>
<yloc>304</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
'delta_prosecution' as job_name,
'ERROR' as status,
current_timestamp as record_created
union all
SELECT
'job_prosecution' as job_name,
'ERROR' as status,
current_timestamp as record_created
</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>784</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,110 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_delta_prosecution_success</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/16 12:20:06.191</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 12:20:06.191</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1152</xloc>
<yloc>304</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
'delta_prosecution' as job_name,
'SUCCESS' as status,
current_timestamp as record_created
union all
SELECT
'job_prosecution' as job_name,
'SUCCESS' as status,
current_timestamp as record_created
</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>784</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,250 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_prosecution_flow1_error</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/16 09:14:18.787</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 09:14:18.787</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>last_recruitment_id</name>
<rename>last_recruitment_id</rename>
<update>Y</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_created_date</name>
<rename>recruitment_created_date</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1056</xloc>
<yloc>400</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>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.prosecution ch on ch.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1--,
/*
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4,
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
*/
FROM flow_data
),
result_max as ( --костыль
SELECT
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1--,
/*
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
*/
FROM result_ma
),
for_checkpoints as (
SELECT
'prosecution_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
/*
union all
SELECT
'job_citizen_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
*/
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,250 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_prosecution_flow1_success</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/16 09:14:18.787</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 09:14:18.787</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>last_recruitment_id</name>
<rename>last_recruitment_id</rename>
<update>Y</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_created_date</name>
<rename>recruitment_created_date</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1056</xloc>
<yloc>400</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>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.prosecution ch on ch.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1--,
/*
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4,
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
*/
FROM flow_data
),
result_max as ( --костыль
SELECT
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1--,
/*
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
*/
FROM result_ma
),
for_checkpoints as (
SELECT
'prosecution_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
/*
union all
SELECT
'job_citizen_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'citizen_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
*/
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,254 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_prosecution_flow2_error</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/16 09:14:18.787</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 09:14:18.787</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>last_recruitment_id</name>
<rename>last_recruitment_id</rename>
<update>Y</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_created_date</name>
<rename>recruitment_created_date</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1056</xloc>
<yloc>400</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>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.prosecution ch on ch.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
--MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
--(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2--,
/*
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4,
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
*/
FROM flow_data
),
result_max as ( --костыль
SELECT
/*
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1,
*/
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2--,
/*
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
*/
FROM result_ma
),
for_checkpoints as (
/*
SELECT
'job_citizen_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
*/
SELECT
'prosecution_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
/*
union all
SELECT
'job_citizen_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
*/
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,254 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_prosecution_flow2_success</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/16 09:14:18.787</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 09:14:18.787</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>last_recruitment_id</name>
<rename>last_recruitment_id</rename>
<update>Y</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_created_date</name>
<rename>recruitment_created_date</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1056</xloc>
<yloc>400</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>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.prosecution ch on ch.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
--MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
--(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2--,
/*
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4,
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
*/
FROM flow_data
),
result_max as ( --костыль
SELECT
/*
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1,
*/
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2--,
/*
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
*/
FROM result_ma
),
for_checkpoints as (
/*
SELECT
'job_citizen_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
*/
SELECT
'prosecution_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
/*
union all
SELECT
'job_citizen_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
*/
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,255 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_prosecution_flow3_error</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/16 09:14:18.787</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 09:14:18.787</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>last_recruitment_id</name>
<rename>last_recruitment_id</rename>
<update>Y</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_created_date</name>
<rename>recruitment_created_date</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1056</xloc>
<yloc>400</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>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.prosecution ch on ch.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
/*
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
*/
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3--,
/*
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4,
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
*/
FROM flow_data
),
result_max as ( --костыль
SELECT
/*
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1--,
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
*/
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3--,
/*
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
*/
FROM result_ma
),
for_checkpoints as (
/*
SELECT
'job_citizen_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
*/
SELECT
'prosecution_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
/*
union all
SELECT
'job_citizen_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
*/
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,255 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_prosecution_flow3_success</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/16 09:14:18.787</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 09:14:18.787</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>last_recruitment_id</name>
<rename>last_recruitment_id</rename>
<update>Y</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_created_date</name>
<rename>recruitment_created_date</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1056</xloc>
<yloc>400</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>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.prosecution ch on ch.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
/*
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
*/
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3--,
/*
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4,
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
*/
FROM flow_data
),
result_max as ( --костыль
SELECT
/*
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1--,
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
*/
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3--,
/*
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
*/
FROM result_ma
),
for_checkpoints as (
/*
SELECT
'job_citizen_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
*/
SELECT
'prosecution_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
/*
union all
SELECT
'job_citizen_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
*/
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,256 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_prosecution_flow4_error</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/16 09:14:18.787</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 09:14:18.787</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>last_recruitment_id</name>
<rename>last_recruitment_id</rename>
<update>Y</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_created_date</name>
<rename>recruitment_created_date</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1056</xloc>
<yloc>400</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>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.prosecution ch on ch.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
/*
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
*/
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4--,
/*
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
*/
FROM flow_data
),
result_max as ( --костыль
SELECT
/*
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1--,
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
*/
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4--,
/*
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
*/
FROM result_ma
),
for_checkpoints as (
/*
SELECT
'job_citizen_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
*/
SELECT
'prosecution_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
/*
union all
SELECT
'job_citizen_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
*/
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,256 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_prosecution_flow4_success</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/16 09:14:18.787</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 09:14:18.787</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>last_recruitment_id</name>
<rename>last_recruitment_id</rename>
<update>Y</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_created_date</name>
<rename>recruitment_created_date</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1056</xloc>
<yloc>400</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>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.prosecution ch on ch.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
/*
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
*/
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4--,
/*
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
*/
FROM flow_data
),
result_max as ( --костыль
SELECT
/*
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1--,
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
*/
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4--,
/*
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
*/
FROM result_ma
),
for_checkpoints as (
/*
SELECT
'job_citizen_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
*/
SELECT
'prosecution_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
/*
union all
SELECT
'job_citizen_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
*/
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,256 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_prosecution_flow5_error</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/16 09:14:18.787</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 09:14:18.787</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>last_recruitment_id</name>
<rename>last_recruitment_id</rename>
<update>Y</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_created_date</name>
<rename>recruitment_created_date</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1056</xloc>
<yloc>400</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>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.prosecution ch on ch.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
/*
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4--,
*/
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
FROM flow_data
),
result_max as ( --костыль
SELECT
/*
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1,
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
*/
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
FROM result_ma
),
for_checkpoints as (
/*
SELECT
'job_citizen_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
*/
SELECT
'prosecution_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,256 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_prosecution_flow5_success</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/16 09:14:18.787</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/16 09:14:18.787</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>last_recruitment_id</name>
<rename>last_recruitment_id</rename>
<update>Y</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>recruitment_created_date</name>
<rename>recruitment_created_date</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1056</xloc>
<yloc>400</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>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.prosecution ch on ch.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
/*
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4--,
*/
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
FROM flow_data
),
result_max as ( --костыль
SELECT
/*
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1,
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
*/
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
FROM result_ma
),
for_checkpoints as (
/*
SELECT
'job_citizen_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_citizen_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
union all
*/
SELECT
'prosecution_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'SUCCESS' as status,
current_timestamp as record_created
from result_max
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,142 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>change_status_to_processing</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 16:14:31.162</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/11 16:14:31.162</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>784</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
'PROCESSING' AS status,
'job_prosecution' AS job_name,
current_timestamp AS record_created
--FROM public.etl_checkpoints
UNION ALL
SELECT
'PROCESSING' AS status,
'prosecution_flow1' AS job_name,
current_timestamp AS record_created
--FROM public.etl_checkpoints
UNION ALL
SELECT
'PROCESSING' AS status,
'prosecution_flow2' AS job_name,
current_timestamp AS record_created
--FROM public.etl_checkpoints
UNION ALL
SELECT
'PROCESSING' AS status,
'prosecution_flow3' AS job_name,
current_timestamp AS record_created
--FROM public.etl_checkpoints
UNION ALL
SELECT
'PROCESSING' AS status,
'prosecution_flow4' AS job_name,
current_timestamp AS record_created
--FROM public.etl_checkpoints
UNION ALL
SELECT
'PROCESSING' AS status,
'prosecution_flow5' AS job_name,
current_timestamp AS record_created
--FROM public.etl_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>368</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>check_if_job_prosecution_exists</name>
<name>check_if_prosecution_job_exists</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
@ -13,23 +13,23 @@
<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>
<created_date>2025/08/05 13:28:46.661</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/11 15:20:18.267</modified_date>
<modified_date>2025/08/05 13:28:46.661</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>
<hop>
<from>Table input</from>
<to>Set variables</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Set variables</name>
@ -44,21 +44,16 @@
</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>
<field_name>job_executed_flag</field_name>
<variable_name>JOB_EXECUTED_FLAG</variable_name>
<variable_type>PARENT_WORKFLOW</variable_type>
</field>
</fields>
<use_formatting>Y</use_formatting>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>352</yloc>
<xloc>672</xloc>
<yloc>336</yloc>
</GUI>
</transform>
<transform>
@ -75,29 +70,17 @@
<connection>ervu-dashboard</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>SELECT
COALESCE(job_name, 'job_prosecution') 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_prosecution'
UNION ALL
SELECT NULL, NULL
WHERE NOT EXISTS (
SELECT 1
FROM public.etl_checkpoints
WHERE job_name = 'job_prosecution'
)
) t</sql>
<sql>SELECT EXISTS (
SELECT 1
FROM etl.job_execution
WHERE job_name = 'prosecution_job'
limit 1
) AS job_executed_flag;</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>400</xloc>
<yloc>352</yloc>
<xloc>384</xloc>
<yloc>336</yloc>
</GUI>
</transform>
<transform>
@ -120,8 +103,8 @@ FROM (
<logmessage>${STATUS}</logmessage>
<attributes/>
<GUI>
<xloc>960</xloc>
<yloc>240</yloc>
<xloc>944</xloc>
<yloc>224</yloc>
</GUI>
</transform>
<transform_error_handling>

View file

@ -1,869 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>checkpoint_job_prosecution</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/03 14:19:02.590</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/03 14:19:02.590</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Filter rows</from>
<to>Abort</to>
<enabled>N</enabled>
</hop>
<hop>
<from>JSON input state_child_flow1.json</from>
<to>Filter rows</to>
<enabled>N</enabled>
</hop>
<hop>
<from>JSON input state_child_flow2.json</from>
<to>Filter rows</to>
<enabled>N</enabled>
</hop>
<hop>
<from>JSON input state_child_flow3.json</from>
<to>Filter rows</to>
<enabled>N</enabled>
</hop>
<hop>
<from>JSON input state_child_flow4.json</from>
<to>Filter rows</to>
<enabled>N</enabled>
</hop>
<hop>
<from>JSON input state_child_flow5.json</from>
<to>Filter rows</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Dummy (do nothing)</from>
<to>JSON input state_child_flow1.json</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Dummy (do nothing)</from>
<to>JSON input state_child_flow2.json</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Dummy (do nothing)</from>
<to>JSON input state_child_flow3.json</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Dummy (do nothing)</from>
<to>JSON input state_child_flow4.json</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Dummy (do nothing)</from>
<to>JSON input state_child_flow5.json</to>
<enabled>N</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_WITH_ERROR</abort_option>
<always_log_rows>Y</always_log_rows>
<row_threshold>0</row_threshold>
<attributes/>
<GUI>
<xloc>1264</xloc>
<yloc>592</yloc>
</GUI>
</transform>
<transform>
<name>Dummy (do nothing)</name>
<type>Dummy</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<attributes/>
<GUI>
<xloc>352</xloc>
<yloc>592</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>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>child_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>child_flow2</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>child_flow3</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>child_flow4</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>child_flow5</text>
<type>String</type>
</value>
</condition>
<condition>
<conditions>
</conditions>
<function>=</function>
<leftvalue>status</leftvalue>
<negated>N</negated>
<operator>AND</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>ERROR</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>OR</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
</conditions>
<function>=</function>
<leftvalue>pipeline</leftvalue>
<negated>N</negated>
<operator>-</operator>
<value>
<isnull>N</isnull>
<length>-1</length>
<name>constant</name>
<precision>-1</precision>
<text>recruits_info_flow1</text>
<type>String</type>
</value>
</condition>
</compare>
<send_true_to>Abort</send_true_to>
<attributes/>
<GUI>
<xloc>944</xloc>
<yloc>592</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>job_name</field>
<name>job_name</name>
</key>
<schema>public</schema>
<table>etl_checkpoints</table>
<value>
<name>job_name</name>
<rename>job_name</rename>
<update>N</update>
</value>
<value>
<name>record_created</name>
<rename>record_created</rename>
<update>Y</update>
</value>
<value>
<name>status</name>
<rename>status</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1264</xloc>
<yloc>208</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_child_flow1.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>432</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_child_flow2.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>512</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_child_flow3.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>592</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_child_flow4.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>672</yloc>
</GUI>
</transform>
<transform>
<name>JSON input state_child_flow5.json</name>
<type>JsonInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<include>N</include>
<include_field/>
<rownum>N</rownum>
<addresultfile>N</addresultfile>
<readurl>N</readurl>
<removeSourceField>N</removeSourceField>
<IsIgnoreEmptyFile>N</IsIgnoreEmptyFile>
<doNotFailIfNoFile>Y</doNotFailIfNoFile>
<ignoreMissingPath>Y</ignoreMissingPath>
<defaultPathLeafToNull>Y</defaultPathLeafToNull>
<rownum_field/>
<file>
<name>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json</name>
<filemask/>
<exclude_filemask/>
<file_required>N</file_required>
<include_subfolders>N</include_subfolders>
</file>
<fields>
<field>
<name>pipeline</name>
<path>$.pipeline</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
<field>
<name>status</name>
<path>$.status</path>
<type>String</type>
<format/>
<currency/>
<decimal/>
<group/>
<length>-1</length>
<precision>-1</precision>
<trim_type>none</trim_type>
<repeat>N</repeat>
</field>
</fields>
<limit>0</limit>
<IsInFields>N</IsInFields>
<IsAFile>N</IsAFile>
<valueField/>
<shortFileFieldName/>
<pathFieldName/>
<hiddenFieldName/>
<lastModificationTimeFieldName/>
<uriNameFieldName/>
<rootUriNameFieldName/>
<extensionFieldName/>
<sizeFieldName/>
<attributes/>
<GUI>
<xloc>640</xloc>
<yloc>752</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>WITH status_check AS (
SELECT
bool_or(status = 'ERROR' AND job_name IN (
'prosecution_flow1',
'prosecution_flow2',
'prosecution_flow3',
'prosecution_flow4',
'prosecution_flow5'
)) AS has_error,
count(*) FILTER (
WHERE status = 'SUCCESS' AND job_name IN (
'prosecution_flow1',
'prosecution_flow2',
'prosecution_flow3',
'prosecution_flow4',
'prosecution_flow5'
)
) = 5 AS all_success
FROM public.etl_checkpoints
)
SELECT
'job_prosecution' as job_name,
CASE
WHEN has_error THEN 'ERROR'
WHEN all_success THEN 'SUCCESS'
ELSE 'ERROR'
END AS status,
current_timestamp AS record_created
FROM status_check;</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>896</xloc>
<yloc>208</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,273 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>checkpoint_prosecution_error</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/09 10:01:04.895</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/09 10:01:04.895</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Select values</from>
<to>Table output</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Select values</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Select values</name>
<type>SelectValues</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<select_unspecified>N</select_unspecified>
<meta>
<name>idm_id</name>
<rename>idm_id</rename>
<type>String</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask/>
<date_format_lenient>false</date_format_lenient>
<date_format_locale/>
<date_format_timezone/>
<lenient_string_to_number>false</lenient_string_to_number>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta>
</fields>
<attributes/>
<GUI>
<xloc>1008</xloc>
<yloc>608</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>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.citizen_child ch on ch.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4,
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
FROM flow_data
),
result_max as ( --костыль
SELECT
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1,
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
FROM result_ma
),
for_checkpoints as (
SELECT
'job_child_flow1' as job_name,
idm_flow1 as last_recruitment_id,
cr_flow1 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_child_flow2' as job_name,
idm_flow2 as last_recruitment_id,
cr_flow2 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_child_flow3' as job_name,
idm_flow3 as last_recruitment_id,
cr_flow3 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_child_flow4' as job_name,
idm_flow4 as last_recruitment_id,
cr_flow4 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
union all
SELECT
'job_child_flow5' as job_name,
idm_flow5 as last_recruitment_id,
cr_flow5 as recruitment_created_date,
'ERROR' as status,
current_timestamp as record_created
from result_max
)
select * from for_checkpoints</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>736</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform>
<name>Table output</name>
<type>TableOutput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<fields>
</fields>
<ignore_errors>N</ignore_errors>
<only_when_have_rows>N</only_when_have_rows>
<partitioning_daily>N</partitioning_daily>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_monthly>Y</partitioning_monthly>
<return_keys>N</return_keys>
<schema>public</schema>
<specify_fields>N</specify_fields>
<table>etl_checkpoints</table>
<tablename_in_field>N</tablename_in_field>
<tablename_in_table>Y</tablename_in_table>
<truncate>N</truncate>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>1248</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,235 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<workflow>
<name>job_create_files_child</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<workflow_version/>
<created_user>-</created_user>
<created_date>2025/05/26 16:48:00.210</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/26 16:48:00.210</modified_date>
<parameters>
</parameters>
<actions>
<action>
<name>Start</name>
<description/>
<type>SPECIAL</type>
<attributes/>
<DayOfMonth>1</DayOfMonth>
<hour>12</hour>
<intervalMinutes>60</intervalMinutes>
<intervalSeconds>0</intervalSeconds>
<minutes>0</minutes>
<repeat>N</repeat>
<schedulerType>0</schedulerType>
<weekDay>1</weekDay>
<parallel>N</parallel>
<xloc>576</xloc>
<yloc>496</yloc>
<attributes_hac/>
</action>
<action>
<name>state_child_flow2_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "child_flow2"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow2.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>416</yloc>
<attributes_hac/>
</action>
<action>
<name>state_child_flow1_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "child_flow1"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow1.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>336</yloc>
<attributes_hac/>
</action>
<action>
<name>state_child_flow3_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "child_flow3"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow3.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>496</yloc>
<attributes_hac/>
</action>
<action>
<name>state_child_flow4_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "child_flow4"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow4.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>576</yloc>
<attributes_hac/>
</action>
<action>
<name>state_child_flow5_new</name>
<description/>
<type>WRITE_TO_FILE</type>
<attributes/>
<appendFile>N</appendFile>
<content>{
"status": "NEW",
"pipeline": "child_flow5"
}</content>
<createParentFolder>N</createParentFolder>
<encoding>UTF-8</encoding>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_child_flow5.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>656</yloc>
<attributes_hac/>
</action>
<action>
<name>Success</name>
<description/>
<type>SUCCESS</type>
<attributes/>
<parallel>N</parallel>
<xloc>1120</xloc>
<yloc>496</yloc>
<attributes_hac/>
</action>
<action>
<name>Delete file state_job_child</name>
<description/>
<type>DELETE_FILE</type>
<attributes/>
<fail_if_file_not_exists>N</fail_if_file_not_exists>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/child/checkpoints/state_job_child.json</filename>
<parallel>N</parallel>
<xloc>848</xloc>
<yloc>256</yloc>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
<from>Start</from>
<to>state_child_flow3_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_child_flow2_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_child_flow1_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_child_flow4_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Start</from>
<to>state_child_flow5_new</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>state_child_flow5_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_child_flow4_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_child_flow3_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_child_flow2_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>state_child_flow1_new</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>Start</from>
<to>Delete file state_job_child</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>Delete file state_job_child</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
</hops>
<notepads>
</notepads>
<attributes/>
</workflow>

View file

@ -1,180 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>delta_prosecution</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/03 16:10:48.509</created_date>
<modified_user>-</modified_user>
<modified_date>2025/06/03 16:10:48.509</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<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>WITH
ugolov_presl AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up,
ri.recruit_id
--'prOtsSvedUgolovPresl'
FROM ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id --AND '${ID_F1}' != '' -- Проверка на пустую строку
--AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
--up->'sledSud'->>'uk', -- уголовный кодекс?
up->'sledSud'->'extend'->>'nomerUDPredv' AS case_number, -- номер уголовного дела (предварительный)
up->'sledSud'->'extend'->>'svedPerekvalif' AS reclassification, -- сведения о переквалификации деяния
--up->'sledSud'->'extend'->>'kodVidUgolovPresl', --
up->'sledSud'->'extend'->>'naimVidUgolovPresl' AS kind, -- наименование вида уголовного преследования
CASE
WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд
ELSE false -- нет или нет инфы
END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина?
--up->'sledSud'->>'naimSud', -- Наименование суда???
up->'sledSud'->>'nomerUD' AS case_number_court, -- номер уголовного дела??? номер уголовного дела (судебный)
STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса
up->'sledSud'->>'naimOrgan' AS authority_name, -- наименование органа принявшего решение
--up->'sledSud'->'svedSnyat'->>'osnSnyatSud', -- основание прекращения уголовного преследования???
--up->'sledSud'->'svedSnyat'->>'dataSnyatSud', -- дата прекращения уголовного преследования
--up->'sledSud'->'svedSnyat'->>'dataOsuzhd', -- дата осуждения??? =
up->'sledSud'->'svedSnyat'->>'dataVozbUD' AS create_date, -- дата возбуждения уголовного дела
up->'sledSud'->'svedSnyat'->>'osnPrekrUD' AS termination_basis, -- основания прекращения уголовного дела = основания прекращения уголовного преследования?
--up->'sledSud'->'svedSnyat'->>'statusNaim' , -- ????
up->'sledSud'->'svedSnyat'->>'dataPrekrUD' AS close_date--, -- дата прекращения уголовного дела
--up->>'sledSudTekst', -- ???
--up->>'sledSudPriznak' -- ???
--'UG_PRESL' AS info_type
FROM ervu_dashboard.citizen r
JOIN ugolov_presl up ON r.recruit_id = up.recruit_id
LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true
GROUP BY r.recruit_id, up</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>624</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>prosecution</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>authority_name</name>
<rename>authority_name</rename>
<update>Y</update>
</value>
<value>
<name>case_number</name>
<rename>case_number</rename>
<update>Y</update>
</value>
<value>
<name>case_number_court</name>
<rename>case_number_court</rename>
<update>Y</update>
</value>
<value>
<name>close_date</name>
<rename>close_date</rename>
<update>Y</update>
</value>
<value>
<name>create_date</name>
<rename>create_date</rename>
<update>Y</update>
</value>
<value>
<name>kind</name>
<rename>kind</rename>
<update>Y</update>
</value>
<value>
<name>law_point</name>
<rename>law_point</rename>
<update>Y</update>
</value>
<value>
<name>reclassification</name>
<rename>reclassification</rename>
<update>Y</update>
</value>
<value>
<name>termination_basis</name>
<rename>termination_basis</rename>
<update>Y</update>
</value>
<value>
<name>transfer_to_court</name>
<rename>transfer_to_court</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1040</xloc>
<yloc>352</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,579 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>prosecution_flow</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/05 14:31:22.799</created_date>
<modified_user>-</modified_user>
<modified_date>2025/08/05 14:31:22.799</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Create job execution record</from>
<to>Table input</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table output</from>
<to>Change job status on error</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Change job status on error</from>
<to>Abort</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Filter rows</from>
<to>Change job status on success</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table output</from>
<to>Detect empty stream</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Detect empty stream</from>
<to>Change job status on success</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table output</from>
<to>Group by</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Group by</from>
<to>Identify last row in a stream</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Identify last row in a stream</from>
<to>Add constants</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Add constants</from>
<to>Update</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Update</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Update</from>
<to>Change job status on error</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_WITH_ERROR</abort_option>
<always_log_rows>Y</always_log_rows>
<row_threshold>0</row_threshold>
<attributes/>
<GUI>
<xloc>1216</xloc>
<yloc>224</yloc>
</GUI>
</transform>
<transform>
<name>Add constants</name>
<type>Constant</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<length>-1</length>
<name>has_criminal_prosecution</name>
<nullif>true</nullif>
<precision>-1</precision>
<set_empty_string>N</set_empty_string>
<type>Boolean</type>
</field>
</fields>
<attributes/>
<GUI>
<xloc>832</xloc>
<yloc>32</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 = ?
WHERE job_name = '${JOB_NAME}'
and recruitment_id = '${IDM_ID}';
</sql>
<attributes/>
<GUI>
<xloc>1056</xloc>
<yloc>224</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>Y</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 = 'SUCCESS'
WHERE job_name = '${JOB_NAME}'
and recruitment_id = '${IDM_ID}'
and status = 'PROCESSING';
</sql>
<attributes/>
<GUI>
<xloc>1456</xloc>
<yloc>32</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>INSERT INTO etl.job_execution (id, job_name, status, execution_datetime, error_description, recruitment_id)
VALUES (DEFAULT, '${JOB_NAME}', 'PROCESSING', DEFAULT, null, '${IDM_ID}');
</sql>
<attributes/>
<GUI>
<xloc>272</xloc>
<yloc>464</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>1456</xloc>
<yloc>464</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>1200</xloc>
<yloc>32</yloc>
</GUI>
</transform>
<transform>
<name>Group by</name>
<type>GroupBy</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<add_linenr>N</add_linenr>
<all_rows>N</all_rows>
<directory>${java.io.tmpdir}</directory>
<fields>
</fields>
<give_back_row>N</give_back_row>
<group>
<field>
<name>recruit_id</name>
</field>
</group>
<ignore_aggregate>N</ignore_aggregate>
<prefix>grp</prefix>
<attributes/>
<GUI>
<xloc>832</xloc>
<yloc>320</yloc>
</GUI>
</transform>
<transform>
<name>Identify last row in a stream</name>
<type>DetectLastRow</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<resultfieldname>last_row</resultfieldname>
<attributes/>
<GUI>
<xloc>832</xloc>
<yloc>176</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/>
<sql>WITH
ugolov_presl AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
AND '${IDM_ID}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
(up->>'id')::uuid AS prosecution_external_id,
NULLIF(up->'sledSud'->>'uk', '') AS uk_name,
NULLIF(up->'sledSud'->'extend'->>'nomerUDPredv', '') AS case_number,
NULLIF(up->'sledSud'->'extend'->>'svedPerekvalif', '') AS reclassification,
NULLIF(up->'sledSud'->'extend'->>'naimVidUgolovPresl', '') AS kind,
CASE
WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true
ELSE false -- нет или нет инфы
END AS transfer_to_court,
NULLIF(up->'sledSud'->>'naimSud','') AS court_name,
NULLIF(up->'sledSud'->>'nomerUD','') AS case_number_court,
STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point,
NULLIF(up->'sledSud'->>'naimOrgan', '') AS authority_name,
NULLIF(up->'sledSud'->'svedSnyat'->>'osnSnyatSud', '') AS conviction_removal_basis,
TO_DATE(up->'sledSud'->'svedSnyat'->>'dataSnyatSud', 'YYYY-MM-DD') AS conviction_removal_date,
TO_DATE(up->'sledSud'->>'dataOsuzhd', 'YYYY-MM-DD') AS conviction_date,
TO_DATE(up->'sledSud'->>'dataVozbUD', 'YYYY-MM-DD') AS create_date,
NULLIF(up->'sledSud'->>'osnPrekrUD', '') AS termination_basis,
NULLIF(up->'sledSud'->>'statusNaim', '') AS conviction_status,
TO_DATE(up->'sledSud'->>'dataPrekrUD', 'YYYY-MM-DD') AS close_date,
NULLIF(up->'sledSudTekst'->>'svedTekst' , '') AS sled_sud_tekst_sved_tekst,
NULLIF(up->'sledSudTekst'->>'statusNaim', '') AS sled_sud_tekst_status_naim,
CASE
WHEN (up->>'sledSud') IS NOT NULL AND up->>'sledSud' != 'null' THEN 'Сведения о фактах уголовного преследования или судимости в структурированном формате'
WHEN (up->>'sledSudTekst') IS NOT NULL AND up->>'sledSudTekst' != 'null' THEN 'Сведения о фактах уголовного преследования или судимости в текстовом виде'
ELSE 'Есть сведения о фактах уголовного преследования или судимости без указания подробностей'
END AS type_info
FROM ervu_dashboard.citizen r
JOIN ugolov_presl up ON r.recruit_id = up.recruit_id
LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true
GROUP BY r.recruit_id, up;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>480</xloc>
<yloc>464</yloc>
</GUI>
</transform>
<transform>
<name>Table output</name>
<type>TableOutput</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<fields>
<field>
<column_name>recruit_id</column_name>
<stream_name>recruit_id</stream_name>
</field>
<field>
<column_name>prosecution_external_id</column_name>
<stream_name>prosecution_external_id</stream_name>
</field>
<field>
<column_name>uk_name</column_name>
<stream_name>uk_name</stream_name>
</field>
<field>
<column_name>case_number</column_name>
<stream_name>case_number</stream_name>
</field>
<field>
<column_name>reclassification</column_name>
<stream_name>reclassification</stream_name>
</field>
<field>
<column_name>kind</column_name>
<stream_name>kind</stream_name>
</field>
<field>
<column_name>transfer_to_court</column_name>
<stream_name>transfer_to_court</stream_name>
</field>
<field>
<column_name>court_name</column_name>
<stream_name>court_name</stream_name>
</field>
<field>
<column_name>case_number_court</column_name>
<stream_name>case_number_court</stream_name>
</field>
<field>
<column_name>law_point</column_name>
<stream_name>law_point</stream_name>
</field>
<field>
<column_name>authority_name</column_name>
<stream_name>authority_name</stream_name>
</field>
<field>
<column_name>conviction_removal_basis</column_name>
<stream_name>conviction_removal_basis</stream_name>
</field>
<field>
<column_name>conviction_removal_date</column_name>
<stream_name>conviction_removal_date</stream_name>
</field>
<field>
<column_name>conviction_date</column_name>
<stream_name>conviction_date</stream_name>
</field>
<field>
<column_name>create_date</column_name>
<stream_name>create_date</stream_name>
</field>
<field>
<column_name>termination_basis</column_name>
<stream_name>termination_basis</stream_name>
</field>
<field>
<column_name>conviction_status</column_name>
<stream_name>conviction_status</stream_name>
</field>
<field>
<column_name>close_date</column_name>
<stream_name>close_date</stream_name>
</field>
<field>
<column_name>sled_sud_tekst_sved_tekst</column_name>
<stream_name>sled_sud_tekst_sved_tekst</stream_name>
</field>
<field>
<column_name>sled_sud_tekst_status_naim</column_name>
<stream_name>sled_sud_tekst_status_naim</stream_name>
</field>
<field>
<column_name>type_info</column_name>
<stream_name>type_info</stream_name>
</field>
</fields>
<ignore_errors>N</ignore_errors>
<only_when_have_rows>N</only_when_have_rows>
<partitioning_daily>N</partitioning_daily>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_monthly>Y</partitioning_monthly>
<return_keys>N</return_keys>
<schema>ervu_dashboard</schema>
<specify_fields>Y</specify_fields>
<table>prosecution</table>
<tablename_in_field>N</tablename_in_field>
<tablename_in_table>Y</tablename_in_table>
<truncate>N</truncate>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>832</xloc>
<yloc>464</yloc>
</GUI>
</transform>
<transform>
<name>Update</name>
<type>Update</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<error_ignored>N</error_ignored>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen</table>
<value>
<name>has_criminal_prosecution</name>
<rename>has_criminal_prosecution</rename>
</value>
</lookup>
<skip_lookup>N</skip_lookup>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>1056</xloc>
<yloc>32</yloc>
</GUI>
</transform>
<transform_error_handling>
<error>
<source_transform>Table output</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>error_code</codes_valuename>
<max_errors/>
<max_pct_errors/>
<min_pct_rows/>
</error>
<error>
<source_transform>Update</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>error_code</codes_valuename>
<max_errors/>
<max_pct_errors/>
<min_pct_rows/>
</error>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,266 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>prosecution_flow1</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>
</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/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Select values 4 2</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Select values 4 2</from>
<to>Get variables</to>
<enabled>N</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Get variables</name>
<type>GetVariable</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<length>-1</length>
<name>recruitment_id</name>
<precision>-1</precision>
<trim_type>none</trim_type>
<type>String</type>
<variable>ID_F1</variable>
</field>
</fields>
<attributes/>
<GUI>
<xloc>976</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>prosecution</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>authority_name</name>
<rename>authority_name</rename>
<update>Y</update>
</value>
<value>
<name>case_number</name>
<rename>case_number</rename>
<update>Y</update>
</value>
<value>
<name>case_number_court</name>
<rename>case_number_court</rename>
<update>Y</update>
</value>
<value>
<name>close_date</name>
<rename>close_date</rename>
<update>Y</update>
</value>
<value>
<name>create_date</name>
<rename>create_date</rename>
<update>Y</update>
</value>
<value>
<name>kind</name>
<rename>kind</rename>
<update>Y</update>
</value>
<value>
<name>law_point</name>
<rename>law_point</rename>
<update>Y</update>
</value>
<value>
<name>reclassification</name>
<rename>reclassification</rename>
<update>Y</update>
</value>
<value>
<name>termination_basis</name>
<rename>termination_basis</rename>
<update>Y</update>
</value>
<value>
<name>transfer_to_court</name>
<rename>transfer_to_court</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>960</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>Select values 4 2</name>
<type>SelectValues</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<select_unspecified>N</select_unspecified>
<meta>
<name>ID_F1</name>
<rename>ID_F1</rename>
<type>String</type>
<length>-2</length>
<precision>-2</precision>
<conversion_mask/>
<date_format_lenient>false</date_format_lenient>
<date_format_locale/>
<date_format_timezone/>
<lenient_string_to_number>false</lenient_string_to_number>
<encoding/>
<decimal_symbol/>
<grouping_symbol/>
<currency_symbol/>
<storage_type/>
</meta>
</fields>
<attributes/>
<GUI>
<xloc>720</xloc>
<yloc>400</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>WITH
ugolov_presl AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up,
ri.recruit_id
--'prOtsSvedUgolovPresl'
FROM ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F1}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F1}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
--up->'sledSud'->>'uk', -- уголовный кодекс?
up->'sledSud'->'extend'->>'nomerUDPredv' AS case_number, -- номер уголовного дела (предварительный)
up->'sledSud'->'extend'->>'svedPerekvalif' AS reclassification, -- сведения о переквалификации деяния
--up->'sledSud'->'extend'->>'kodVidUgolovPresl', --
up->'sledSud'->'extend'->>'naimVidUgolovPresl' AS kind, -- наименование вида уголовного преследования
CASE
WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд
ELSE false -- нет или нет инфы
END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина?
--up->'sledSud'->>'naimSud', -- Наименование суда???
up->'sledSud'->>'nomerUD' AS case_number_court, -- номер уголовного дела??? номер уголовного дела (судебный)
STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса
up->'sledSud'->>'naimOrgan' AS authority_name, -- наименование органа принявшего решение
--up->'sledSud'->'svedSnyat'->>'osnSnyatSud', -- основание прекращения уголовного преследования???
--up->'sledSud'->'svedSnyat'->>'dataSnyatSud', -- дата прекращения уголовного преследования
--up->'sledSud'->'svedSnyat'->>'dataOsuzhd', -- дата осуждения??? =
up->'sledSud'->'svedSnyat'->>'dataVozbUD' AS create_date, -- дата возбуждения уголовного дела
up->'sledSud'->'svedSnyat'->>'osnPrekrUD' AS termination_basis, -- основания прекращения уголовного дела = основания прекращения уголовного преследования?
--up->'sledSud'->'svedSnyat'->>'statusNaim' , -- ????
up->'sledSud'->'svedSnyat'->>'dataPrekrUD' AS close_date--, -- дата прекращения уголовного дела
--up->>'sledSudTekst', -- ???
--up->>'sledSudPriznak' -- ???
--'UG_PRESL' AS info_type
FROM ervu_dashboard.citizen r
JOIN ugolov_presl up ON r.recruit_id = up.recruit_id
LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true
GROUP BY r.recruit_id, up</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>448</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform_error_handling>
<error>
<source_transform>Select values 4 2</source_transform>
<target_transform>Get variables</target_transform>
<is_enabled>Y</is_enabled>
<nr_valuename/>
<descriptions_valuename/>
<fields_valuename/>
<codes_valuename/>
<max_errors/>
<max_pct_errors/>
<min_pct_rows/>
</error>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,179 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>prosecution_flow2</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/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>prosecution</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>authority_name</name>
<rename>authority_name</rename>
<update>Y</update>
</value>
<value>
<name>case_number</name>
<rename>case_number</rename>
<update>Y</update>
</value>
<value>
<name>case_number_court</name>
<rename>case_number_court</rename>
<update>Y</update>
</value>
<value>
<name>close_date</name>
<rename>close_date</rename>
<update>Y</update>
</value>
<value>
<name>create_date</name>
<rename>create_date</rename>
<update>Y</update>
</value>
<value>
<name>kind</name>
<rename>kind</rename>
<update>Y</update>
</value>
<value>
<name>law_point</name>
<rename>law_point</rename>
<update>Y</update>
</value>
<value>
<name>reclassification</name>
<rename>reclassification</rename>
<update>Y</update>
</value>
<value>
<name>termination_basis</name>
<rename>termination_basis</rename>
<update>Y</update>
</value>
<value>
<name>transfer_to_court</name>
<rename>transfer_to_court</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1232</xloc>
<yloc>400</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>WITH
ugolov_presl AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up,
ri.recruit_id
--'prOtsSvedUgolovPresl'
FROM ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F2}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F2}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
--up->'sledSud'->>'uk', -- уголовный кодекс?
up->'sledSud'->'extend'->>'nomerUDPredv' AS case_number, -- номер уголовного дела (предварительный)
up->'sledSud'->'extend'->>'svedPerekvalif' AS reclassification, -- сведения о переквалификации деяния
--up->'sledSud'->'extend'->>'kodVidUgolovPresl', --
up->'sledSud'->'extend'->>'naimVidUgolovPresl' AS kind, -- наименование вида уголовного преследования
CASE
WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд
ELSE false -- нет или нет инфы
END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина?
--up->'sledSud'->>'naimSud', -- Наименование суда???
up->'sledSud'->>'nomerUD' AS case_number_court, -- номер уголовного дела??? номер уголовного дела (судебный)
STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса
up->'sledSud'->>'naimOrgan' AS authority_name, -- наименование органа принявшего решение
--up->'sledSud'->'svedSnyat'->>'osnSnyatSud', -- основание прекращения уголовного преследования???
--up->'sledSud'->'svedSnyat'->>'dataSnyatSud', -- дата прекращения уголовного преследования
--up->'sledSud'->'svedSnyat'->>'dataOsuzhd', -- дата осуждения??? =
up->'sledSud'->'svedSnyat'->>'dataVozbUD' AS create_date, -- дата возбуждения уголовного дела
up->'sledSud'->'svedSnyat'->>'osnPrekrUD' AS termination_basis, -- основания прекращения уголовного дела = основания прекращения уголовного преследования?
--up->'sledSud'->'svedSnyat'->>'statusNaim' , -- ????
up->'sledSud'->'svedSnyat'->>'dataPrekrUD' AS close_date--, -- дата прекращения уголовного дела
--up->>'sledSudTekst', -- ???
--up->>'sledSudPriznak' -- ???
--'UG_PRESL' AS info_type
FROM ervu_dashboard.citizen r
JOIN ugolov_presl up ON r.recruit_id = up.recruit_id
LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true
GROUP BY r.recruit_id, up</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>736</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,179 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>prosecution_flow3</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/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>prosecution</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>authority_name</name>
<rename>authority_name</rename>
<update>Y</update>
</value>
<value>
<name>case_number</name>
<rename>case_number</rename>
<update>Y</update>
</value>
<value>
<name>case_number_court</name>
<rename>case_number_court</rename>
<update>Y</update>
</value>
<value>
<name>close_date</name>
<rename>close_date</rename>
<update>Y</update>
</value>
<value>
<name>create_date</name>
<rename>create_date</rename>
<update>Y</update>
</value>
<value>
<name>kind</name>
<rename>kind</rename>
<update>Y</update>
</value>
<value>
<name>law_point</name>
<rename>law_point</rename>
<update>Y</update>
</value>
<value>
<name>reclassification</name>
<rename>reclassification</rename>
<update>Y</update>
</value>
<value>
<name>termination_basis</name>
<rename>termination_basis</rename>
<update>Y</update>
</value>
<value>
<name>transfer_to_court</name>
<rename>transfer_to_court</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1216</xloc>
<yloc>400</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>WITH
ugolov_presl AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up,
ri.recruit_id
--'prOtsSvedUgolovPresl'
FROM ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F3}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F3}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
--up->'sledSud'->>'uk', -- уголовный кодекс?
up->'sledSud'->'extend'->>'nomerUDPredv' AS case_number, -- номер уголовного дела (предварительный)
up->'sledSud'->'extend'->>'svedPerekvalif' AS reclassification, -- сведения о переквалификации деяния
--up->'sledSud'->'extend'->>'kodVidUgolovPresl', --
up->'sledSud'->'extend'->>'naimVidUgolovPresl' AS kind, -- наименование вида уголовного преследования
CASE
WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд
ELSE false -- нет или нет инфы
END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина?
--up->'sledSud'->>'naimSud', -- Наименование суда???
up->'sledSud'->>'nomerUD' AS case_number_court, -- номер уголовного дела??? номер уголовного дела (судебный)
STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса
up->'sledSud'->>'naimOrgan' AS authority_name, -- наименование органа принявшего решение
--up->'sledSud'->'svedSnyat'->>'osnSnyatSud', -- основание прекращения уголовного преследования???
--up->'sledSud'->'svedSnyat'->>'dataSnyatSud', -- дата прекращения уголовного преследования
--up->'sledSud'->'svedSnyat'->>'dataOsuzhd', -- дата осуждения??? =
up->'sledSud'->'svedSnyat'->>'dataVozbUD' AS create_date, -- дата возбуждения уголовного дела
up->'sledSud'->'svedSnyat'->>'osnPrekrUD' AS termination_basis, -- основания прекращения уголовного дела = основания прекращения уголовного преследования?
--up->'sledSud'->'svedSnyat'->>'statusNaim' , -- ????
up->'sledSud'->'svedSnyat'->>'dataPrekrUD' AS close_date--, -- дата прекращения уголовного дела
--up->>'sledSudTekst', -- ???
--up->>'sledSudPriznak' -- ???
--'UG_PRESL' AS info_type
FROM ervu_dashboard.citizen r
JOIN ugolov_presl up ON r.recruit_id = up.recruit_id
LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true
GROUP BY r.recruit_id, up</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>720</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,179 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>prosecution_flow4</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/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>prosecution</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>authority_name</name>
<rename>authority_name</rename>
<update>Y</update>
</value>
<value>
<name>case_number</name>
<rename>case_number</rename>
<update>Y</update>
</value>
<value>
<name>case_number_court</name>
<rename>case_number_court</rename>
<update>Y</update>
</value>
<value>
<name>close_date</name>
<rename>close_date</rename>
<update>Y</update>
</value>
<value>
<name>create_date</name>
<rename>create_date</rename>
<update>Y</update>
</value>
<value>
<name>kind</name>
<rename>kind</rename>
<update>Y</update>
</value>
<value>
<name>law_point</name>
<rename>law_point</rename>
<update>Y</update>
</value>
<value>
<name>reclassification</name>
<rename>reclassification</rename>
<update>Y</update>
</value>
<value>
<name>termination_basis</name>
<rename>termination_basis</rename>
<update>Y</update>
</value>
<value>
<name>transfer_to_court</name>
<rename>transfer_to_court</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1184</xloc>
<yloc>400</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>WITH
ugolov_presl AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up,
ri.recruit_id
--'prOtsSvedUgolovPresl'
FROM ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F4}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F4}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
--up->'sledSud'->>'uk', -- уголовный кодекс?
up->'sledSud'->'extend'->>'nomerUDPredv' AS case_number, -- номер уголовного дела (предварительный)
up->'sledSud'->'extend'->>'svedPerekvalif' AS reclassification, -- сведения о переквалификации деяния
--up->'sledSud'->'extend'->>'kodVidUgolovPresl', --
up->'sledSud'->'extend'->>'naimVidUgolovPresl' AS kind, -- наименование вида уголовного преследования
CASE
WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд
ELSE false -- нет или нет инфы
END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина?
--up->'sledSud'->>'naimSud', -- Наименование суда???
up->'sledSud'->>'nomerUD' AS case_number_court, -- номер уголовного дела??? номер уголовного дела (судебный)
STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса
up->'sledSud'->>'naimOrgan' AS authority_name, -- наименование органа принявшего решение
--up->'sledSud'->'svedSnyat'->>'osnSnyatSud', -- основание прекращения уголовного преследования???
--up->'sledSud'->'svedSnyat'->>'dataSnyatSud', -- дата прекращения уголовного преследования
--up->'sledSud'->'svedSnyat'->>'dataOsuzhd', -- дата осуждения??? =
up->'sledSud'->'svedSnyat'->>'dataVozbUD' AS create_date, -- дата возбуждения уголовного дела
up->'sledSud'->'svedSnyat'->>'osnPrekrUD' AS termination_basis, -- основания прекращения уголовного дела = основания прекращения уголовного преследования?
--up->'sledSud'->'svedSnyat'->>'statusNaim' , -- ????
up->'sledSud'->'svedSnyat'->>'dataPrekrUD' AS close_date--, -- дата прекращения уголовного дела
--up->>'sledSudTekst', -- ???
--up->>'sledSudPriznak' -- ???
--'UG_PRESL' AS info_type
FROM ervu_dashboard.citizen r
JOIN ugolov_presl up ON r.recruit_id = up.recruit_id
LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true
GROUP BY r.recruit_id, up</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>688</xloc>
<yloc>400</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,179 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>prosecution_flow5</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/05/21 14:05:02.260</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/21 14:05:02.260</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>prosecution</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>authority_name</name>
<rename>authority_name</rename>
<update>Y</update>
</value>
<value>
<name>case_number</name>
<rename>case_number</rename>
<update>Y</update>
</value>
<value>
<name>case_number_court</name>
<rename>case_number_court</rename>
<update>Y</update>
</value>
<value>
<name>close_date</name>
<rename>close_date</rename>
<update>Y</update>
</value>
<value>
<name>create_date</name>
<rename>create_date</rename>
<update>Y</update>
</value>
<value>
<name>kind</name>
<rename>kind</rename>
<update>Y</update>
</value>
<value>
<name>law_point</name>
<rename>law_point</rename>
<update>Y</update>
</value>
<value>
<name>reclassification</name>
<rename>reclassification</rename>
<update>Y</update>
</value>
<value>
<name>termination_basis</name>
<rename>termination_basis</rename>
<update>Y</update>
</value>
<value>
<name>transfer_to_court</name>
<rename>transfer_to_court</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>1216</xloc>
<yloc>368</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>WITH
ugolov_presl AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up,
ri.recruit_id
--'prOtsSvedUgolovPresl'
FROM ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id AND '${ID_F5}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${ID_F5}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
--up->'sledSud'->>'uk', -- уголовный кодекс?
up->'sledSud'->'extend'->>'nomerUDPredv' AS case_number, -- номер уголовного дела (предварительный)
up->'sledSud'->'extend'->>'svedPerekvalif' AS reclassification, -- сведения о переквалификации деяния
--up->'sledSud'->'extend'->>'kodVidUgolovPresl', --
up->'sledSud'->'extend'->>'naimVidUgolovPresl' AS kind, -- наименование вида уголовного преследования
CASE
WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд
ELSE false -- нет или нет инфы
END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина?
--up->'sledSud'->>'naimSud', -- Наименование суда???
up->'sledSud'->>'nomerUD' AS case_number_court, -- номер уголовного дела??? номер уголовного дела (судебный)
STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса
up->'sledSud'->>'naimOrgan' AS authority_name, -- наименование органа принявшего решение
--up->'sledSud'->'svedSnyat'->>'osnSnyatSud', -- основание прекращения уголовного преследования???
--up->'sledSud'->'svedSnyat'->>'dataSnyatSud', -- дата прекращения уголовного преследования
--up->'sledSud'->'svedSnyat'->>'dataOsuzhd', -- дата осуждения??? =
up->'sledSud'->'svedSnyat'->>'dataVozbUD' AS create_date, -- дата возбуждения уголовного дела
up->'sledSud'->'svedSnyat'->>'osnPrekrUD' AS termination_basis, -- основания прекращения уголовного дела = основания прекращения уголовного преследования?
--up->'sledSud'->'svedSnyat'->>'statusNaim' , -- ????
up->'sledSud'->'svedSnyat'->>'dataPrekrUD' AS close_date--, -- дата прекращения уголовного дела
--up->>'sledSudTekst', -- ???
--up->>'sledSudPriznak' -- ???
--'UG_PRESL' AS info_type
FROM ervu_dashboard.citizen r
JOIN ugolov_presl up ON r.recruit_id = up.recruit_id
LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true
GROUP BY r.recruit_id, up</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>720</xloc>
<yloc>368</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,605 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>prosecution_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:22:56.048</created_date>
<modified_user>-</modified_user>
<modified_date>2025/08/11 13:22:56.048</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Create job execution record</from>
<to>Table input</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Insert / update</from>
<to>Change job status on error</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Insert / update</from>
<to>Detect empty stream</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Detect empty stream</from>
<to>Change job status on success</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Filter rows</from>
<to>Change job status on success</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Change job status on error</from>
<to>Abort</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Identify last row in a stream 2</from>
<to>Add constants</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Group by</from>
<to>Identify last row in a stream 2</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Insert / update</from>
<to>Group by</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Add constants</from>
<to>Update</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Update</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Update</from>
<to>Change job status on error</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Insert / update</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_WITH_ERROR</abort_option>
<always_log_rows>Y</always_log_rows>
<row_threshold>0</row_threshold>
<attributes/>
<GUI>
<xloc>992</xloc>
<yloc>592</yloc>
</GUI>
</transform>
<transform>
<name>Add constants</name>
<type>Constant</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<length>-1</length>
<name>has_criminal_prosecution</name>
<nullif>true</nullif>
<precision>-1</precision>
<set_empty_string>N</set_empty_string>
<type>Boolean</type>
</field>
</fields>
<attributes/>
<GUI>
<xloc>736</xloc>
<yloc>416</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 = 'DELTA_ERROR',
error_description = ?
WHERE job_name = '${JOB_NAME}'
and recruitment_id = '${IDM_ID}';
</sql>
<attributes/>
<GUI>
<xloc>880</xloc>
<yloc>592</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>Y</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'
WHERE job_name = '${JOB_NAME}'
and recruitment_id = '${IDM_ID}'
and status = 'DELTA_PROCESSING';
</sql>
<attributes/>
<GUI>
<xloc>1152</xloc>
<yloc>416</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 = DEFAULT,
error_description = NULL
where job_name = '${JOB_NAME}'
and recruitment_id = '${IDM_ID}';</sql>
<attributes/>
<GUI>
<xloc>112</xloc>
<yloc>768</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>1152</xloc>
<yloc>768</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>1024</xloc>
<yloc>416</yloc>
</GUI>
</transform>
<transform>
<name>Group by</name>
<type>GroupBy</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<add_linenr>N</add_linenr>
<all_rows>N</all_rows>
<directory>${java.io.tmpdir}</directory>
<fields>
</fields>
<give_back_row>N</give_back_row>
<group>
<field>
<name>recruit_id</name>
</field>
</group>
<ignore_aggregate>N</ignore_aggregate>
<prefix>grp</prefix>
<attributes/>
<GUI>
<xloc>736</xloc>
<yloc>640</yloc>
</GUI>
</transform>
<transform>
<name>Identify last row in a stream 2</name>
<type>DetectLastRow</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<resultfieldname>last_row</resultfieldname>
<attributes/>
<GUI>
<xloc>736</xloc>
<yloc>528</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<key>
<condition>=</condition>
<field>prosecution_external_id</field>
<name>prosecution_external_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>prosecution</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>prosecution_external_id</name>
<rename>prosecution_external_id</rename>
<update>N</update>
</value>
<value>
<name>uk_name</name>
<rename>uk_name</rename>
<update>Y</update>
</value>
<value>
<name>case_number</name>
<rename>case_number</rename>
<update>Y</update>
</value>
<value>
<name>reclassification</name>
<rename>reclassification</rename>
<update>Y</update>
</value>
<value>
<name>kind</name>
<rename>kind</rename>
<update>Y</update>
</value>
<value>
<name>transfer_to_court</name>
<rename>transfer_to_court</rename>
<update>Y</update>
</value>
<value>
<name>court_name</name>
<rename>court_name</rename>
<update>Y</update>
</value>
<value>
<name>case_number_court</name>
<rename>case_number_court</rename>
<update>Y</update>
</value>
<value>
<name>law_point</name>
<rename>law_point</rename>
<update>Y</update>
</value>
<value>
<name>authority_name</name>
<rename>authority_name</rename>
<update>Y</update>
</value>
<value>
<name>conviction_removal_basis</name>
<rename>conviction_removal_basis</rename>
<update>Y</update>
</value>
<value>
<name>conviction_removal_date</name>
<rename>conviction_removal_date</rename>
<update>Y</update>
</value>
<value>
<name>conviction_date</name>
<rename>conviction_date</rename>
<update>Y</update>
</value>
<value>
<name>create_date</name>
<rename>create_date</rename>
<update>Y</update>
</value>
<value>
<name>termination_basis</name>
<rename>termination_basis</rename>
<update>Y</update>
</value>
<value>
<name>conviction_status</name>
<rename>conviction_status</rename>
<update>Y</update>
</value>
<value>
<name>close_date</name>
<rename>close_date</rename>
<update>Y</update>
</value>
<value>
<name>sled_sud_tekst_sved_tekst</name>
<rename>sled_sud_tekst_sved_tekst</rename>
<update>Y</update>
</value>
<value>
<name>sled_sud_tekst_status_naim</name>
<rename>sled_sud_tekst_status_naim</rename>
<update>Y</update>
</value>
<value>
<name>type_info</name>
<rename>type_info</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>736</xloc>
<yloc>768</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/>
<sql>WITH
ugolov_presl AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up,
ri.recruit_id
--'prOtsSvedUgolovPresl'
FROM ervu_dashboard.recruits_info ri
join ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
AND '${IDM_ID}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
AND ri.updated_at >= '${M_R_UP_DATE}'::timestamp
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
(up->>'id')::uuid AS prosecution_external_id,
NULLIF(up->'sledSud'->>'uk', '') AS uk_name, -- УК осуждения
NULLIF(up->'sledSud'->'extend'->>'nomerUDPredv', '') AS case_number, -- номер уголовного дела (предварительный)
NULLIF(up->'sledSud'->'extend'->>'svedPerekvalif', '') AS reclassification, -- сведения о переквалификации деяния
NULLIF(up->'sledSud'->'extend'->>'naimVidUgolovPresl', '') AS kind, -- наименование вида уголовного преследования
CASE
WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true -- передано в суд
ELSE false -- нет или нет инфы
END AS transfer_to_court, -- признак передачи в суд уголовного дела в отношении гражданина
NULLIF(up->'sledSud'->>'naimSud','') AS court_name, -- Наименование суда, вынесшего приговор
NULLIF(up->'sledSud'->>'nomerUD','') AS case_number_court, -- номер уголовного дела (судебный)
STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point, -- статьи уголовного кодекса
NULLIF(up->'sledSud'->>'naimOrgan', '') AS authority_name, -- наименование органа, принявшего решение о возбуждении уголовного дела
NULLIF(up->'sledSud'->'svedSnyat'->>'osnSnyatSud', '') AS conviction_removal_basis, -- основание снятия судимости
TO_DATE(up->'sledSud'->'svedSnyat'->>'dataSnyatSud', 'YYYY-MM-DD') AS conviction_removal_date, -- дата снятия судимости
TO_DATE(up->'sledSud'->>'dataOsuzhd', 'YYYY-MM-DD') AS conviction_date, -- дата осуждения
TO_DATE(up->'sledSud'->>'dataVozbUD', 'YYYY-MM-DD') AS create_date, -- дата возбуждения уголовного дела
NULLIF(up->'sledSud'->>'osnPrekrUD', '') AS termination_basis, -- основания прекращения уголовного дела
NULLIF(up->'sledSud'->>'statusNaim', '') AS conviction_status, -- статус судимости
TO_DATE(up->'sledSud'->>'dataPrekrUD', 'YYYY-MM-DD') AS close_date, -- дата прекращения уголовного дела
NULLIF(up->'sledSudTekst'->>'svedTekst' , '') AS sled_sud_tekst_sved_tekst, -- текст судимости в текстовом формате
NULLIF(up->'sledSudTekst'->>'statusNaim', '') AS sled_sud_tekst_status_naim, -- статус судимости в текстовом формате
CASE
WHEN (up->>'sledSud') IS NOT NULL AND up->>'sledSud' != 'null' THEN 'Сведения о фактах уголовного преследования или судимости в структурированном формате'
WHEN (up->>'sledSudTekst') IS NOT NULL AND up->>'sledSudTekst' != 'null' THEN 'Сведения о фактах уголовного преследования или судимости в текстовом виде'
ELSE 'Есть сведения о фактах уголовного преследования или судимости без указания подробностей'
END AS type_info
FROM ervu_dashboard.citizen r
JOIN ugolov_presl up ON r.recruit_id = up.recruit_id
LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true
GROUP BY r.recruit_id, up;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>384</xloc>
<yloc>768</yloc>
</GUI>
</transform>
<transform>
<name>Update</name>
<type>Update</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<error_ignored>N</error_ignored>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen</table>
<value>
<name>has_criminal_prosecution</name>
<rename>has_criminal_prosecution</rename>
</value>
</lookup>
<skip_lookup>N</skip_lookup>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>880</xloc>
<yloc>416</yloc>
</GUI>
</transform>
<transform_error_handling>
<error>
<source_transform>Insert / update</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>error_code</codes_valuename>
<max_errors/>
<max_pct_errors/>
<min_pct_rows/>
</error>
<error>
<source_transform>Update</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>error_code</codes_valuename>
<max_errors/>
<max_pct_errors/>
<min_pct_rows/>
</error>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,617 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>prosecution_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/08/08 13:25:52.319</created_date>
<modified_user>-</modified_user>
<modified_date>2025/08/08 13:25:52.319</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Create job execution record</from>
<to>Table input</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Insert / update</from>
<to>Change job status on error</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Insert / update</from>
<to>Detect empty stream</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Detect empty stream</from>
<to>Change job status on success</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Filter rows</from>
<to>Change job status on success</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Change job status on error</from>
<to>Abort</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>Insert / update</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Group by</from>
<to>Identify last row in a stream</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Identify last row in a stream</from>
<to>Add constants</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Insert / update</from>
<to>Group by</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Add constants</from>
<to>Update</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Update</from>
<to>Filter rows</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Update</from>
<to>Change job status on error</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_WITH_ERROR</abort_option>
<always_log_rows>Y</always_log_rows>
<row_threshold>0</row_threshold>
<attributes/>
<GUI>
<xloc>1120</xloc>
<yloc>736</yloc>
</GUI>
</transform>
<transform>
<name>Add constants</name>
<type>Constant</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<fields>
<field>
<length>-1</length>
<name>has_criminal_prosecution</name>
<nullif>true</nullif>
<precision>-1</precision>
<set_empty_string>N</set_empty_string>
<type>Boolean</type>
</field>
</fields>
<attributes/>
<GUI>
<xloc>768</xloc>
<yloc>576</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 = ?
WHERE job_name = '${JOB_NAME}'
and recruitment_id = '${IDM_ID}';
</sql>
<attributes/>
<GUI>
<xloc>944</xloc>
<yloc>736</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>Y</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 = 'SUCCESS'
WHERE job_name = '${JOB_NAME}'
and recruitment_id = '${IDM_ID}'
and status = 'PROCESSING';
</sql>
<attributes/>
<GUI>
<xloc>1296</xloc>
<yloc>576</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>INSERT INTO etl.job_execution (
id,
job_name,
status,
execution_datetime,
error_description,
recruitment_id
)
VALUES (
DEFAULT,
'${JOB_NAME}',
'PROCESSING',
DEFAULT,
NULL,
'${IDM_ID}'
)
ON CONFLICT (job_name, recruitment_id)
DO UPDATE SET
status = 'PROCESSING',
execution_datetime = DEFAULT,
error_description = NULL;</sql>
<attributes/>
<GUI>
<xloc>176</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>1296</xloc>
<yloc>944</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>1088</xloc>
<yloc>576</yloc>
</GUI>
</transform>
<transform>
<name>Group by</name>
<type>GroupBy</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<add_linenr>N</add_linenr>
<all_rows>N</all_rows>
<directory>${java.io.tmpdir}</directory>
<fields>
</fields>
<give_back_row>N</give_back_row>
<group>
<field>
<name>recruit_id</name>
</field>
</group>
<ignore_aggregate>N</ignore_aggregate>
<prefix>grp</prefix>
<attributes/>
<GUI>
<xloc>768</xloc>
<yloc>800</yloc>
</GUI>
</transform>
<transform>
<name>Identify last row in a stream</name>
<type>DetectLastRow</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<resultfieldname>last_row</resultfieldname>
<attributes/>
<GUI>
<xloc>768</xloc>
<yloc>704</yloc>
</GUI>
</transform>
<transform>
<name>Insert / update</name>
<type>InsertUpdate</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<key>
<condition>=</condition>
<field>prosecution_external_id</field>
<name>prosecution_external_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>prosecution</table>
<value>
<name>recruit_id</name>
<rename>recruit_id</rename>
<update>N</update>
</value>
<value>
<name>prosecution_external_id</name>
<rename>prosecution_external_id</rename>
<update>N</update>
</value>
<value>
<name>uk_name</name>
<rename>uk_name</rename>
<update>Y</update>
</value>
<value>
<name>case_number</name>
<rename>case_number</rename>
<update>Y</update>
</value>
<value>
<name>reclassification</name>
<rename>reclassification</rename>
<update>Y</update>
</value>
<value>
<name>kind</name>
<rename>kind</rename>
<update>Y</update>
</value>
<value>
<name>transfer_to_court</name>
<rename>transfer_to_court</rename>
<update>Y</update>
</value>
<value>
<name>court_name</name>
<rename>court_name</rename>
<update>Y</update>
</value>
<value>
<name>case_number_court</name>
<rename>case_number_court</rename>
<update>Y</update>
</value>
<value>
<name>law_point</name>
<rename>law_point</rename>
<update>Y</update>
</value>
<value>
<name>authority_name</name>
<rename>authority_name</rename>
<update>Y</update>
</value>
<value>
<name>conviction_removal_basis</name>
<rename>conviction_removal_basis</rename>
<update>Y</update>
</value>
<value>
<name>conviction_removal_date</name>
<rename>conviction_removal_date</rename>
<update>Y</update>
</value>
<value>
<name>conviction_date</name>
<rename>conviction_date</rename>
<update>Y</update>
</value>
<value>
<name>create_date</name>
<rename>create_date</rename>
<update>Y</update>
</value>
<value>
<name>termination_basis</name>
<rename>termination_basis</rename>
<update>Y</update>
</value>
<value>
<name>conviction_status</name>
<rename>conviction_status</rename>
<update>Y</update>
</value>
<value>
<name>close_date</name>
<rename>close_date</rename>
<update>Y</update>
</value>
<value>
<name>sled_sud_tekst_sved_tekst</name>
<rename>sled_sud_tekst_sved_tekst</rename>
<update>Y</update>
</value>
<value>
<name>sled_sud_tekst_status_naim</name>
<rename>sled_sud_tekst_status_naim</rename>
<update>Y</update>
</value>
<value>
<name>type_info</name>
<rename>type_info</rename>
<update>Y</update>
</value>
</lookup>
<update_bypassed>N</update_bypassed>
<attributes/>
<GUI>
<xloc>768</xloc>
<yloc>944</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/>
<sql>WITH
ugolov_presl AS (
SELECT
jsonb_array_elements(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') AS up,
ri.recruit_id
FROM ervu_dashboard.recruits_info ri
JOIN ervu_dashboard.citizen r ON r.recruit_id = ri.recruit_id
AND '${IDM_ID}' != '' -- Проверка на пустую строку
AND COALESCE(ri.current_recruitment_id, ri.target_recruitment_id) = '${IDM_ID}'
AND '${M_R_CR_DATE}'::timestamp >= ri.created_at
WHERE jsonb_typeof(ri.info->'svedFL'->'svedUgolovPresl'->'faktyUgolovPresl') = 'array'
)
SELECT
r.recruit_id AS recruit_id,
(up->>'id')::uuid AS prosecution_external_id,
NULLIF(up->'sledSud'->>'uk', '') AS uk_name,
NULLIF(up->'sledSud'->'extend'->>'nomerUDPredv', '') AS case_number,
NULLIF(up->'sledSud'->'extend'->>'svedPerekvalif', '') AS reclassification,
NULLIF(up->'sledSud'->'extend'->>'naimVidUgolovPresl', '') AS kind,
CASE
WHEN up->'sledSud'->'extend'->>'priznakPeredachSud' = '1' THEN true
ELSE false -- нет или нет инфы
END AS transfer_to_court,
NULLIF(up->'sledSud'->>'naimSud','') AS court_name,
NULLIF(up->'sledSud'->>'nomerUD','') AS case_number_court,
STRING_AGG(TRIM(BOTH ' "' FROM law.f), ', ') AS law_point,
NULLIF(up->'sledSud'->>'naimOrgan', '') AS authority_name,
NULLIF(up->'sledSud'->'svedSnyat'->>'osnSnyatSud', '') AS conviction_removal_basis,
TO_DATE(up->'sledSud'->'svedSnyat'->>'dataSnyatSud', 'YYYY-MM-DD') AS conviction_removal_date,
TO_DATE(up->'sledSud'->>'dataOsuzhd', 'YYYY-MM-DD') AS conviction_date,
TO_DATE(up->'sledSud'->>'dataVozbUD', 'YYYY-MM-DD') AS create_date,
NULLIF(up->'sledSud'->>'osnPrekrUD', '') AS termination_basis,
NULLIF(up->'sledSud'->>'statusNaim', '') AS conviction_status,
TO_DATE(up->'sledSud'->>'dataPrekrUD', 'YYYY-MM-DD') AS close_date,
NULLIF(up->'sledSudTekst'->>'svedTekst' , '') AS sled_sud_tekst_sved_tekst,
NULLIF(up->'sledSudTekst'->>'statusNaim', '') AS sled_sud_tekst_status_naim,
CASE
WHEN (up->>'sledSud') IS NOT NULL AND up->>'sledSud' != 'null' THEN 'Сведения о фактах уголовного преследования или судимости в структурированном формате'
WHEN (up->>'sledSudTekst') IS NOT NULL AND up->>'sledSudTekst' != 'null' THEN 'Сведения о фактах уголовного преследования или судимости в текстовом виде'
ELSE 'Есть сведения о фактах уголовного преследования или судимости без указания подробностей'
END AS type_info
FROM ervu_dashboard.citizen r
JOIN ugolov_presl up ON r.recruit_id = up.recruit_id
LEFT JOIN LATERAL jsonb_array_elements_text(up->'sledSud'->'statiUK') AS law(f) ON true
GROUP BY r.recruit_id, up;</sql>
<variables_active>Y</variables_active>
<attributes/>
<GUI>
<xloc>416</xloc>
<yloc>944</yloc>
</GUI>
</transform>
<transform>
<name>Update</name>
<type>Update</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>100</commit>
<connection>ervu-dashboard</connection>
<error_ignored>N</error_ignored>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen</table>
<value>
<name>has_criminal_prosecution</name>
<rename>has_criminal_prosecution</rename>
</value>
</lookup>
<skip_lookup>N</skip_lookup>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>976</xloc>
<yloc>576</yloc>
</GUI>
</transform>
<transform_error_handling>
<error>
<source_transform>Insert / update</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>error_code</codes_valuename>
<max_errors/>
<max_pct_errors/>
<min_pct_rows/>
</error>
<error>
<source_transform>Update</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>error_code</codes_valuename>
<max_errors/>
<max_pct_errors/>
<min_pct_rows/>
</error>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,364 @@
<?xml version="1.0" encoding="UTF-8"?>
<workflow>
<name>prosecution_job</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<workflow_version/>
<workflow_status>0</workflow_status>
<created_user>-</created_user>
<created_date>2025/08/05 12:45:28.561</created_date>
<modified_user>-</modified_user>
<modified_date>2025/08/05 12:45:28.561</modified_date>
<parameters>
<parameter>
<name>COMMENT</name>
<default_value> </default_value>
<description/>
</parameter>
<parameter>
<name>LIMIT_FW</name>
<default_value>;</default_value>
<description/>
</parameter>
<parameter>
<name>M_R_CR_DATE</name>
<default_value>3001-01-01 00:00:00</default_value>
<description/>
</parameter>
<parameter>
<name>M_R_UP_DATE</name>
<default_value>0001-01-01 00:00:00</default_value>
<description/>
</parameter>
</parameters>
<actions>
<action>
<name>Start</name>
<description/>
<type>SPECIAL</type>
<attributes/>
<DayOfMonth>1</DayOfMonth>
<hour>12</hour>
<intervalMinutes>60</intervalMinutes>
<intervalSeconds>0</intervalSeconds>
<minutes>0</minutes>
<repeat>N</repeat>
<schedulerType>0</schedulerType>
<weekDay>1</weekDay>
<parallel>N</parallel>
<xloc>224</xloc>
<yloc>304</yloc>
<attributes_hac/>
</action>
<action>
<name>check_if_prosecution_job_exists.hpl</name>
<description/>
<type>PIPELINE</type>
<attributes/>
<add_date>N</add_date>
<add_time>N</add_time>
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/checkpoints/check_if_prosecution_job_exists.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
<parallel>N</parallel>
<xloc>416</xloc>
<yloc>304</yloc>
<attributes_hac/>
</action>
<action>
<name>prosecution_job_exists_check</name>
<description/>
<type>SIMPLE_EVAL</type>
<attributes/>
<fieldtype>boolean</fieldtype>
<successbooleancondition>false</successbooleancondition>
<successcondition>equal</successcondition>
<successnumbercondition>equal</successnumbercondition>
<successwhenvarset>N</successwhenvarset>
<valuetype>variable</valuetype>
<variablename>JOB_EXECUTED_FLAG</variablename>
<parallel>N</parallel>
<xloc>688</xloc>
<yloc>304</yloc>
<attributes_hac/>
</action>
<action>
<name>recruitments_five_flow.hpl</name>
<description/>
<type>PIPELINE</type>
<attributes/>
<add_date>N</add_date>
<add_time>N</add_time>
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/recruitments_five_flow.hpl</filename>
<loglevel>Basic</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
<parallel>Y</parallel>
<xloc>928</xloc>
<yloc>304</yloc>
<attributes_hac/>
</action>
<action>
<name>recruitment_five_flow_on_error.hpl</name>
<description/>
<type>PIPELINE</type>
<attributes/>
<add_date>N</add_date>
<add_time>N</add_time>
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/recruitment_five_flow_on_error.hpl</filename>
<logext/>
<logfile/>
<loglevel>Basic</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
<parallel>N</parallel>
<xloc>928</xloc>
<yloc>608</yloc>
<attributes_hac/>
</action>
<action>
<name>check_if_need_to_repeat_job.hpl</name>
<description/>
<type>PIPELINE</type>
<attributes/>
<add_date>N</add_date>
<add_time>N</add_time>
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/check_if_need_to_repeat_job.hpl</filename>
<logext/>
<logfile/>
<loglevel>Basic</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
<parallel>N</parallel>
<xloc>688</xloc>
<yloc>464</yloc>
<attributes_hac/>
</action>
<action>
<name>Simple evaluation</name>
<description/>
<type>SIMPLE_EVAL</type>
<attributes/>
<fieldtype>boolean</fieldtype>
<successbooleancondition>true</successbooleancondition>
<successcondition>equal</successcondition>
<successnumbercondition>equal</successnumbercondition>
<successwhenvarset>N</successwhenvarset>
<valuetype>variable</valuetype>
<variablename>NEED_TO_REPEAT_JOB</variablename>
<parallel>N</parallel>
<xloc>688</xloc>
<yloc>608</yloc>
<attributes_hac/>
</action>
<action>
<name>recruitment_five_flow_delta.hpl</name>
<description/>
<type>PIPELINE</type>
<attributes/>
<add_date>N</add_date>
<add_time>N</add_time>
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/info_recruits/citizen_tables/prosecution/recruitment_five_flow_delta.hpl</filename>
<logext/>
<logfile/>
<loglevel>Basic</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
<parallel>N</parallel>
<xloc>688</xloc>
<yloc>800</yloc>
<attributes_hac/>
</action>
</actions>
<hops>
<hop>
<from>Start</from>
<to>check_if_prosecution_job_exists.hpl</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>check_if_prosecution_job_exists.hpl</from>
<to>prosecution_job_exists_check</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>prosecution_job_exists_check</from>
<to>recruitments_five_flow.hpl</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>prosecution_job_exists_check</from>
<to>check_if_need_to_repeat_job.hpl</to>
<enabled>Y</enabled>
<evaluation>N</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>check_if_need_to_repeat_job.hpl</from>
<to>Simple evaluation</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>Simple evaluation</from>
<to>recruitment_five_flow_on_error.hpl</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>Simple evaluation</from>
<to>recruitment_five_flow_delta.hpl</to>
<enabled>Y</enabled>
<evaluation>N</evaluation>
<unconditional>N</unconditional>
</hop>
</hops>
<notepads>
<notepad>
<backgroundcolorblue>251</backgroundcolorblue>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorred>201</backgroundcolorred>
<bordercolorblue>90</bordercolorblue>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorred>14</bordercolorred>
<fontbold>N</fontbold>
<fontcolorblue>90</fontcolorblue>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorred>14</fontcolorred>
<fontitalic>N</fontitalic>
<fontsize>-1</fontsize>
<height>26</height>
<xloc>800</xloc>
<yloc>256</yloc>
<note>Первичка</note>
<width>65</width>
</notepad>
<notepad>
<backgroundcolorblue>251</backgroundcolorblue>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorred>201</backgroundcolorred>
<bordercolorblue>90</bordercolorblue>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorred>14</bordercolorred>
<fontbold>N</fontbold>
<fontcolorblue>90</fontcolorblue>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorred>14</fontcolorred>
<fontitalic>N</fontitalic>
<fontsize>-1</fontsize>
<height>26</height>
<xloc>800</xloc>
<yloc>560</yloc>
<note>Повторка</note>
<width>64</width>
</notepad>
<notepad>
<backgroundcolorblue>251</backgroundcolorblue>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorred>201</backgroundcolorred>
<bordercolorblue>90</bordercolorblue>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorred>14</bordercolorred>
<fontbold>N</fontbold>
<fontcolorblue>90</fontcolorblue>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorred>14</fontcolorred>
<fontitalic>N</fontitalic>
<fontsize>-1</fontsize>
<height>26</height>
<xloc>608</xloc>
<yloc>720</yloc>
<note>Дельта</note>
<width>49</width>
</notepad>
<notepad>
<backgroundcolorblue>251</backgroundcolorblue>
<backgroundcolorgreen>232</backgroundcolorgreen>
<backgroundcolorred>201</backgroundcolorred>
<bordercolorblue>90</bordercolorblue>
<bordercolorgreen>58</bordercolorgreen>
<bordercolorred>14</bordercolorred>
<fontbold>N</fontbold>
<fontcolorblue>90</fontcolorblue>
<fontcolorgreen>58</fontcolorgreen>
<fontcolorred>14</fontcolorred>
<fontitalic>N</fontitalic>
<fontname>Segoe UI</fontname>
<fontsize>9</fontsize>
<height>150</height>
<xloc>1200</xloc>
<yloc>80</yloc>
<note>prosecution_job
M_R_UP_DATE
M_R_CR_DATE
0001-01-01 00:00:00
3001-01-01 00:00:00</note>
<width>114</width>
</notepad>
</notepads>
<attributes/>
</workflow>

View file

@ -0,0 +1,360 @@
<?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>Table input</from>
<to>prosecution_flow_delta.hpl</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>prosecution_flow_delta.hpl 2</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>prosecution_flow_delta.hpl 3</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>prosecution_flow_delta.hpl 4</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>prosecution_flow_delta.hpl 5</to>
<enabled>Y</enabled>
</hop>
</order>
<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/>
<sql>SELECT
r.idm_id as recruitment_id
FROM ervu_dashboard.recruitment r
LEFT JOIN etl.job_execution je
ON r.idm_id = je.recruitment_id
and job_name = 'prosecution_job'
where je.status in ('SUCCESS', 'DELTA_ERROR', 'DELTA_SUCCESS', 'DELTA_PROCESSING');</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>352</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_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/prosecution/parallel/prosecution_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>recruitment_id</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>544</xloc>
<yloc>128</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_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/prosecution/parallel/prosecution_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>recruitment_id</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>544</xloc>
<yloc>208</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_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/prosecution/parallel/prosecution_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>recruitment_id</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>544</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_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/prosecution/parallel/prosecution_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>recruitment_id</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>544</xloc>
<yloc>368</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_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/prosecution/parallel/prosecution_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>recruitment_id</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>544</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,360 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>recruitment_five_flow_on_error</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/05 12:54:50.126</created_date>
<modified_user>-</modified_user>
<modified_date>2025/08/05 12:54:50.126</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>prosecution_flow_repeat.hpl</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>prosecution_flow_repeat.hpl 3</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>prosecution_flow_repeat.hpl 2</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>prosecution_flow_repeat.hpl 4</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Table input</from>
<to>prosecution_flow_repeat.hpl 5</to>
<enabled>Y</enabled>
</hop>
</order>
<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/>
<sql>SELECT
r.idm_id as recruitment_id
FROM ervu_dashboard.recruitment r
LEFT JOIN etl.job_execution je
ON r.idm_id = je.recruitment_id
and job_name = 'prosecution_job'
where je.status is null or je.status in('ERROR', 'PROCESSING');</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>272</xloc>
<yloc>368</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_flow_repeat.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/prosecution/parallel/prosecution_flow_repeat.hpl</filename>
<filenameInField>N</filenameInField>
<filenameField/>
<group_size>1</group_size>
<group_field/>
<group_time/>
<parameters>
<variable_mapping>
<variable>IDM_ID</variable>
<field>recruitment_id</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>464</xloc>
<yloc>208</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_flow_repeat.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/prosecution/parallel/prosecution_flow_repeat.hpl</filename>
<filenameInField>N</filenameInField>
<filenameField/>
<group_size>1</group_size>
<group_field/>
<group_time/>
<parameters>
<variable_mapping>
<variable>IDM_ID</variable>
<field>recruitment_id</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>464</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_flow_repeat.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/prosecution/parallel/prosecution_flow_repeat.hpl</filename>
<filenameInField>N</filenameInField>
<filenameField/>
<group_size>1</group_size>
<group_field/>
<group_time/>
<parameters>
<variable_mapping>
<variable>IDM_ID</variable>
<field>recruitment_id</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>464</xloc>
<yloc>368</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_flow_repeat.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/prosecution/parallel/prosecution_flow_repeat.hpl</filename>
<filenameInField>N</filenameInField>
<filenameField/>
<group_size>1</group_size>
<group_field/>
<group_time/>
<parameters>
<variable_mapping>
<variable>IDM_ID</variable>
<field>recruitment_id</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>464</xloc>
<yloc>448</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_flow_repeat.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/prosecution/parallel/prosecution_flow_repeat.hpl</filename>
<filenameInField>N</filenameInField>
<filenameField/>
<group_size>1</group_size>
<group_field/>
<group_time/>
<parameters>
<variable_mapping>
<variable>IDM_ID</variable>
<field>recruitment_id</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>464</xloc>
<yloc>528</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1,261 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>recruitment_rows_five_flow_if_error</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/05/23 14:28:22.572</created_date>
<modified_user>-</modified_user>
<modified_date>2025/05/23 14:28:22.572</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input</from>
<to>Copy rows to result</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Copy rows to result</name>
<type>RowsToResult</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<attributes/>
<GUI>
<xloc>880</xloc>
<yloc>288</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>WITH ordered AS (
SELECT
idm_id,
created_at,
ROW_NUMBER() OVER (ORDER BY created_at) AS rn,
COUNT(*) OVER () AS total_rows
FROM ervu_dashboard.recruitment
),
splitted AS (
SELECT *,
CEIL(total_rows / 5.0) AS part_size,
FLOOR((rn - 1) / CEIL(total_rows / 5.0)) + 1 AS flow_num
FROM ordered
),
flow_ranges AS (
SELECT
flow_num,
MIN(created_at) AS min_date,
MAX(created_at) AS max_date
FROM splitted
GROUP BY flow_num
),
recr_inf AS (
SELECT DISTINCT COALESCE(cit.recruitment_id, cit.target_recruitment_id) AS idm_id
FROM ervu_dashboard.citizen cit
join ervu_dashboard.prosecution ch on ch.recruit_id = cit.recruit_id
),
flow_data AS (
SELECT
fr.flow_num,
ri.idm_id,
(SELECT r.created_at FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
AND r.created_at BETWEEN fr.min_date AND fr.max_date
LIMIT 1) AS created_at
FROM recr_inf ri
CROSS JOIN flow_ranges fr
WHERE EXISTS (
SELECT 1 FROM ervu_dashboard.recruitment r
WHERE r.idm_id = ri.idm_id
)
),
result_ma as (
SELECT
MAX(created_at) FILTER(WHERE flow_num = 1) AS cr_flow1,
(SELECT idm_id FROM flow_data WHERE flow_num = 1 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow1,
MAX(created_at) FILTER(WHERE flow_num = 2) AS cr_flow2,
(SELECT idm_id FROM flow_data WHERE flow_num = 2 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow2,
MAX(created_at) FILTER(WHERE flow_num = 3) AS cr_flow3,
(SELECT idm_id FROM flow_data WHERE flow_num = 3 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow3,
MAX(created_at) FILTER(WHERE flow_num = 4) AS cr_flow4,
(SELECT idm_id FROM flow_data WHERE flow_num = 4 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow4,
MAX(created_at) FILTER(WHERE flow_num = 5) AS cr_flow5,
(SELECT idm_id FROM flow_data WHERE flow_num = 5 ORDER BY created_at DESC NULLS LAST LIMIT 1) AS idm_flow5
FROM flow_data
),
result_max as ( --костыль
SELECT
CASE
WHEN cr_flow1 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow1
END AS cr_flow1,
idm_flow1,
CASE
WHEN cr_flow2 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow2
END AS cr_flow2,
idm_flow2,
CASE
WHEN cr_flow3 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow3
END AS cr_flow3,
idm_flow3,
CASE
WHEN cr_flow4 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow4
END AS cr_flow4,
idm_flow4,
CASE
WHEN cr_flow5 is null THEN '0001-01-01 00:00:00'::timestamp
ELSE cr_flow5
END AS cr_flow5,
idm_flow5
FROM result_ma
),
remains as (
select
CASE
WHEN created_at >= (select cr_flow1 from result_max) and flow_num = 1 THEN created_at
ELSE null
END as cr_flow1,
CASE
WHEN created_at >= (select cr_flow1 from result_max) and flow_num = 1 THEN idm_id
ELSE null
END as idm_flow1,
CASE
WHEN created_at >= (select cr_flow2 from result_max) and flow_num = 2 THEN created_at
ELSE null
END as cr_flow2,
CASE
WHEN created_at >= (select cr_flow2 from result_max) and flow_num = 2 THEN idm_id
ELSE null
END as idm_flow2,
CASE
WHEN created_at >= (select cr_flow3 from result_max) and flow_num = 3 THEN created_at
ELSE null
END as cr_flow3,
CASE
WHEN created_at >= (select cr_flow3 from result_max) and flow_num = 3 THEN idm_id
ELSE null
END as idm_flow3,
CASE
WHEN created_at >= (select cr_flow4 from result_max) and flow_num = 4 THEN created_at
ELSE null
END as cr_flow4,
CASE
WHEN created_at >= (select cr_flow4 from result_max) and flow_num = 4 THEN idm_id
ELSE null
END as idm_flow4,
CASE
WHEN created_at >= (select cr_flow5 from result_max) and flow_num = 5 THEN created_at
ELSE null
END as cr_flow5,
CASE
WHEN created_at >= (select cr_flow5 from result_max) and flow_num = 5 THEN idm_id
ELSE null
END as idm_flow5
from splitted
),
idm1 as (
select
cr_flow1,
idm_flow1
from remains
where cr_flow1 is not null and idm_flow1 is not null
),
idm2 as (
select
cr_flow2,
idm_flow2
from remains
where cr_flow2 is not null and idm_flow2 is not null
),
idm3 as (
select
cr_flow3,
idm_flow3
from remains
where cr_flow3 is not null and idm_flow3 is not null
),
idm4 as (
select
cr_flow4,
idm_flow4
from remains
where cr_flow4 is not null and idm_flow4 is not null
),
idm5 as (
select
cr_flow5,
idm_flow5
from remains
where cr_flow5 is not null and idm_flow5 is not null
)
select
i1.*,
i2.*,
i3.*,
i4.*,
i5.*
FROM
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm1) i1
FULL OUTER JOIN
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm2) i2 ON i1.rn = i2.rn
FULL OUTER JOIN
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm3) i3 ON i1.rn = i3.rn
FULL OUTER JOIN
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm4) i4 ON i1.rn = i4.rn
FULL OUTER JOIN
(SELECT *, ROW_NUMBER() OVER () as rn FROM idm5) i5 ON i1.rn = i5.rn
ORDER BY COALESCE(i1.rn, i2.rn, i3.rn, i4.rn, i5.rn)
limit 2</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>512</xloc>
<yloc>288</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,356 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>recruitments_five_flow</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/04/18 09:48:01.970</created_date>
<modified_user>-</modified_user>
<modified_date>2025/04/18 09:48:01.970</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Get all recruitments ordered by created_date</from>
<to>prosecution_flow.hpl</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Get all recruitments ordered by created_date</from>
<to>prosecution_flow.hpl 2</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Get all recruitments ordered by created_date</from>
<to>prosecution_flow.hpl 3</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Get all recruitments ordered by created_date</from>
<to>prosecution_flow.hpl 4</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>Get all recruitments ordered by created_date</from>
<to>prosecution_flow.hpl 5</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Get all recruitments ordered by created_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/>
<sql>SELECT
idm_id AS recruitment
FROM ervu_dashboard.recruitment;</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>432</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_flow.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/prosecution/parallel/prosecution_flow.hpl</filename>
<filenameInField>N</filenameInField>
<filenameField/>
<group_size>1</group_size>
<group_field/>
<group_time/>
<parameters>
<variable_mapping>
<variable>IDM_ID</variable>
<field>recruitment</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>704</xloc>
<yloc>144</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_flow.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/prosecution/parallel/prosecution_flow.hpl</filename>
<filenameInField>N</filenameInField>
<filenameField/>
<group_size>1</group_size>
<group_field/>
<group_time/>
<parameters>
<variable_mapping>
<variable>IDM_ID</variable>
<field>recruitment</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>704</xloc>
<yloc>224</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_flow.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/prosecution/parallel/prosecution_flow.hpl</filename>
<filenameInField>N</filenameInField>
<filenameField/>
<group_size>1</group_size>
<group_field/>
<group_time/>
<parameters>
<variable_mapping>
<variable>IDM_ID</variable>
<field>recruitment</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>704</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_flow.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/prosecution/parallel/prosecution_flow.hpl</filename>
<filenameInField>N</filenameInField>
<filenameField/>
<group_size>1</group_size>
<group_field/>
<group_time/>
<parameters>
<variable_mapping>
<variable>IDM_ID</variable>
<field>recruitment</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>704</xloc>
<yloc>384</yloc>
</GUI>
</transform>
<transform>
<name>prosecution_flow.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/prosecution/parallel/prosecution_flow.hpl</filename>
<filenameInField>N</filenameInField>
<filenameField/>
<group_size>1</group_size>
<group_field/>
<group_time/>
<parameters>
<variable_mapping>
<variable>IDM_ID</variable>
<field>recruitment</field>
<input/>
</variable_mapping>
<variable_mapping>
<variable>JOB_NAME</variable>
<field/>
<input>prosecution_job</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>704</xloc>
<yloc>464</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>