{
	"ProcessTemplates": [
		{
			"Name": "MicrosoftSQL to Oracle -  Changes synchronization",
			"Modified": "2024-07-24T07:29:06.5592994",
			"Modifier": "janne.pennanen@frends.com",
			"Tags": [
				"Oracle",
				"MicrosoftSQL"
			],
			"TemplateProcessTags": [],
			"Description": "This template process queries a MicrosoftSQL database to find new or updated rows in a specified table, and then either inserts or updates the corresponding rows into a table in an Oracle database in chunks.",
			"Version": 1,
			"UniqueIdentifier": "6bf9cc4d-13a6-4524-a412-682ea8238167",
			"ProcessVariablesJson": "{\"OracleConnectionString\":{\"Value\":\"\\\"Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)));User Id=myUsername;Password=myPassword;\\\"\",\"IsSecret\":true,\"Mode\":\"text\",\"Description\":\"The connection string for the Oracle database.\"},\"OracleSchema\":{\"Value\":\"\\\"MY_SCHEMA\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"The name of the schema under which the destination table is located in Oracle.\"},\"OracleStagingTableName\":{\"Value\":\"\\\"myTable_staging\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"The name of the staging table on Oracle, into which rows will be inserted before merging to the destination table.\"},\"OracleTableName\":{\"Value\":\"\\\"myTable\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"The name of the destination table in Oracle.\"},\"MicrosoftSqlTableName\":{\"Value\":\"\\\"myTable\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"The name of the source table in MicrosoftSQL.\"},\"MicrosoftSqlConnectionString\":{\"Value\":\"\\\"Server=myServerAddress;Database=myDataBase;Trusted_Connection=True;\\\"\",\"IsSecret\":true,\"Mode\":\"text\",\"Description\":\"The connection string for the MicrosoftSQL database.\"},\"TimestampColumn\":{\"Value\":\"\\\"updated_time\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"The name of the column in both tables, where the value of the timestamp is stored.\"},\"IdentifierColumn\":{\"Value\":\"\\\"id\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"The name of the column, in both MicrosoftSQL and Oracle, whose values should be used for identifying whether or not a row already exists in the Oracle table. This column should also be included in the ColumnNames process variable.\"},\"ColumnNames\":{\"Value\":\"\\\"id, email, address1, address2\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"The names of the columns that should be handled, separated with a comma and a space. For example: firstname, lastname, title\\n\\nThe names of the columns should be identical in both MicrosoftSQL and Oracle.\"},\"ChunkSize\":{\"Value\":\"50\",\"IsSecret\":false,\"Mode\":\"integer\",\"Description\":\"The number of rows that should be processed in one iteration.\"}}",
			"ProcessInfo": {
				"Process": {
					"Name": "MicrosoftSQL to Oracle -  Changes synchronization",
					"Modified": "2024-07-24T07:29:06.5592994",
					"Modifier": "janne.pennanen@frends.com",
					"TagString": null,
					"Tags": [],
					"Description": "This template process queries a MicrosoftSQL database to find new or updated rows in a specified table, and then either inserts or updates the corresponding rows into a table in an Oracle database in chunks.",
					"Version": 1,
					"UniqueIdentifier": "08cc6c4c-7e88-4b33-8f64-ec5f7bd1f24c",
					"GraphJson": null,
					"Bpmn": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<bpmn2:definitions xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:bpmn2=\"http://www.omg.org/spec/BPMN/20100524/MODEL\" xmlns:bpmndi=\"http://www.omg.org/spec/BPMN/20100524/DI\" xmlns:dc=\"http://www.omg.org/spec/DD/20100524/DC\" xmlns:di=\"http://www.omg.org/spec/DD/20100524/DI\" id=\"sample-diagram\" targetNamespace=\"http://bpmn.io/schema/bpmn\" xsi:schemaLocation=\"http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd\"><bpmn2:process id=\"Process_1\" isExecutable=\"false\"><bpmn2:startEvent id=\"StartEvent_1\" name=\"Manual\"><bpmn2:outgoing>Flow_0dpnip5</bpmn2:outgoing></bpmn2:startEvent><bpmn2:startEvent id=\"Event_0f5myku\" name=\"Schedule\"><bpmn2:outgoing>Flow_0smk0gz</bpmn2:outgoing></bpmn2:startEvent><bpmn2:businessRuleTask id=\"Activity_17vxu0s\" name=\"Get previous sync time from cache\"><bpmn2:incoming>Flow_0dpnip5</bpmn2:incoming><bpmn2:incoming>Flow_0smk0gz</bpmn2:incoming><bpmn2:outgoing>Flow_0o425xh</bpmn2:outgoing></bpmn2:businessRuleTask><bpmn2:sequenceFlow id=\"Flow_0dpnip5\" sourceRef=\"StartEvent_1\" targetRef=\"Activity_17vxu0s\" /><bpmn2:sequenceFlow id=\"Flow_0smk0gz\" sourceRef=\"Event_0f5myku\" targetRef=\"Activity_17vxu0s\" /><bpmn2:exclusiveGateway id=\"Gateway_0zpa7zy\" name=\"Previous sync time present?\" default=\"Flow_0ckrotq\"><bpmn2:incoming>Flow_0o425xh</bpmn2:incoming><bpmn2:outgoing>Flow_0ckrotq</bpmn2:outgoing><bpmn2:outgoing>Flow_0cacn6r</bpmn2:outgoing></bpmn2:exclusiveGateway><bpmn2:sequenceFlow id=\"Flow_0o425xh\" sourceRef=\"Activity_17vxu0s\" targetRef=\"Gateway_0zpa7zy\" /><bpmn2:scriptTask id=\"Activity_03ue85h\" name=\"Assign previous sync time from cache\"><bpmn2:incoming>Flow_0cacn6r</bpmn2:incoming><bpmn2:outgoing>Flow_01m7okw</bpmn2:outgoing></bpmn2:scriptTask><bpmn2:scriptTask id=\"Activity_0sux2w2\" name=\"Assign default value for previous sync time\"><bpmn2:incoming>Flow_0ckrotq</bpmn2:incoming><bpmn2:outgoing>Flow_0ywfmgk</bpmn2:outgoing></bpmn2:scriptTask><bpmn2:sequenceFlow id=\"Flow_0ckrotq\" name=\"no\" sourceRef=\"Gateway_0zpa7zy\" targetRef=\"Activity_0sux2w2\" /><bpmn2:sequenceFlow id=\"Flow_0cacn6r\" name=\"yes\" sourceRef=\"Gateway_0zpa7zy\" targetRef=\"Activity_03ue85h\" /><bpmn2:task id=\"Activity_1nnddcn\" name=\"Get new or updated rows from MicrosoftSQL\"><bpmn2:incoming>Flow_0ywfmgk</bpmn2:incoming><bpmn2:incoming>Flow_01m7okw</bpmn2:incoming><bpmn2:outgoing>Flow_1i8rumq</bpmn2:outgoing><bpmn2:property id=\"Property_01s5dsw\" name=\"__targetRef_placeholder\" /><bpmn2:dataInputAssociation id=\"DataInputAssociation_1eurx75\"><bpmn2:sourceRef>DataStoreReference_14s0uk1</bpmn2:sourceRef><bpmn2:targetRef>Property_01s5dsw</bpmn2:targetRef></bpmn2:dataInputAssociation></bpmn2:task><bpmn2:sequenceFlow id=\"Flow_0ywfmgk\" sourceRef=\"Activity_0sux2w2\" targetRef=\"Activity_1nnddcn\" /><bpmn2:sequenceFlow id=\"Flow_01m7okw\" sourceRef=\"Activity_03ue85h\" targetRef=\"Activity_1nnddcn\" /><bpmn2:scriptTask id=\"Activity_049di38\" name=\"Create insert statements\"><bpmn2:incoming>Flow_1qtt6l9</bpmn2:incoming><bpmn2:outgoing>Flow_0fgs45g</bpmn2:outgoing></bpmn2:scriptTask><bpmn2:exclusiveGateway id=\"Gateway_0aaldc4\" name=\"Rows gotten successfully?\" default=\"Flow_1l1ttru\"><bpmn2:incoming>Flow_1i8rumq</bpmn2:incoming><bpmn2:outgoing>Flow_1l1ttru</bpmn2:outgoing><bpmn2:outgoing>Flow_1w0jvn1</bpmn2:outgoing></bpmn2:exclusiveGateway><bpmn2:sequenceFlow id=\"Flow_1i8rumq\" sourceRef=\"Activity_1nnddcn\" targetRef=\"Gateway_0aaldc4\" /><bpmn2:intermediateThrowEvent id=\"Event_1elrcp6\" name=\"Throw exception if rows couldn&#39;t be fetched from MicrosoftSQL\"><bpmn2:incoming>Flow_1l1ttru</bpmn2:incoming><bpmn2:signalEventDefinition /></bpmn2:intermediateThrowEvent><bpmn2:sequenceFlow id=\"Flow_1l1ttru\" name=\"no\" sourceRef=\"Gateway_0aaldc4\" targetRef=\"Event_1elrcp6\" /><bpmn2:subProcess id=\"Activity_0anbcsj\" name=\"Insert data into Oracle staging table in chunks\"><bpmn2:incoming>Flow_1kg7kj3</bpmn2:incoming><bpmn2:outgoing>Flow_145iml9</bpmn2:outgoing><bpmn2:multiInstanceLoopCharacteristics isSequential=\"true\" /><bpmn2:startEvent id=\"Event_1fl1t38\"><bpmn2:outgoing>Flow_0g7gcp2</bpmn2:outgoing></bpmn2:startEvent><bpmn2:task id=\"Activity_1wlprwq\" name=\"Insert chunk into Oracle staging table\"><bpmn2:incoming>Flow_0g7gcp2</bpmn2:incoming><bpmn2:outgoing>Flow_0wv42e5</bpmn2:outgoing><bpmn2:dataOutputAssociation id=\"DataOutputAssociation_11qpkx0\"><bpmn2:targetRef>DataStoreReference_0zlscxx</bpmn2:targetRef></bpmn2:dataOutputAssociation></bpmn2:task><bpmn2:sequenceFlow id=\"Flow_0g7gcp2\" sourceRef=\"Event_1fl1t38\" targetRef=\"Activity_1wlprwq\" /><bpmn2:exclusiveGateway id=\"Gateway_09zyvvr\" name=\"Insertion successful?\" default=\"Flow_1jhcde5\"><bpmn2:incoming>Flow_0wv42e5</bpmn2:incoming><bpmn2:outgoing>Flow_0phsr7w</bpmn2:outgoing><bpmn2:outgoing>Flow_1jhcde5</bpmn2:outgoing></bpmn2:exclusiveGateway><bpmn2:sequenceFlow id=\"Flow_0wv42e5\" sourceRef=\"Activity_1wlprwq\" targetRef=\"Gateway_09zyvvr\" /><bpmn2:endEvent id=\"Event_1imdprg\" name=\"Move to the next chunk\"><bpmn2:incoming>Flow_0phsr7w</bpmn2:incoming></bpmn2:endEvent><bpmn2:sequenceFlow id=\"Flow_0phsr7w\" name=\"yes\" sourceRef=\"Gateway_09zyvvr\" targetRef=\"Event_1imdprg\" /><bpmn2:endEvent id=\"Event_1ddnlz7\" name=\"Add error to error variable and move to the next chunk\"><bpmn2:incoming>Flow_1jhcde5</bpmn2:incoming></bpmn2:endEvent><bpmn2:sequenceFlow id=\"Flow_1jhcde5\" name=\"no\" sourceRef=\"Gateway_09zyvvr\" targetRef=\"Event_1ddnlz7\" /><bpmn2:dataStoreReference id=\"DataStoreReference_0zlscxx\" name=\"Oracle database\" /></bpmn2:subProcess><bpmn2:scriptTask id=\"Activity_0kwzuqz\" name=\"Initialize error variable\"><bpmn2:incoming>Flow_0fgs45g</bpmn2:incoming><bpmn2:outgoing>Flow_1kg7kj3</bpmn2:outgoing></bpmn2:scriptTask><bpmn2:sequenceFlow id=\"Flow_0fgs45g\" sourceRef=\"Activity_049di38\" targetRef=\"Activity_0kwzuqz\" /><bpmn2:sequenceFlow id=\"Flow_1kg7kj3\" sourceRef=\"Activity_0kwzuqz\" targetRef=\"Activity_0anbcsj\" /><bpmn2:task id=\"Activity_0sribv0\" name=\"Merge data from staging table\"><bpmn2:incoming>Flow_1h7gqsr</bpmn2:incoming><bpmn2:outgoing>Flow_13ttcqr</bpmn2:outgoing></bpmn2:task><bpmn2:task id=\"Activity_07ez9qw\" name=\"Clean up staging table\"><bpmn2:incoming>Flow_13ttcqr</bpmn2:incoming><bpmn2:outgoing>Flow_0sartlw</bpmn2:outgoing></bpmn2:task><bpmn2:businessRuleTask id=\"Activity_0tmigfn\" name=\"Update previous sync time in cache\"><bpmn2:incoming>Flow_0txohn4</bpmn2:incoming><bpmn2:outgoing>Flow_1wqui1f</bpmn2:outgoing></bpmn2:businessRuleTask><bpmn2:endEvent id=\"Event_0lqng8a\" name=\"Process complete, return and print potential errors\"><bpmn2:incoming>Flow_1wqui1f</bpmn2:incoming></bpmn2:endEvent><bpmn2:sequenceFlow id=\"Flow_1wqui1f\" sourceRef=\"Activity_0tmigfn\" targetRef=\"Event_0lqng8a\" /><bpmn2:scriptTask id=\"Activity_0ef8l5l\" name=\"Build statements for merging\"><bpmn2:incoming>Flow_145iml9</bpmn2:incoming><bpmn2:outgoing>Flow_1h7gqsr</bpmn2:outgoing></bpmn2:scriptTask><bpmn2:sequenceFlow id=\"Flow_145iml9\" sourceRef=\"Activity_0anbcsj\" targetRef=\"Activity_0ef8l5l\" /><bpmn2:sequenceFlow id=\"Flow_1h7gqsr\" sourceRef=\"Activity_0ef8l5l\" targetRef=\"Activity_0sribv0\" /><bpmn2:exclusiveGateway id=\"Gateway_0gg0hn9\" name=\"Were there any new or updated rows?\" default=\"Flow_09g7mb3\"><bpmn2:incoming>Flow_1w0jvn1</bpmn2:incoming><bpmn2:outgoing>Flow_1qtt6l9</bpmn2:outgoing><bpmn2:outgoing>Flow_09g7mb3</bpmn2:outgoing></bpmn2:exclusiveGateway><bpmn2:sequenceFlow id=\"Flow_1w0jvn1\" name=\"yes\" sourceRef=\"Gateway_0aaldc4\" targetRef=\"Gateway_0gg0hn9\" /><bpmn2:sequenceFlow id=\"Flow_1qtt6l9\" name=\"yes\" sourceRef=\"Gateway_0gg0hn9\" targetRef=\"Activity_049di38\" /><bpmn2:endEvent id=\"Event_058upth\" name=\"Return if no new or updated rows were found\"><bpmn2:incoming>Flow_09g7mb3</bpmn2:incoming></bpmn2:endEvent><bpmn2:sequenceFlow id=\"Flow_09g7mb3\" name=\"no\" sourceRef=\"Gateway_0gg0hn9\" targetRef=\"Event_058upth\" /><bpmn2:exclusiveGateway id=\"Gateway_1q63x1g\" name=\"Merge and cleanup successful?\" default=\"Flow_0x40qax\"><bpmn2:incoming>Flow_0sartlw</bpmn2:incoming><bpmn2:outgoing>Flow_0x40qax</bpmn2:outgoing><bpmn2:outgoing>Flow_0txohn4</bpmn2:outgoing></bpmn2:exclusiveGateway><bpmn2:sequenceFlow id=\"Flow_13ttcqr\" sourceRef=\"Activity_0sribv0\" targetRef=\"Activity_07ez9qw\" /><bpmn2:intermediateThrowEvent id=\"Event_0npu0yg\" name=\"Throw exception if merge or cleanup was not successful\"><bpmn2:incoming>Flow_0x40qax</bpmn2:incoming><bpmn2:signalEventDefinition /></bpmn2:intermediateThrowEvent><bpmn2:sequenceFlow id=\"Flow_0x40qax\" name=\"no\" sourceRef=\"Gateway_1q63x1g\" targetRef=\"Event_0npu0yg\" /><bpmn2:dataStoreReference id=\"DataStoreReference_14s0uk1\" name=\"MicrosoftSQL database\" /><bpmn2:sequenceFlow id=\"Flow_0sartlw\" sourceRef=\"Activity_07ez9qw\" targetRef=\"Gateway_1q63x1g\" /><bpmn2:sequenceFlow id=\"Flow_0txohn4\" name=\"yes\" sourceRef=\"Gateway_1q63x1g\" targetRef=\"Activity_0tmigfn\" /><bpmn2:group id=\"Group_05p17ud\" categoryValueRef=\"CategoryValue_1rt4o2f\" /><bpmn2:group id=\"Group_07vzrwu\" categoryValueRef=\"CategoryValue_1sdd7qy\" /><bpmn2:group id=\"Group_1tf1pww\" categoryValueRef=\"CategoryValue_048nik4\" /><bpmn2:textAnnotation id=\"TextAnnotation_1uklgeq\"><bpmn2:text>Rows that have a timestamp more recent than the previous sync time will be processed.</bpmn2:text></bpmn2:textAnnotation><bpmn2:association id=\"Association_1go2d7c\" sourceRef=\"Activity_17vxu0s\" targetRef=\"TextAnnotation_1uklgeq\" /><bpmn2:textAnnotation id=\"TextAnnotation_1nwfgnl\"><bpmn2:text>The merge compares the identifiers of the rows, and either inserts or updates them based on whether a match is found or not.</bpmn2:text></bpmn2:textAnnotation><bpmn2:association id=\"Association_0vtvc87\" sourceRef=\"Activity_0sribv0\" targetRef=\"TextAnnotation_1nwfgnl\" /><bpmn2:textAnnotation id=\"TextAnnotation_1gz03r7\"><bpmn2:text>The next iteration of the process will use the timestamp to determine which rows are new or updated.</bpmn2:text></bpmn2:textAnnotation><bpmn2:association id=\"Association_1p15ay7\" sourceRef=\"Activity_0tmigfn\" targetRef=\"TextAnnotation_1gz03r7\" /></bpmn2:process><bpmn2:category id=\"Category_14kzg1u\"><bpmn2:categoryValue id=\"CategoryValue_1rt4o2f\" value=\"Get previous sync time\" /></bpmn2:category><bpmn2:category id=\"Category_1ms2qw7\"><bpmn2:categoryValue id=\"CategoryValue_1sdd7qy\" value=\"Fetch data from MicrosoftSQL and create insert statements\" /></bpmn2:category><bpmn2:category id=\"Category_1yj1i9k\"><bpmn2:categoryValue id=\"CategoryValue_048nik4\" value=\"Merge staging table to destination table and cleanup\" /></bpmn2:category><bpmndi:BPMNDiagram id=\"BPMNDiagram_1\"><bpmndi:BPMNPlane id=\"BPMNPlane_1\" bpmnElement=\"Process_1\"><bpmndi:BPMNShape id=\"TextAnnotation_1gz03r7_di\" bpmnElement=\"TextAnnotation_1gz03r7\"><dc:Bounds x=\"3150\" y=\"53\" width=\"120\" height=\"100\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"_BPMNShape_StartEvent_2\" bpmnElement=\"StartEvent_1\"><dc:Bounds x=\"412\" y=\"332\" width=\"36\" height=\"36\" /><bpmndi:BPMNLabel><dc:Bounds x=\"412\" y=\"368\" width=\"37\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Event_0f5myku_di\" bpmnElement=\"Event_0f5myku\"><dc:Bounds x=\"412\" y=\"112\" width=\"36\" height=\"36\" /><bpmndi:BPMNLabel><dc:Bounds x=\"407\" y=\"155\" width=\"47\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Activity_17vxu0s_di\" bpmnElement=\"Activity_17vxu0s\"><dc:Bounds x=\"630\" y=\"200\" width=\"100\" height=\"80\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Gateway_0zpa7zy_di\" bpmnElement=\"Gateway_0zpa7zy\" isMarkerVisible=\"true\"><dc:Bounds x=\"805\" y=\"215\" width=\"50\" height=\"50\" /><bpmndi:BPMNLabel><dc:Bounds x=\"865\" y=\"226\" width=\"70\" height=\"27\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Activity_03ue85h_di\" bpmnElement=\"Activity_03ue85h\"><dc:Bounds x=\"915\" y=\"115\" width=\"30\" height=\"30\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Activity_0sux2w2_di\" bpmnElement=\"Activity_0sux2w2\"><dc:Bounds x=\"915\" y=\"335\" width=\"30\" height=\"30\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Activity_1nnddcn_di\" bpmnElement=\"Activity_1nnddcn\"><dc:Bounds x=\"1110\" y=\"200\" width=\"100\" height=\"80\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Activity_049di38_di\" bpmnElement=\"Activity_049di38\"><dc:Bounds x=\"1560\" y=\"200\" width=\"100\" height=\"80\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Gateway_0aaldc4_di\" bpmnElement=\"Gateway_0aaldc4\" isMarkerVisible=\"true\"><dc:Bounds x=\"1285\" y=\"215\" width=\"50\" height=\"50\" /><bpmndi:BPMNLabel><dc:Bounds x=\"1277\" y=\"176\" width=\"65\" height=\"27\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Event_1elrcp6_di\" bpmnElement=\"Event_1elrcp6\"><dc:Bounds x=\"1292\" y=\"332\" width=\"36\" height=\"36\" /><bpmndi:BPMNLabel><dc:Bounds x=\"1266\" y=\"375\" width=\"89\" height=\"53\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Activity_0tmigfn_di\" bpmnElement=\"Activity_0tmigfn\"><dc:Bounds x=\"3160\" y=\"200\" width=\"100\" height=\"80\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Event_0lqng8a_di\" bpmnElement=\"Event_0lqng8a\"><dc:Bounds x=\"3342\" y=\"222\" width=\"36\" height=\"36\" /><bpmndi:BPMNLabel><dc:Bounds x=\"3316\" y=\"163\" width=\"88\" height=\"53\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Activity_0anbcsj_di\" bpmnElement=\"Activity_0anbcsj\" isExpanded=\"true\"><dc:Bounds x=\"1830\" y=\"0\" width=\"520\" height=\"470\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Event_1fl1t38_di\" bpmnElement=\"Event_1fl1t38\"><dc:Bounds x=\"1870\" y=\"222\" width=\"36\" height=\"36\" /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Activity_1wlprwq_di\" bpmnElement=\"Activity_1wlprwq\"><dc:Bounds x=\"1960\" y=\"200\" width=\"100\" height=\"80\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Gateway_09zyvvr_di\" bpmnElement=\"Gateway_09zyvvr\" isMarkerVisible=\"true\"><dc:Bounds x=\"2135\" y=\"215\" width=\"50\" height=\"50\" /><bpmndi:BPMNLabel><dc:Bounds x=\"2132\" y=\"176\" width=\"57\" height=\"27\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Event_1imdprg_di\" bpmnElement=\"Event_1imdprg\"><dc:Bounds x=\"2262\" y=\"222\" width=\"36\" height=\"36\" /><bpmndi:BPMNLabel><dc:Bounds x=\"2239\" y=\"176\" width=\"83\" height=\"27\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Event_1ddnlz7_di\" bpmnElement=\"Event_1ddnlz7\"><dc:Bounds x=\"2142\" y=\"332\" width=\"36\" height=\"36\" /><bpmndi:BPMNLabel><dc:Bounds x=\"2115\" y=\"375\" width=\"90\" height=\"40\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"DataStoreReference_0zlscxx_di\" bpmnElement=\"DataStoreReference_0zlscxx\"><dc:Bounds x=\"1985\" y=\"95\" width=\"50\" height=\"50\" /><bpmndi:BPMNLabel><dc:Bounds x=\"1969\" y=\"80\" width=\"82\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNEdge id=\"Flow_0g7gcp2_di\" bpmnElement=\"Flow_0g7gcp2\"><di:waypoint x=\"1906\" y=\"240\" /><di:waypoint x=\"1960\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_0wv42e5_di\" bpmnElement=\"Flow_0wv42e5\"><di:waypoint x=\"2060\" y=\"240\" /><di:waypoint x=\"2135\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_0phsr7w_di\" bpmnElement=\"Flow_0phsr7w\"><di:waypoint x=\"2185\" y=\"240\" /><di:waypoint x=\"2262\" y=\"240\" /><bpmndi:BPMNLabel><dc:Bounds x=\"2216\" y=\"222\" width=\"16\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_1jhcde5_di\" bpmnElement=\"Flow_1jhcde5\"><di:waypoint x=\"2160\" y=\"265\" /><di:waypoint x=\"2160\" y=\"332\" /><bpmndi:BPMNLabel><dc:Bounds x=\"2169\" y=\"295\" width=\"13\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNShape id=\"Activity_0kwzuqz_di\" bpmnElement=\"Activity_0kwzuqz\"><dc:Bounds x=\"1735\" y=\"225\" width=\"30\" height=\"30\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Activity_0sribv0_di\" bpmnElement=\"Activity_0sribv0\"><dc:Bounds x=\"2640\" y=\"200\" width=\"100\" height=\"80\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Activity_07ez9qw_di\" bpmnElement=\"Activity_07ez9qw\"><dc:Bounds x=\"2820\" y=\"200\" width=\"100\" height=\"80\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Activity_0ef8l5l_di\" bpmnElement=\"Activity_0ef8l5l\"><dc:Bounds x=\"2430\" y=\"200\" width=\"100\" height=\"80\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Gateway_0gg0hn9_di\" bpmnElement=\"Gateway_0gg0hn9\" isMarkerVisible=\"true\"><dc:Bounds x=\"1415\" y=\"215\" width=\"50\" height=\"50\" /><bpmndi:BPMNLabel><dc:Bounds x=\"1401\" y=\"170\" width=\"77\" height=\"40\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Event_058upth_di\" bpmnElement=\"Event_058upth\"><dc:Bounds x=\"1422\" y=\"332\" width=\"36\" height=\"36\" /><bpmndi:BPMNLabel><dc:Bounds x=\"1400\" y=\"375\" width=\"81\" height=\"40\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Gateway_1q63x1g_di\" bpmnElement=\"Gateway_1q63x1g\" isMarkerVisible=\"true\"><dc:Bounds x=\"3005\" y=\"215\" width=\"50\" height=\"50\" /><bpmndi:BPMNLabel><dc:Bounds x=\"3001\" y=\"170\" width=\"57\" height=\"40\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Event_0npu0yg_di\" bpmnElement=\"Event_0npu0yg\"><dc:Bounds x=\"3012\" y=\"332\" width=\"36\" height=\"36\" /><bpmndi:BPMNLabel><dc:Bounds x=\"2990\" y=\"375\" width=\"81\" height=\"53\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"DataStoreReference_14s0uk1_di\" bpmnElement=\"DataStoreReference_14s0uk1\"><dc:Bounds x=\"1135\" y=\"95\" width=\"50\" height=\"50\" /><bpmndi:BPMNLabel><dc:Bounds x=\"1126\" y=\"65\" width=\"68\" height=\"27\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNEdge id=\"Association_1p15ay7_di\" bpmnElement=\"Association_1p15ay7\"><di:waypoint x=\"3210\" y=\"200\" /><di:waypoint x=\"3210\" y=\"153\" /></bpmndi:BPMNEdge><bpmndi:BPMNShape id=\"Group_05p17ud_di\" bpmnElement=\"Group_05p17ud\"><dc:Bounds x=\"590\" y=\"0\" width=\"460\" height=\"470\" /><bpmndi:BPMNLabel><dc:Bounds x=\"776\" y=\"7\" width=\"90\" height=\"27\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Group_07vzrwu_di\" bpmnElement=\"Group_07vzrwu\"><dc:Bounds x=\"1080\" y=\"0\" width=\"600\" height=\"470\" /><bpmndi:BPMNLabel><dc:Bounds x=\"1337\" y=\"7\" width=\"89\" height=\"53\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Group_1tf1pww_di\" bpmnElement=\"Group_1tf1pww\"><dc:Bounds x=\"2580\" y=\"0\" width=\"530\" height=\"470\" /><bpmndi:BPMNLabel><dc:Bounds x=\"2805\" y=\"7\" width=\"81\" height=\"53\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"TextAnnotation_1uklgeq_di\" bpmnElement=\"TextAnnotation_1uklgeq\"><dc:Bounds x=\"620\" y=\"60\" width=\"130\" height=\"85\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"TextAnnotation_1nwfgnl_di\" bpmnElement=\"TextAnnotation_1nwfgnl\"><dc:Bounds x=\"2615\" y=\"54\" width=\"149.98139343066967\" height=\"98.1041300273961\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNEdge id=\"Flow_0dpnip5_di\" bpmnElement=\"Flow_0dpnip5\"><di:waypoint x=\"448\" y=\"350\" /><di:waypoint x=\"499\" y=\"350\" /><di:waypoint x=\"499\" y=\"240\" /><di:waypoint x=\"630\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_0smk0gz_di\" bpmnElement=\"Flow_0smk0gz\"><di:waypoint x=\"448\" y=\"130\" /><di:waypoint x=\"499\" y=\"130\" /><di:waypoint x=\"499\" y=\"240\" /><di:waypoint x=\"630\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_0o425xh_di\" bpmnElement=\"Flow_0o425xh\"><di:waypoint x=\"730\" y=\"240\" /><di:waypoint x=\"805\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_0ckrotq_di\" bpmnElement=\"Flow_0ckrotq\"><di:waypoint x=\"830\" y=\"265\" /><di:waypoint x=\"830\" y=\"350\" /><di:waypoint x=\"915\" y=\"350\" /><bpmndi:BPMNLabel><dc:Bounds x=\"867\" y=\"332\" width=\"13\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_0cacn6r_di\" bpmnElement=\"Flow_0cacn6r\"><di:waypoint x=\"830\" y=\"215\" /><di:waypoint x=\"830\" y=\"130\" /><di:waypoint x=\"915\" y=\"130\" /><bpmndi:BPMNLabel><dc:Bounds x=\"867\" y=\"112\" width=\"16\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"DataInputAssociation_1eurx75_di\" bpmnElement=\"DataInputAssociation_1eurx75\"><di:waypoint x=\"1160\" y=\"145\" /><di:waypoint x=\"1160\" y=\"200\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_0ywfmgk_di\" bpmnElement=\"Flow_0ywfmgk\"><di:waypoint x=\"945\" y=\"350\" /><di:waypoint x=\"1023\" y=\"350\" /><di:waypoint x=\"1023\" y=\"240\" /><di:waypoint x=\"1110\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_01m7okw_di\" bpmnElement=\"Flow_01m7okw\"><di:waypoint x=\"945\" y=\"130\" /><di:waypoint x=\"1023\" y=\"130\" /><di:waypoint x=\"1023\" y=\"240\" /><di:waypoint x=\"1110\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_1i8rumq_di\" bpmnElement=\"Flow_1i8rumq\"><di:waypoint x=\"1210\" y=\"240\" /><di:waypoint x=\"1285\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_1l1ttru_di\" bpmnElement=\"Flow_1l1ttru\"><di:waypoint x=\"1310\" y=\"265\" /><di:waypoint x=\"1310\" y=\"332\" /><bpmndi:BPMNLabel><dc:Bounds x=\"1319\" y=\"296\" width=\"13\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"DataOutputAssociation_11qpkx0_di\" bpmnElement=\"DataOutputAssociation_11qpkx0\"><di:waypoint x=\"2010\" y=\"200\" /><di:waypoint x=\"2010\" y=\"145\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_0fgs45g_di\" bpmnElement=\"Flow_0fgs45g\"><di:waypoint x=\"1660\" y=\"240\" /><di:waypoint x=\"1735\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_1kg7kj3_di\" bpmnElement=\"Flow_1kg7kj3\"><di:waypoint x=\"1765\" y=\"240\" /><di:waypoint x=\"1830\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_1wqui1f_di\" bpmnElement=\"Flow_1wqui1f\"><di:waypoint x=\"3260\" y=\"240\" /><di:waypoint x=\"3342\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_145iml9_di\" bpmnElement=\"Flow_145iml9\"><di:waypoint x=\"2350\" y=\"240\" /><di:waypoint x=\"2430\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_1h7gqsr_di\" bpmnElement=\"Flow_1h7gqsr\"><di:waypoint x=\"2530\" y=\"240\" /><di:waypoint x=\"2640\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_1w0jvn1_di\" bpmnElement=\"Flow_1w0jvn1\"><di:waypoint x=\"1335\" y=\"240\" /><di:waypoint x=\"1415\" y=\"240\" /><bpmndi:BPMNLabel><dc:Bounds x=\"1367\" y=\"222\" width=\"16\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_1qtt6l9_di\" bpmnElement=\"Flow_1qtt6l9\"><di:waypoint x=\"1465\" y=\"240\" /><di:waypoint x=\"1560\" y=\"240\" /><bpmndi:BPMNLabel><dc:Bounds x=\"1505\" y=\"222\" width=\"16\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_09g7mb3_di\" bpmnElement=\"Flow_09g7mb3\"><di:waypoint x=\"1440\" y=\"265\" /><di:waypoint x=\"1440\" y=\"332\" /><bpmndi:BPMNLabel><dc:Bounds x=\"1449\" y=\"295\" width=\"13\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_13ttcqr_di\" bpmnElement=\"Flow_13ttcqr\"><di:waypoint x=\"2740\" y=\"240\" /><di:waypoint x=\"2820\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_0x40qax_di\" bpmnElement=\"Flow_0x40qax\"><di:waypoint x=\"3030\" y=\"265\" /><di:waypoint x=\"3030\" y=\"332\" /><bpmndi:BPMNLabel><dc:Bounds x=\"3039\" y=\"283\" width=\"13\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_0sartlw_di\" bpmnElement=\"Flow_0sartlw\"><di:waypoint x=\"2920\" y=\"240\" /><di:waypoint x=\"3005\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_0txohn4_di\" bpmnElement=\"Flow_0txohn4\"><di:waypoint x=\"3055\" y=\"240\" /><di:waypoint x=\"3160\" y=\"240\" /><bpmndi:BPMNLabel><dc:Bounds x=\"3082\" y=\"222\" width=\"16\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Association_1go2d7c_di\" bpmnElement=\"Association_1go2d7c\"><di:waypoint x=\"680\" y=\"200\" /><di:waypoint x=\"680\" y=\"145\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Association_0vtvc87_di\" bpmnElement=\"Association_0vtvc87\"><di:waypoint x=\"2690\" y=\"200\" /><di:waypoint x=\"2690\" y=\"153\" /></bpmndi:BPMNEdge></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn2:definitions>",
					"ElementParameters": "[{\"Id\":\"StartEvent_1\",\"Type\":0,\"Parameters\":{},\"SelectedTypeId\":\"ManualTrigger\",\"PromoteResultAs\":null,\"Name\":\"Manual\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Event_0f5myku\",\"Type\":0,\"Parameters\":{\"startTimeMinute\":\"00\",\"startTimeHour\":\"00\",\"endTimeMinute\":\"00\",\"endTimeHour\":\"00\",\"endTime\":\"00:00\",\"startTime\":\"00:00\",\"recurring\":true,\"repeatDelay\":1,\"repeatDelaySeconds\":3600,\"limitToOneConcurrentExecution\":true,\"cycleRecurEvery\":1,\"cycleType\":\"Daily\",\"cycleLength\":1,\"seasonStartDate\":\"2024-07-16\",\"seasonEndDate\":null,\"cycleDaysOfWeek\":\"None\",\"cycleMonths\":\"None\",\"cycleDaysString\":\"\",\"cycleDayRanks\":\"None\",\"monthlyCycleType\":\"OnDays\",\"repeatDelayType\":3600,\"timeZone\":\"FLE Standard Time\"},\"SelectedTypeId\":\"ScheduleTrigger\",\"PromoteResultAs\":null,\"Name\":\"Schedule\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_17vxu0s\",\"Type\":20,\"Parameters\":{\"keyExpression\":{\"mode\":\"text\",\"value\":\"previousSyncTime\"},\"valueExpression\":{\"mode\":\"csharp\",\"value\":\"\"},\"ttlValue\":{\"mode\":\"integer\",\"value\":60},\"ttlMultiplier\":60,\"throwIfFalse\":false,\"isGlobalScope\":true},\"SelectedTypeId\":\"TryGetValue\",\"PromoteResultAs\":null,\"Name\":\"Get previous sync time from cache\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Gateway_0zpa7zy\",\"Type\":2,\"Parameters\":{\"expression\":{\"mode\":\"csharp\",\"value\":\"#result.Value != null\"}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Previous sync time present?\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_03ue85h\",\"Type\":12,\"Parameters\":{\"variableName\":\"previousSyncTime\",\"variableExpression\":{\"mode\":\"csharp\",\"value\":\"#result[Get previous sync time from cache].Value\"},\"shouldAssignVariable\":{\"mode\":\"toggle\",\"value\":true}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Assign previous sync time from cache\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Flow_0ckrotq\",\"Type\":4,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"no\",\"Description\":null,\"IsDefault\":true,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_0sux2w2\",\"Type\":12,\"Parameters\":{\"variableName\":\"previousSyncTime\",\"variableExpression\":{\"mode\":\"csharp\",\"value\":\"DateTime.UtcNow.AddHours(-3)\"},\"shouldAssignVariable\":{\"mode\":\"toggle\",\"value\":true}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Assign default value for previous sync time\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Flow_0cacn6r\",\"Type\":4,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"yes\",\"Description\":null,\"IsDefault\":false,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_1nnddcn\",\"Type\":1,\"Parameters\":{\"input\":{\"ConnectionString\":{\"mode\":\"csharp\",\"value\":\"#var.MicrosoftSqlConnectionString\"},\"Query\":{\"mode\":\"sql\",\"value\":\"SELECT {{#var.ColumnNames}} FROM {{#var.MicrosoftSqlTableName}}\\r\\nWHERE {{#var.TimestampColumn}} > '{{#var.previousSyncTime}}'\"},\"Parameters\":[],\"ExecuteType\":{\"mode\":\"select\",\"value\":\"ExecuteReader\"}},\"options\":{\"ThrowErrorOnFailure\":{\"mode\":\"toggle\",\"value\":false},\"CommandTimeoutSeconds\":{\"mode\":\"integer\",\"value\":60},\"SqlTransactionIsolationLevel\":{\"mode\":\"select\",\"value\":\"ReadCommitted\"}},\"cancellationToken\":null},\"SelectedTypeId\":\"/ProcessTask/52de7e2e-788d-4d77-84c9-a6c86a64e2fb/v1\",\"PromoteResultAs\":null,\"Name\":\"Get new or updated rows from MicrosoftSQL\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":false,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_049di38\",\"Type\":12,\"Parameters\":{\"useStatementMode\":{\"mode\":\"toggle\",\"value\":true},\"variableExpression\":{\"mode\":\"csharp\",\"value\":\"{\\n    var rows = #result[Get new or updated rows from MicrosoftSQL].Data;\\n    var totalChunks = Math.Ceiling(rows.Count/(float)#var.ChunkSize);\\n    var queries = new List<string>();\\n\\n    string[] columns = #var.ColumnNames.Split(\\\", \\\");\\n\\n    for(var chunkIndex = 0; chunkIndex < totalChunks; chunkIndex++)\\n    {\\n        var sql = \\\"INSERT ALL \\\";\\n\\n        for (\\n            var rowIndex = chunkIndex * #var.ChunkSize;\\n            rowIndex < (chunkIndex + 1) * #var.ChunkSize;\\n            rowIndex++\\n        )\\n        {\\n            if (rowIndex >= rows.Count) break;\\n            var row = rows[(int)rowIndex];\\n            sql += $\\\"\\\\r\\\\nINTO {#var.OracleSchema}.{#var.OracleStagingTableName}({#var.ColumnNames}, {#var.TimestampColumn}) VALUES(\\\";\\n\\n            // Add value of each column in the row to the query\\n            for (var columnIndex = 0; columnIndex < columns.Length; columnIndex++)\\n            {\\n                sql += $\\\"'{row[columns[columnIndex]]}', \\\";\\n            }\\n\\n            // Add value for timestamp column\\n            sql += $\\\"TIMESTAMP '{DateTime.UtcNow.ToString(\\\"yyyy-MM-dd HH:mm:ss.fff\\\")}')\\\";\\n        }\\n        sql += \\\"\\\\r\\\\nSELECT * FROM dual\\\";\\n\\n        queries.Add(sql);\\n    }\\n\\n    return queries;\\n}\"},\"shouldAssignVariable\":{\"mode\":\"toggle\",\"value\":true},\"variableName\":\"queries\"},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Create insert statements\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Gateway_0aaldc4\",\"Type\":2,\"Parameters\":{\"expression\":{\"mode\":\"csharp\",\"value\":\"#result.Success\"}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Rows gotten successfully?\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Event_1elrcp6\",\"Type\":6,\"Parameters\":{\"expression\":{\"mode\":\"text\",\"value\":\"An exception occurred when attempting to fetch new or updated rows from the MicrosoftSQL database.\\r\\n\\r\\nError message:\\r\\n{{#result.ErrorMessage}}\"},\"bypassGlobalExceptionHandler\":{\"mode\":\"toggle\",\"value\":true}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":null,\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Flow_1l1ttru\",\"Type\":4,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"no\",\"Description\":null,\"IsDefault\":true,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Event_1fl1t38\",\"Type\":13,\"Parameters\":{},\"SelectedTypeId\":\"\",\"PromoteResultAs\":null,\"Name\":null,\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_0anbcsj\",\"Type\":10,\"Parameters\":{\"variable\":\"query\",\"expression\":{\"mode\":\"csharp\",\"value\":\"#var.queries\"}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Insert data into Oracle staging table in chunks\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_1wlprwq\",\"Type\":1,\"Parameters\":{\"input\":{\"Query\":{\"mode\":\"csharp\",\"value\":\"#var.query\"},\"Parameters\":[],\"ConnectionString\":{\"mode\":\"csharp\",\"value\":\"#var.OracleConnectionString\"}},\"options\":{\"ThrowErrorOnFailure\":{\"mode\":\"toggle\",\"value\":false},\"TimeoutSeconds\":{\"mode\":\"integer\",\"value\":30},\"OracleIsolationLevel\":{\"mode\":\"select\",\"value\":\"ReadCommitted\"},\"BindParameterByName\":{\"mode\":\"toggle\",\"value\":true}},\"cancellationToken\":null},\"SelectedTypeId\":\"/ProcessTask/0bfd5a7b-f89d-44f1-a7a6-d6a110906b04/v1\",\"PromoteResultAs\":null,\"Name\":\"Insert chunk into Oracle staging table\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":false,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Gateway_09zyvvr\",\"Type\":2,\"Parameters\":{\"expression\":{\"mode\":\"csharp\",\"value\":\"#result.Success\"}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Insertion successful?\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Flow_0phsr7w\",\"Type\":4,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"yes\",\"Description\":null,\"IsDefault\":false,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Event_1imdprg\",\"Type\":5,\"Parameters\":{\"expression\":{\"mode\":\"csharp\",\"value\":\"#result\"}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":null,\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Flow_1jhcde5\",\"Type\":4,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"no\",\"Description\":null,\"IsDefault\":true,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Event_1ddnlz7\",\"Type\":5,\"Parameters\":{\"expression\":{\"mode\":\"csharp\",\"value\":\"#var.errors += $\\\"\\\\nAn exception occurred when attempting to insert chunk {#var.query_index} into the staging table:\\\\n\\\\n{#result.Message}\\\"\"}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":null,\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_0kwzuqz\",\"Type\":12,\"Parameters\":{\"variableName\":\"errors\",\"variableExpression\":{\"mode\":\"csharp\",\"value\":\"\\\"\\\"\"},\"shouldAssignVariable\":{\"mode\":\"toggle\",\"value\":true}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Initialize error variable\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_0sribv0\",\"Type\":1,\"Parameters\":{\"input\":{\"Query\":{\"mode\":\"sql\",\"value\":\"MERGE INTO {{#var.OracleSchema}}.{{#var.OracleTableName}} t\\r\\nUSING (SELECT * FROM {{#var.OracleSchema}}.{{#var.OracleStagingTableName}}) s\\r\\nON (t.{{#var.IdentifierColumn}} = s.{{#var.IdentifierColumn}})\\r\\nWHEN MATCHED THEN\\r\\n    {{#var.mergeQueries.matched}}\\r\\nWHEN NOT MATCHED THEN\\r\\n    {{#var.mergeQueries.notmached}}\"},\"Parameters\":[],\"ConnectionString\":{\"mode\":\"csharp\",\"value\":\"#var.OracleConnectionString\"}},\"options\":{\"ThrowErrorOnFailure\":{\"mode\":\"toggle\",\"value\":false},\"TimeoutSeconds\":{\"mode\":\"integer\",\"value\":30},\"OracleIsolationLevel\":{\"mode\":\"select\",\"value\":\"ReadCommitted\"},\"BindParameterByName\":{\"mode\":\"toggle\",\"value\":true}},\"cancellationToken\":null},\"SelectedTypeId\":\"/ProcessTask/0bfd5a7b-f89d-44f1-a7a6-d6a110906b04/v1\",\"PromoteResultAs\":null,\"Name\":\"Merge data from staging table\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":false,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_07ez9qw\",\"Type\":1,\"Parameters\":{\"input\":{\"Query\":{\"mode\":\"sql\",\"value\":\"TRUNCATE TABLE {{#var.OracleSchema}}.{{#var.OracleStagingTableName}}\"},\"Parameters\":[],\"ConnectionString\":{\"mode\":\"csharp\",\"value\":\"#var.OracleConnectionString\"}},\"options\":{\"ThrowErrorOnFailure\":{\"mode\":\"toggle\",\"value\":false},\"TimeoutSeconds\":{\"mode\":\"integer\",\"value\":30},\"OracleIsolationLevel\":{\"mode\":\"select\",\"value\":\"ReadCommitted\"},\"BindParameterByName\":{\"mode\":\"toggle\",\"value\":true}},\"cancellationToken\":null},\"SelectedTypeId\":\"/ProcessTask/0bfd5a7b-f89d-44f1-a7a6-d6a110906b04/v1\",\"PromoteResultAs\":null,\"Name\":\"Clean up staging table\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":false,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_0tmigfn\",\"Type\":20,\"Parameters\":{\"keyExpression\":{\"mode\":\"text\",\"value\":\"previousSyncTime\"},\"valueExpression\":{\"mode\":\"csharp\",\"value\":\"DateTime.UtcNow.ToString(\\\"yyyy-MM-dd HH:mm:ss\\\")\"},\"ttlValue\":{\"mode\":\"integer\",\"value\":\"24\"},\"ttlMultiplier\":3600,\"throwIfFalse\":true,\"isGlobalScope\":true},\"SelectedTypeId\":\"AddOrUpdate\",\"PromoteResultAs\":null,\"Name\":\"Update previous sync time in cache\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Event_0lqng8a\",\"Type\":5,\"Parameters\":{\"expression\":{\"mode\":\"csharp\",\"value\":\"#var.errors != \\\"\\\" ? $\\\"Data was synced from MicrosoftSQL to Oracle. The process completed with the following errors:\\\\n\\\\n{#var.errors}\\\" : \\\"Data was synced from MicrosoftSQL to Oracle.\\\"\"}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":null,\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_0ef8l5l\",\"Type\":12,\"Parameters\":{\"useStatementMode\":{\"mode\":\"toggle\",\"value\":true},\"variableExpression\":{\"mode\":\"csharp\",\"value\":\"{\\n    dynamic queries = new JObject();\\n\\n    string[] columns = #var.ColumnNames.Split(\\\", \\\");\\n\\n    // Build update query\\n    var sql = \\\"UPDATE SET \\\";\\n\\n    // Add columns to query\\n    for (var columnIndex = 0; columnIndex < columns.Length; columnIndex++)\\n    {\\n        // Primary key cannot be updated\\n        if (columns[columnIndex] == #var.IdentifierColumn) continue;\\n\\n        sql += $\\\"t.{columns[columnIndex]} = s.{columns[columnIndex]},\\\\r\\\\n\\\";\\n    }\\n\\n    // Add timestamp\\n    sql += $\\\"t.{#var.TimestampColumn} = TO_DATE('{DateTime.UtcNow.ToString(\\\"yyyy-MM-dd HH:mm:ss\\\")}', 'YYYY-MM-DD HH24:MI:SS')\\\";\\n\\n    queries.matched = sql;\\n\\n    // Build insert query\\n    sql = $\\\"INSERT ({#var.ColumnNames}, {#var.TimestampColumn})\\\\r\\\\nVALUES (\\\";\\n\\n    // Add columns to query\\n    for (var columnIndex = 0; columnIndex < columns.Length; columnIndex++)\\n    {\\n        sql += $\\\"s.{columns[columnIndex]}, \\\";\\n    }\\n\\n    // Add timestamp value and closing bracket\\n    sql += $\\\"TO_DATE('{DateTime.UtcNow.ToString(\\\"yyyy-MM-dd HH:mm:ss\\\")}', 'YYYY-MM-DD HH24:MI:SS'))\\\";\\n\\n    queries.notmached = sql;\\n\\n    return queries;\\n}\"},\"shouldAssignVariable\":{\"mode\":\"toggle\",\"value\":true},\"variableName\":\"mergeQueries\"},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Build statements for merging\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Flow_1w0jvn1\",\"Type\":4,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"yes\",\"Description\":null,\"IsDefault\":false,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Gateway_0gg0hn9\",\"Type\":2,\"Parameters\":{\"expression\":{\"mode\":\"csharp\",\"value\":\"#result[Get new or updated rows from MicrosoftSQL].Data.Count > 0\"}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Were there any new or updated rows?\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Flow_1qtt6l9\",\"Type\":4,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"yes\",\"Description\":null,\"IsDefault\":false,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Flow_09g7mb3\",\"Type\":4,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"no\",\"Description\":null,\"IsDefault\":true,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Event_058upth\",\"Type\":5,\"Parameters\":{\"expression\":{\"mode\":\"text\",\"value\":\"No new or updated rows were found in the MicrosoftSQL database.\"}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":null,\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Gateway_1q63x1g\",\"Type\":2,\"Parameters\":{\"expression\":{\"mode\":\"csharp\",\"value\":\"#result[Merge data from staging table].Success && #result[Clean up staging table].Success\"}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Merge and cleanup successful?\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Event_0npu0yg\",\"Type\":6,\"Parameters\":{\"expression\":{\"mode\":\"text\",\"value\":\"An exception occurred either when attempting to merge the staging table into the destination table, or when attempting to clean up the staging table on Oracle. Messages:\\r\\n\\r\\nMerge:\\r\\n{{#result[Merge data from staging table].Message}}\\r\\n\\r\\nCleanup:\\r\\n{{#result[Clean up staging table].Message}}\"},\"bypassGlobalExceptionHandler\":{\"mode\":\"toggle\",\"value\":true}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":null,\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Flow_0x40qax\",\"Type\":4,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"no\",\"Description\":null,\"IsDefault\":true,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"DataStoreReference_14s0uk1\",\"Type\":22,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"MicrosoftSQL database\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"DataStoreReference_0zlscxx\",\"Type\":22,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Oracle database\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Flow_0txohn4\",\"Type\":4,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"yes\",\"Description\":null,\"IsDefault\":false,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null}]",
					"ManualTriggerJson": "[]",
					"IsSubprocess": false,
					"TriggersJson": "[{\"$type\":\"ManualTrigger\",\"config\":{},\"name\":\"Manual\",\"id\":\"StartEvent_1\",\"shouldNotLogParameters\":null},{\"$type\":\"ScheduleTrigger\",\"config\":{\"startTimeMinute\":\"00\",\"startTimeHour\":\"00\",\"endTimeMinute\":\"00\",\"endTimeHour\":\"00\",\"endTime\":\"00:00\",\"startTime\":\"00:00\",\"recurring\":true,\"repeatDelay\":1,\"repeatDelaySeconds\":3600,\"limitToOneConcurrentExecution\":true,\"cycleRecurEvery\":1,\"cycleType\":\"Daily\",\"cycleLength\":1,\"seasonStartDate\":\"2024-07-16\",\"seasonEndDate\":null,\"cycleDaysOfWeek\":\"None\",\"cycleMonths\":\"None\",\"cycleDaysString\":\"\",\"cycleDayRanks\":\"None\",\"monthlyCycleType\":\"OnDays\",\"repeatDelayType\":3600,\"timeZone\":\"FLE Standard Time\"},\"name\":\"Schedule\",\"id\":\"Event_0f5myku\",\"shouldNotLogParameters\":null}]",
					"AssemblyName": null,
					"PackageId": null,
					"PackageVersion": null,
					"UsedTasksJson": "[\"/ProcessTask/52DE7E2E-788D-4D77-84C9-A6C86A64E2FB/v1\",\"/ProcessTask/0BFD5A7B-F89D-44F1-A7A6-D6A110906B04/v1\"]",
					"UsedSubprocessesJson": "{}",
					"ProcessExecutionVersion": "",
					"FrendsVersion": "5.7.3.1743",
					"TargetFramework": "net8.0",
					"StaticRequiredEnvironmentVariables": [],
					"RequiredEnvironmentVariables": [],
					"PromotedResultVariablesJson": "[]",
					"MajorVersion": 1,
					"MinorVersion": 0,
					"IsForMonitoringRule": false,
					"ProcessVariablesJson": null
				},
				"LinkedTasks": {
					"08cc6c4c-7e88-4b33-8f64-ec5f7bd1f24c": [
						{
							"Id": "52de7e2e-788d-4d77-84c9-a6c86a64e2fb",
							"PackageId": "Frends.MicrosoftSQL.ExecuteQuery",
							"PackageVersion": "1.2.0",
							"Name": "Frends.MicrosoftSQL.ExecuteQuery.MicrosoftSQL.ExecuteQuery(Input, Options, CancellationToken)",
							"FrameworkIdentifier": ".NETCoreApp"
						},
						{
							"Id": "0bfd5a7b-f89d-44f1-a7a6-d6a110906b04",
							"PackageId": "Frends.Oracle.ExecuteQuery",
							"PackageVersion": "2.0.1",
							"Name": "Frends.Oracle.ExecuteQuery.Oracle.ExecuteQuery(Input, Options, CancellationToken)",
							"FrameworkIdentifier": ".NETCoreApp"
						}
					]
				},
				"LinkedSubProcess": {},
				"Version": "Acc41"
			}
		}
	]
}