INSERT INTO `ohrm_external_integration_process` (`name`, `configuration`, `isConsumer`, `enabled`) VALUES
('RealtimeSyncForEmployeeAdd', '{"replacementParameters":{"baseSystemUrl":"Base system url. Ex: redhat.orangehrm.com","baseSystemAdminUserName":"User Name of the admin user in the base system","baseSystemAdminUserPassword":"Password of the admin user in the base system","secondarySystemUrl":"Secondary system url. Ex: payroll.orangehrm.com","secondarySystemAdminUserName":"User Name of the admin user in the secondary system","secondarySystemAdminUserPassword":"Password of the admin user in the secondary system"},"subscribedEvents":["employee_added"],"processCoordinator":"BasicIntegrationProcessCoordinator","dataFlow":[{"name":"KeyMapMediator","properties":{"dataFields":[{"existingFieldName":"new-job-record","alterFieldName":"employee","fieldPath":["data"],"warnAndProceed":true},{"existingFieldName":"employee_number","alterFieldName":"empNumber","fieldPath":["data","employee"],"warnAndProceed":true}]}},{"name":"APIDataFetchMediator","properties":{"oauthConfig":true,"oauthConfigData":{"grantType":"password","client_id":"public_rest_api_client","client_secret":"","scope":"","url":"https://##baseSystemUrl##/index.php/oauth/issueToken","redirect_uri":"","state":"","username":"##baseSystemAdminUserName##","password":"##baseSystemAdminUserPassword##","refresh_token":""},"method":"get","parameters":[{"parameterName":"employeeNumber","fieldName":"empNumber","fieldPath":["data","employee"]}],"parametersDataPath":[],"expectedResponseCode":"200","additionalHeaders":[{"Content-Type":"application/json"}],"dataURl":"https://##baseSystemUrl##/index.php/api/employees/[employeeNumber]?include=JobRecord","aggregatedFieldName":"employeeAPIData","dataConvertConfig":{"from":"json","to":"phpArray"},"aggregatedDataSet":"message"}},{"name":"DataExtractAndAggregateMediator","properties":{"extractions":[{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"firstName"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"firstName","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"lastName"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"lastName","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"employeeId"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"employeeId","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"locationId"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"locationId","fieldPath":["employee"]}}]}},{"name":"DataExtractAndAggregateMediator","properties":{"extractions":[{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"joined_date"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"joined_date","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"probation_end_date"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"probation_end_date","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"date_of_permanency"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"date_of_permanency","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"job_title_id"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"job_title_id","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"employment_status_id"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"employment_status_id","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"job_category_id"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"job_category_id","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"subunit_id"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"subunit_id","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"location_id"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"location_id","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"effective_date"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"effective_date","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"event_name"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"event_name","fieldPath":["jobRecord"]}}]}},{"name":"DataTypeConvertMediator","properties":{"from":"phpArray","to":"json"}},{"name":"APIDataDispatchMediator","properties":{"oauthConfig":true,"oauthConfigData":{"grantType":"password","client_id":"public_rest_api_client","client_secret":"","scope":"","url":"https://##secondarySystemUrl##/index.php/oauth/issueToken","redirect_uri":"","state":"","username":"##secondarySystemAdminUserName##","password":"##secondarySystemAdminUserPassword##","refresh_token":""},"method":"post","dataType":"Json","parameters":[{"parameterName":"employeeNumber","fieldName":"empNumber","fieldPath":["data","employee"]}],"parametersDataPath":[],"dataPath":["employee"],"expectedResponseCode":"201","additionalHeaders":[{"Content-Type":"application/json"}],"dataURl":"https://##secondarySystemUrl##/index.php/api/employees","aggregatedFieldName":"employeeSavedData","dataConvertConfig":{"from":"json","to":"json"},"aggregatedDataSet":"message"}},{"name":"DataTypeConvertMediator","properties":{"from":"phpArray","to":"json"}},{"name":"APIDataDispatchMediator","properties":{"oauthConfig":true,"oauthConfigData":{"grantType":"password","client_id":"public_rest_api_client","client_secret":"","scope":"","url":"https://##secondarySystemUrl##/index.php/oauth/issueToken","redirect_uri":"","state":"","username":"##secondarySystemAdminUserName##","password":"##secondarySystemAdminUserPassword##","refresh_token":""},"method":"patch","dataType":"Json","parameters":[{"parameterName":"employeeNumber","fieldName":"empNumber","fieldPath":["employeeSavedData","data"]}],"parametersDataPath":[],"dataPath":["jobRecord"],"expectedResponseCode":"200","additionalHeaders":[{"Content-Type":"application/json"}],"dataURl":"https://##secondarySystemUrl##/index.php/api/employees/[employeeNumber]/job","aggregatedFieldName":"jobUpdatedData","dataConvertConfig":{"from":"json","to":"json"},"aggregatedDataSet":"message"}}]}', 1, 1),
('RealtimeSyncForEmployeeUpdate', '{"replacementParameters":{"baseSystemUrl":"Base system url. Ex: redhat.orangehrm.com","baseSystemAdminUserName":"User Name of the admin user in the base system","baseSystemAdminUserPassword":"Password of the admin user in the base system","secondarySystemUrl":"Secondary system url. Ex: payroll.orangehrm.com","secondarySystemAdminUserName":"User Name of the admin user in the secondary system","secondarySystemAdminUserPassword":"Password of the admin user in the secondary system"},"subscribedEvents":["employee_updated","pim.save_job_record"],"processCoordinator":"BasicIntegrationProcessCoordinator","dataFlow":[{"name":"KeyMapMediator","properties":{"dataFields":[{"existingFieldName":"new-job-record","alterFieldName":"employee","fieldPath":["data"],"warnAndProceed":true},{"existingFieldName":"employee_number","alterFieldName":"empNumber","fieldPath":["data","employee"],"warnAndProceed":true}]}},{"name":"APIDataFetchMediator","properties":{"oauthConfig":true,"oauthConfigData":{"grantType":"password","client_id":"public_rest_api_client","client_secret":"","scope":"","url":"https://##baseSystemUrl##/index.php/oauth/issueToken","redirect_uri":"","state":"","username":"##baseSystemAdminUserName##","password":"##baseSystemAdminUserPassword##","refresh_token":""},"method":"get","parameters":[{"parameterName":"employeeNumber","fieldName":"empNumber","fieldPath":["data","employee"]}],"parametersDataPath":[],"expectedResponseCode":"200","additionalHeaders":[{"Content-Type":"application/json"}],"dataURl":"https://##baseSystemUrl##/index.php/api/employees/[employeeNumber]?include=JobRecord","aggregatedFieldName":"employeeAPIData","dataConvertConfig":{"from":"json","to":"phpArray"},"aggregatedDataSet":"message"}},{"name":"DataExtractAndAggregateMediator","properties":{"extractions":[{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"firstName"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"firstName","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"lastName"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"lastName","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"employeeId"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"employeeId","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"emp_dri_lice_exp_date"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"emp_dri_lice_exp_date","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"emp_birthday"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"emp_birthday","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"emp_gender"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"emp_gender","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"emp_marital_status"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"emp_marital_status","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"licenseNo"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"licenseNo","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"middleName"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"middleName","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"nation_code"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"nation_code","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"otherId"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"otherId","fieldPath":["employee"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data"],"fieldName":"ssn"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"ssn","fieldPath":["employee"]}}]}},{"name":"DataExtractAndAggregateMediator","properties":{"extractions":[{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"joined_date"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"joined_date","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"probation_end_date"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"probation_end_date","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"date_of_permanency"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"date_of_permanency","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"job_title_id"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"job_title_id","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"employment_status_id"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"employment_status_id","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"job_category_id"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"job_category_id","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"subunit_id"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"subunit_id","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"location_id"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"location_id","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"effective_date"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"effective_date","fieldPath":["jobRecord"]}},{"arrayListPath":[],"extract":{"fieldPath":["employeeAPIData","data","JobRecord"],"fieldName":"event_name"},"source":{"fieldName":"","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":""},"insert":{"fieldName":"event_name","fieldPath":["jobRecord"]}}]}},{"name":"APIDataFetchMediator","properties":{"oauthConfig":true,"oauthConfigData":{"grantType":"password","client_id":"public_rest_api_client","client_secret":"","scope":"","url":"https://##secondarySystemUrl##/index.php/oauth/issueToken","redirect_uri":"","state":"","username":"##secondarySystemAdminUserName##","password":"##secondarySystemAdminUserPassword##","refresh_token":""},"method":"get","parameters":[{"parameterName":"employeeId","fieldName":"employeeId","fieldPath":["employeeAPIData","data"]}],"parametersDataPath":[],"expectedResponseCode":"200","additionalHeaders":[{"Content-Type":"application/json"}],"dataURl":"https://##secondarySystemUrl##/index.php/api/employees?&filter%5Bid%5D=[employeeId]&fields=empNumber","aggregatedFieldName":"employeeFetchedData","dataConvertConfig":{"from":"json","to":"phpArray"},"aggregatedDataSet":"message"}},{"name":"DataTypeConvertMediator","properties":{"from":"phpArray","to":"json"}},{"name":"APIDataDispatchMediator","properties":{"oauthConfig":true,"oauthConfigData":{"grantType":"password","client_id":"public_rest_api_client","client_secret":"","scope":"","url":"https://##secondarySystemUrl##/index.php/oauth/issueToken","redirect_uri":"","state":"","username":"##secondarySystemAdminUserName##","password":"##secondarySystemAdminUserPassword##","refresh_token":""},"method":"patch","dataType":"Json","parameters":[{"parameterName":"employeeNumber","fieldName":"empNumber","fieldPath":["employeeFetchedData","data","0"]}],"parametersDataPath":[],"dataPath":["employee"],"expectedResponseCode":"200","additionalHeaders":[{"Content-Type":"application/json"}],"dataURl":"https://##secondarySystemUrl##/index.php/api/employees/[employeeNumber]","aggregatedFieldName":"employeeUpdatedData","dataConvertConfig":{"from":"json","to":"json"},"aggregatedDataSet":"message"}},{"name":"DataTypeConvertMediator","properties":{"from":"phpArray","to":"json"}},{"name":"APIDataDispatchMediator","properties":{"oauthConfig":true,"oauthConfigData":{"grantType":"password","client_id":"public_rest_api_client","client_secret":"","scope":"","url":"https://##secondarySystemUrl##/index.php/oauth/issueToken","redirect_uri":"","state":"","username":"##secondarySystemAdminUserName##","password":"##secondarySystemAdminUserPassword##","refresh_token":""},"method":"patch","dataType":"Json","parameters":[{"parameterName":"employeeNumber","fieldName":"empNumber","fieldPath":["employeeFetchedData","data","0"]}],"parametersDataPath":[],"dataPath":["jobRecord"],"expectedResponseCode":"200","additionalHeaders":[{"Content-Type":"application/json"}],"dataURl":"https://##secondarySystemUrl##/index.php/api/employees/[employeeNumber]/job","aggregatedFieldName":"jobUpdatedData","dataConvertConfig":{"from":"json","to":"json"},"aggregatedDataSet":"message"}}]}', 1, 1),
('CSVDataImport', '{"replacementParameters":{"adminusername":"User Name of the admin","adminuserpassword":"Password of the admin"},"subscribedEvents":[],"processCoordinator":"BasicIntegrationProcessCoordinator","dataFlow":[{"name":"DataTypeConvertMediator","properties":{"from":"csv","to":"phpArray"}},{"name":"BulkDataProcessMediator","properties":{"arrayPath":[],"iterativeVariables":[],"mediators":[{"name":"APIDataFetchMediator","properties":{"oauthConfig":true,"oauthConfigData":{"grantType":"password","client_id":"public_rest_api_client","client_secret":"","scope":"","url":"https://[systemURL]/index.php/oauth/issueToken","redirect_uri":"","state":"","username":"##adminusername##","password":"##adminuserpassword##","refresh_token":""},"method":"get","parameters":[{"parameterName":"location","fieldName":"Job-Location","fieldPath":[]}],"parametersDataPath":[],"expectedResponseCode":"200","additionalHeaders":[{"Content-Type":"application/json"}],"dataURl":"https://[systemURL]/index.php/api/locations?&filter%5Bname%5D=[location]","aggregatedFieldName":"locationFetchedData","dataConvertConfig":{"from":"json","to":"phpArray"},"aggregatedDataSet":"message"}},{"name":"DataAggregateMediator","properties":{"aggregations":[{"aggregateFields":[{"fieldName":"Personal-Employee First Name","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"firstName","fieldPath":["employee"]}},{"aggregateFields":[{"fieldName":"Personal-Employee Last Name","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"lastName","fieldPath":["employee"]}},{"aggregateFields":[{"fieldName":"Personal-Employee Id","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"employeeId","fieldPath":["employee"]}},{"aggregateFields":[{"fieldName":"id","fieldPath":["locationFetchedData","data","0"],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"locationId","fieldPath":["employee"]}}]}},{"name":"DataTypeConvertMediator","properties":{"from":"phpArray","to":"json"}},{"name":"APIDataDispatchMediator","properties":{"oauthConfig":true,"oauthConfigData":{"grantType":"password","client_id":"public_rest_api_client","client_secret":"","scope":"","url":"https://[systemURL]/index.php/oauth/issueToken","redirect_uri":"","state":"","username":"##adminusername##","password":"##adminuserpassword##","refresh_token":""},"method":"post","dataType":"Json","parameters":[],"parametersDataPath":[],"dataPath":["employee"],"expectedResponseCode":"201","additionalHeaders":[],"dataURl":"https://[systemURL]/index.php/api/employees","aggregatedFieldName":"employeeSavedData","dataConvertConfig":{"from":"json","to":"json"},"aggregatedDataSet":"message"}},{"name":"DataAggregateMediator","properties":{"aggregations":[{"aggregateFields":[{"fieldName":"empNumber","fieldPath":["employeeSavedData","data"],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"emp_number","fieldPath":["jobRecord"]}},{"aggregateFields":[{"fieldName":"id","fieldPath":["locationFetchedData","data","0"],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"location_id","fieldPath":["jobRecord"]}}]}},{"name":"APIDataFetchMediator","properties":{"oauthConfig":true,"oauthConfigData":{"grantType":"password","client_id":"public_rest_api_client","client_secret":"","scope":"","url":"https://[systemURL]/index.php/oauth/issueToken","redirect_uri":"","state":"","username":"##adminusername##","password":"##adminuserpassword##","refresh_token":""},"method":"get","parameters":[],"parametersDataPath":[],"expectedResponseCode":"200","additionalHeaders":[{"Content-Type":"application/json"}],"dataURl":"https://[systemURL]/index.php/api/jobTitles","aggregatedFieldName":"jobTitleFetchedData","dataConvertConfig":{"from":"json","to":"phpArray"},"aggregatedDataSet":"message"}},{"name":"DataExtractAndAggregateMediator","properties":{"extractions":[{"arrayListPath":["jobTitleFetchedData","data"],"extract":{"fieldPath":[],"fieldName":"id"},"source":{"fieldName":"Job-Job Title","fieldPath":[],"value":""},"search":{"fieldPath":[],"fieldName":"jobTitleName"},"insert":{"fieldName":"job_title_id","fieldPath":["jobRecord"]}}]}},{"name":"DataTypeConvertMediator","properties":{"from":"phpArray","to":"json"}},{"name":"APIDataDispatchMediator","properties":{"oauthConfig":true,"oauthConfigData":{"grantType":"password","client_id":"public_rest_api_client","client_secret":"","scope":"","url":"https://[systemURL]/index.php/oauth/issueToken","redirect_uri":"","state":"","username":"##adminusername##","password":"##adminuserpassword##","refresh_token":""},"method":"patch","dataType":"Json","parameters":[{"parameterName":"employeeNumber","fieldName":"empNumber","fieldPath":["employeeSavedData","data"]}],"parametersDataPath":[],"dataPath":["jobRecord"],"expectedResponseCode":"200","additionalHeaders":[{"Content-Type":"application/json"}],"dataURl":"https://[systemURL]/index.php/api/employees/[employeeNumber]/job","aggregatedFieldName":"jobUpdatedData","dataConvertConfig":{"from":"json","to":"json"},"aggregatedDataSet":"message"}}]}},{"name":"DataTypeConvertMediator","properties":{"from":"phpArray","to":"json"}},{"name":"FileDataDispatchMediator","properties":{"filePath":"/tmp/importedData.txt","flag":""}}]}', 0, 1),
('CSVDataExport', '{"replacementParameters":{"adminusername":"User Name of the admin","adminuserpassword":"Password of the admin"},"subscribedEvents":[],"processCoordinator":"BasicIntegrationProcessCoordinator","dataFlow":[{"name":"APIDataFetchMediator","properties":{"oauthConfig":true,"oauthConfigData":{"grantType":"password","client_id":"public_rest_api_client","client_secret":"","scope":"","url":"https://[systemURL]/index.php/oauth/issueToken","redirect_uri":"","state":"","username":"##adminusername##","password":"##adminuserpassword##","refresh_token":""},"method":"get","parameters":[],"parametersDataPath":[],"expectedResponseCode":"200","additionalHeaders":[],"dataURl":"https://[systemURL]/index.php/api/exportReportData/uniqueName/pim.Employee_Salary_Report/format/csv/culture/en","aggregatedFieldName":"","dataConvertConfig":{"from":"csv","to":"phpArray"},"aggregatedDataSet":"message"}},{"name":"BulkDataProcessMediator","properties":{"arrayPath":[],"iterativeVariables":[],"mediators":[{"name":"DataAggregateMediator","properties":{"aggregations":[{"aggregateFields":[{"fieldName":"Personal-Employee Last Name","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"lastName","fieldPath":[]}},{"aggregateFields":[{"fieldName":"Personal-Employee First Name","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"firstName","fieldPath":[]}},{"aggregateFields":[{"fieldName":"Job-Job Title","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"Job Title","fieldPath":[]}},{"aggregateFields":[{"fieldName":"Job-Employment Status","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"Employment Status","fieldPath":[]}},{"aggregateFields":[{"fieldName":"Job-Joined Date","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"Joined Date","fieldPath":[]}},{"aggregateFields":[{"fieldName":"Job-Sub Unit","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"Sub Unit","fieldPath":[]}},{"aggregateFields":[{"fieldName":"Job-Location","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"Location","fieldPath":[]}},{"aggregateFields":[{"fieldName":"Salary-Pay Grade","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"Pay Gread","fieldPath":[]}},{"aggregateFields":[{"fieldName":"Salary-Currency","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"Currency","fieldPath":[]}},{"aggregateFields":[{"fieldName":"Salary-Effective Date","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"Effective Date","fieldPath":[]}},{"aggregateFields":[{"fieldName":"Salary-All Earnings/Deductions","fieldPath":[],"removeField":false,"value":""}],"separator":" ","aggregatedField":{"fieldName":"All Earnings/Deductions","fieldPath":[]}}]}},{"name":"DataFilterMediator","properties":{"filterType":"include","dataFields":[{"fieldName":"firstName","fieldPath":[]},{"fieldName":"lastName","fieldPath":[]},{"fieldName":"Job Title","fieldPath":[]},{"fieldName":"Employment Status","fieldPath":[]},{"fieldName":"Joined Date","fieldPath":[]},{"fieldName":"Sub Unit","fieldPath":[]},{"fieldName":"Location","fieldPath":[]},{"fieldName":"Pay Gread","fieldPath":[]},{"fieldName":"Currency","fieldPath":[]},{"fieldName":"Effective Date","fieldPath":[]},{"fieldName":"All Earnings/Deductions","fieldPath":[]}]}}]}},{"name":"DataTypeConvertMediator","properties":{"from":"phpArray","to":"json"}},{"name":"FileDataDispatchMediator","properties":{"filePath":"/tmp/reportData.json","flag":""}}]}',0, 1);

SET @integration_queue_consumer_id = (SELECT `id` FROM `ohrm_external_data_queue_consumer` WHERE `name`='Integration queue consumer');
SET @add_employee_integration_id = (SELECT `id` FROM `ohrm_external_integration_process` WHERE `name`='RealtimeSyncForEmployeeAdd');

SET @update_employee_integration_id = (SELECT `id` FROM `ohrm_external_integration_process` WHERE `name`='RealtimeSyncForEmployeeUpdate');

INSERT INTO `ohrm_integration_process_queue_consumer` (`consumer_id`, `integration_id`) VALUES(@integration_queue_consumer_id, @add_employee_integration_id);

INSERT INTO `ohrm_integration_process_queue_consumer` (`consumer_id`, `integration_id`) VALUES(@integration_queue_consumer_id, @update_employee_integration_id);

