﻿{
	"ProcessTemplates": [
		{
			"Name": "Oracle Database SELECT to JSON with SFTP upload",
			"Modified": "2024-05-13T12:40:20.0963077",
			"Modifier": "jefim.borissov@frends.com",
			"Tags": [
				"Json",
				"SFTP",
				"Oracle"
			],
			"TemplateProcessTags": [],
			"Description": "Execute SELECT statement on Oracle database. \nResult will be written to SFTP server in JSON format.",
			"Version": 1,
			"UniqueIdentifier": "7386bff8-08ce-4e79-9225-f553ec4b459e",
			"ProcessVariablesJson": "{\"Directory\":{\"Value\":\"\\\"/\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"File directory on the SFTP server.\"},\"FileName\":{\"Value\":\"\\\"selectedData.json\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"Name of the file to be written on SFTP server.\"},\"ServerAddress\":{\"Value\":\"\\\"127.0.0.1\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"SFTP server address.\"},\"ServerUser\":{\"Value\":\"\\\"user\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"SFTP server user.\"},\"ServerPassword\":{\"Value\":\"\\\"password\\\"\",\"IsSecret\":true,\"Mode\":\"text\",\"Description\":\"SFTP server user's password.\"},\"TableName\":{\"Value\":\"\\\"table\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"Name of the database table.\"},\"ColumnNames\":{\"Value\":\"\\\"email, address1, address2, country, state, city, zipcode, phone, firstname, lastname, title\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"A comma separated list of the columns that are to be selected.\"},\"SelectionCriteria\":{\"Value\":\"\\\"email = 'example@example.com'\\\"\",\"IsSecret\":false,\"Mode\":\"text\",\"Description\":\"The criteria to select the record(s) that will be selected on the database.\"},\"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\":\"Connection string to access the database.\"}}",
			"ProcessInfo": {
				"Process": {
					"Name": "Oracle Database SELECT to JSON with SFTP upload",
					"Modified": "2024-05-13T12:40:20.0963077",
					"Modifier": "jefim.borissov@frends.com",
					"TagString": null,
					"Tags": [],
					"Description": "Execute SELECT statement on Oracle database. \nResult will be written to SFTP server in JSON format.",
					"Version": 1,
					"UniqueIdentifier": "91a71c6b-4ba6-4347-bdfb-65a319e152e8",
					"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:task id=\"Activity_1241p78\" name=\"Write JSON file to SFTP server\"><bpmn2:incoming>Flow_16ehj3j</bpmn2:incoming><bpmn2:outgoing>Flow_1k6pvgo</bpmn2:outgoing><bpmn2:standardLoopCharacteristics /></bpmn2:task><bpmn2:endEvent id=\"Event_0bjpqh9\"><bpmn2:incoming>Flow_1k6pvgo</bpmn2:incoming></bpmn2:endEvent><bpmn2:startEvent id=\"Event_1yzc1et\" name=\"Manual Trigger\"><bpmn2:outgoing>Flow_1d2px1l</bpmn2:outgoing></bpmn2:startEvent><bpmn2:exclusiveGateway id=\"Gateway_0oknxbk\" name=\"Database select successful?\" default=\"Flow_0i88qzz\"><bpmn2:incoming>Flow_1lgefft</bpmn2:incoming><bpmn2:outgoing>Flow_16ehj3j</bpmn2:outgoing><bpmn2:outgoing>Flow_0i88qzz</bpmn2:outgoing></bpmn2:exclusiveGateway><bpmn2:dataStoreReference id=\"DataStoreReference_025d0m2\" name=\"Database\" /><bpmn2:scriptTask id=\"Activity_0kmcx1a\" name=\"Create SELECT Statement\"><bpmn2:incoming>Flow_1d2px1l</bpmn2:incoming><bpmn2:outgoing>Flow_17s9ukn</bpmn2:outgoing></bpmn2:scriptTask><bpmn2:sequenceFlow id=\"Flow_1d2px1l\" sourceRef=\"Event_1yzc1et\" targetRef=\"Activity_0kmcx1a\" /><bpmn2:sequenceFlow id=\"Flow_17s9ukn\" sourceRef=\"Activity_0kmcx1a\" targetRef=\"Activity_192rqqt\" /><bpmn2:task id=\"Activity_192rqqt\" name=\"Execute SELECT statement\"><bpmn2:incoming>Flow_17s9ukn</bpmn2:incoming><bpmn2:outgoing>Flow_1lgefft</bpmn2:outgoing><bpmn2:property id=\"Property_0402j43\" name=\"__targetRef_placeholder\" /><bpmn2:dataInputAssociation id=\"DataInputAssociation_1t3b6lk\"><bpmn2:sourceRef>DataStoreReference_025d0m2</bpmn2:sourceRef><bpmn2:targetRef>Property_0402j43</bpmn2:targetRef></bpmn2:dataInputAssociation><bpmn2:standardLoopCharacteristics /></bpmn2:task><bpmn2:sequenceFlow id=\"Flow_1lgefft\" sourceRef=\"Activity_192rqqt\" targetRef=\"Gateway_0oknxbk\" /><bpmn2:sequenceFlow id=\"Flow_16ehj3j\" name=\"yes\" sourceRef=\"Gateway_0oknxbk\" targetRef=\"Activity_1241p78\" /><bpmn2:intermediateThrowEvent id=\"Event_0zn13u3\" name=\"Throw an error if the database query was not successful\"><bpmn2:incoming>Flow_0i88qzz</bpmn2:incoming><bpmn2:signalEventDefinition /></bpmn2:intermediateThrowEvent><bpmn2:sequenceFlow id=\"Flow_0i88qzz\" name=\"no\" sourceRef=\"Gateway_0oknxbk\" targetRef=\"Event_0zn13u3\" /><bpmn2:sequenceFlow id=\"Flow_1k6pvgo\" sourceRef=\"Activity_1241p78\" targetRef=\"Event_0bjpqh9\" /><bpmn2:group id=\"Group_168041r\" categoryValueRef=\"CategoryValue_0ilgsb4\" /><bpmn2:group id=\"Group_04vv671\" categoryValueRef=\"CategoryValue_053klue\" /><bpmn2:textAnnotation id=\"TextAnnotation_1xeew22\"><bpmn2:text>Code will create the SELECT statement based on the process parameters.</bpmn2:text></bpmn2:textAnnotation><bpmn2:association id=\"Association_05c1k04\" sourceRef=\"Activity_0kmcx1a\" targetRef=\"TextAnnotation_1xeew22\" /></bpmn2:process><bpmn2:category id=\"Category_1gxmhik\"><bpmn2:categoryValue id=\"CategoryValue_0ilgsb4\" value=\"Write JSON file to SFTP server\" /></bpmn2:category><bpmn2:category id=\"Category_0w0kups\"><bpmn2:categoryValue id=\"CategoryValue_053klue\" value=\"Query the database\" /></bpmn2:category><bpmndi:BPMNDiagram id=\"BPMNDiagram_1\"><bpmndi:BPMNPlane id=\"BPMNPlane_1\" bpmnElement=\"Process_1\"><bpmndi:BPMNShape id=\"BPMNShape_1g8skfe\" bpmnElement=\"Activity_1241p78\"><dc:Bounds x=\"950\" y=\"160\" width=\"100\" height=\"80\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Event_0bjpqh9_di\" bpmnElement=\"Event_0bjpqh9\"><dc:Bounds x=\"1122\" y=\"182\" width=\"36\" height=\"36\" /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"BPMNShape_1bpsier\" bpmnElement=\"Event_1yzc1et\"><dc:Bounds x=\"372\" y=\"182\" width=\"36\" height=\"36\" /><bpmndi:BPMNLabel><dc:Bounds x=\"355\" y=\"218\" width=\"75\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"BPMNShape_0hwiga7\" bpmnElement=\"Gateway_0oknxbk\" isMarkerVisible=\"true\"><dc:Bounds x=\"805\" y=\"175\" width=\"50\" height=\"50\" /><bpmndi:BPMNLabel><dc:Bounds x=\"793\" y=\"138\" width=\"80\" height=\"27\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"BPMNShape_17bbznk\" bpmnElement=\"DataStoreReference_025d0m2\"><dc:Bounds x=\"665\" y=\"298\" width=\"50\" height=\"50\" /><bpmndi:BPMNLabel><dc:Bounds x=\"666\" y=\"355\" width=\"48\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"BPMNShape_1k8eabk\" bpmnElement=\"Activity_0kmcx1a\"><dc:Bounds x=\"480\" y=\"160\" width=\"30\" height=\"30\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Activity_192rqqt_di\" bpmnElement=\"Activity_192rqqt\"><dc:Bounds x=\"640\" y=\"160\" width=\"100\" height=\"80\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Event_0zn13u3_di\" bpmnElement=\"Event_0zn13u3\"><dc:Bounds x=\"812\" y=\"282\" width=\"36\" height=\"36\" /><bpmndi:BPMNLabel><dc:Bounds x=\"790\" y=\"325\" width=\"81\" height=\"53\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"Group_168041r_di\" bpmnElement=\"Group_168041r\"><dc:Bounds x=\"920\" y=\"80\" width=\"160\" height=\"320\" /><bpmndi:BPMNLabel><dc:Bounds x=\"964\" y=\"87\" width=\"75\" height=\"27\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"BPMNShape_0p2eg1m\" bpmnElement=\"Group_04vv671\"><dc:Bounds x=\"440\" y=\"80\" width=\"440\" height=\"320\" /><bpmndi:BPMNLabel><dc:Bounds x=\"638\" y=\"87\" width=\"49\" height=\"27\" /></bpmndi:BPMNLabel></bpmndi:BPMNShape><bpmndi:BPMNShape id=\"TextAnnotation_1xeew22_di\" bpmnElement=\"TextAnnotation_1xeew22\"><dc:Bounds x=\"480\" y=\"295\" width=\"160\" height=\"55\" /><bpmndi:BPMNLabel /></bpmndi:BPMNShape><bpmndi:BPMNEdge id=\"BPMNEdge_0wtbc5r\" bpmnElement=\"Flow_1d2px1l\"><di:waypoint x=\"408\" y=\"200\" /><di:waypoint x=\"480\" y=\"200\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"BPMNEdge_0ib54b3\" bpmnElement=\"Flow_17s9ukn\"><di:waypoint x=\"580\" y=\"200\" /><di:waypoint x=\"640\" y=\"200\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"BPMNEdge_0f7wsw1\" bpmnElement=\"DataInputAssociation_1t3b6lk\"><di:waypoint x=\"690\" y=\"298\" /><di:waypoint x=\"690\" y=\"240\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_1lgefft_di\" bpmnElement=\"Flow_1lgefft\"><di:waypoint x=\"740\" y=\"200\" /><di:waypoint x=\"805\" y=\"200\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_16ehj3j_di\" bpmnElement=\"Flow_16ehj3j\"><di:waypoint x=\"855\" y=\"200\" /><di:waypoint x=\"950\" y=\"200\" /><bpmndi:BPMNLabel><dc:Bounds x=\"882\" y=\"182\" width=\"17\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_0i88qzz_di\" bpmnElement=\"Flow_0i88qzz\"><di:waypoint x=\"830\" y=\"225\" /><di:waypoint x=\"830\" y=\"282\" /><bpmndi:BPMNLabel><dc:Bounds x=\"839\" y=\"249\" width=\"13\" height=\"14\" /></bpmndi:BPMNLabel></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Flow_1k6pvgo_di\" bpmnElement=\"Flow_1k6pvgo\"><di:waypoint x=\"1050\" y=\"200\" /><di:waypoint x=\"1122\" y=\"200\" /></bpmndi:BPMNEdge><bpmndi:BPMNEdge id=\"Association_05c1k04_di\" bpmnElement=\"Association_05c1k04\"><di:waypoint x=\"530\" y=\"240\" /><di:waypoint x=\"530\" y=\"295\" /></bpmndi:BPMNEdge></bpmndi:BPMNPlane></bpmndi:BPMNDiagram></bpmn2:definitions>",
					"ElementParameters": "[{\"Id\":\"Activity_1241p78\",\"Type\":1,\"Parameters\":{\"input\":{\"Path\":{\"mode\":\"text\",\"value\":\"{{#var.Directory}}{{#var.FileName}}\"},\"Content\":{\"mode\":\"csharp\",\"value\":\"#result[Execute SELECT statement].Output.ToString()\"},\"FileEncoding\":{\"mode\":\"select\",\"value\":\"ANSI\"},\"EnableBom\":{\"mode\":\"toggle\",\"value\":false},\"EncodingInString\":{\"mode\":\"text\",\"value\":\"\"},\"WriteBehaviour\":{\"mode\":\"select\",\"value\":\"Overwrite\"},\"AddNewLine\":{\"mode\":\"toggle\",\"value\":false}},\"connection\":{\"ConnectionTimeout\":{\"mode\":\"integer\",\"value\":60},\"Address\":{\"mode\":\"csharp\",\"value\":\"#var.ServerAddress\"},\"Port\":{\"mode\":\"integer\",\"value\":22},\"Authentication\":{\"mode\":\"select\",\"value\":\"UsernamePassword\"},\"Username\":{\"mode\":\"csharp\",\"value\":\"#var.ServerUser\"},\"Password\":{\"mode\":\"csharp\",\"value\":\"#var.ServerPassword\"},\"PrivateKeyFile\":{\"mode\":\"text\",\"value\":\"\"},\"PrivateKeyString\":{\"mode\":\"text\",\"value\":\"\"},\"PrivateKeyPassphrase\":{\"mode\":\"text\",\"value\":\"\"},\"ServerFingerPrint\":{\"mode\":\"text\",\"value\":\"\"},\"HostKeyAlgorithm\":{\"mode\":\"select\",\"value\":\"Any\"},\"UseKeyboardInteractiveAuthentication\":{\"mode\":\"toggle\",\"value\":false},\"PromptAndResponse\":[],\"BufferSize\":{\"mode\":\"integer\",\"value\":32}}},\"SelectedTypeId\":\"/ProcessTask/cbd72640-717d-493b-9955-c1d326ee1386/v1\",\"PromoteResultAs\":null,\"Name\":\"Write JSON file to SFTP server\",\"Description\":\"\",\"IsDefault\":null,\"ShouldRetry\":true,\"MaxRetryCount\":3,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Event_0bjpqh9\",\"Type\":5,\"Parameters\":{\"expression\":{\"mode\":\"text\",\"value\":\"Data was successfully written to {{#var.Directory}}{{#var.FileName}}.\"}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":null,\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Event_1yzc1et\",\"Type\":0,\"Parameters\":{},\"SelectedTypeId\":\"ManualTrigger\",\"PromoteResultAs\":null,\"Name\":\"Manual Trigger\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Gateway_0oknxbk\",\"Type\":2,\"Parameters\":{\"expression\":{\"mode\":\"csharp\",\"value\":\"#result[Execute SELECT statement].Success\"}},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Database select successful?\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"DataStoreReference_025d0m2\",\"Type\":22,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Database\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_0kmcx1a\",\"Type\":12,\"Parameters\":{\"useStatementMode\":{\"mode\":\"toggle\",\"value\":true},\"variableExpression\":{\"mode\":\"csharp\",\"value\":\"var sel = \\\"SELECT \\\" + #var.ColumnNames + \\\" FROM \\\" + #var.TableName;\\n\\nif(string.IsNullOrEmpty(#var.SelectionCriteria))\\n    return sel;\\nelse\\n    sel = sel + \\\" WHERE \\\" + #var.SelectionCriteria;\\n\\nreturn sel;\"},\"shouldAssignVariable\":{\"mode\":\"toggle\",\"value\":true},\"variableName\":\"selectStatement\"},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"Create SELECT Statement\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Activity_192rqqt\",\"Type\":1,\"Parameters\":{\"input\":{\"Query\":{\"mode\":\"csharp\",\"value\":\"#var.selectStatement\"},\"Parameters\":[],\"ConnectionString\":{\"mode\":\"csharp\",\"value\":\"#var.OracleConnectionString\"}},\"options\":{\"ThrowErrorOnFailure\":{\"mode\":\"toggle\",\"value\":true},\"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\":\"Execute SELECT statement\",\"Description\":null,\"IsDefault\":null,\"ShouldRetry\":true,\"MaxRetryCount\":3,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Flow_16ehj3j\",\"Type\":4,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"yes\",\"Description\":null,\"IsDefault\":false,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null},{\"Id\":\"Event_0zn13u3\",\"Type\":6,\"Parameters\":{\"expression\":{\"mode\":\"text\",\"value\":\"An error occured selecting from the database table {{#var.TableName}}: {{#result[Execute SELECT statement].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_0i88qzz\",\"Type\":4,\"Parameters\":{},\"SelectedTypeId\":null,\"PromoteResultAs\":null,\"Name\":\"no\",\"Description\":null,\"IsDefault\":true,\"ShouldRetry\":null,\"MaxRetryCount\":null,\"ShouldNotLogResult\":null,\"ShouldDispose\":null}]",
					"ManualTriggerJson": "[]",
					"IsSubprocess": false,
					"TriggersJson": "[{\"$type\":\"ManualTrigger\",\"config\":{},\"name\":\"Manual Trigger\",\"id\":\"Event_1yzc1et\",\"shouldNotLogParameters\":null}]",
					"AssemblyName": null,
					"PackageId": null,
					"PackageVersion": null,
					"UsedTasksJson": "[\"/ProcessTask/0BFD5A7B-F89D-44F1-A7A6-D6A110906B04/v1\",\"/ProcessTask/CBD72640-717D-493B-9955-C1D326EE1386/v1\"]",
					"UsedSubprocessesJson": "{}",
					"ProcessExecutionVersion": "",
					"FrendsVersion": "5.7.2.1685",
					"TargetFramework": "net8.0",
					"StaticRequiredEnvironmentVariables": [],
					"RequiredEnvironmentVariables": [],
					"PromotedResultVariablesJson": "[]",
					"MajorVersion": 1,
					"MinorVersion": 0,
					"IsForMonitoringRule": false,
					"ProcessVariablesJson": null
				},
				"LinkedTasks": {
					"91a71c6b-4ba6-4347-bdfb-65a319e152e8": [
						{
							"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"
						},
						{
							"Id": "cbd72640-717d-493b-9955-c1d326ee1386",
							"PackageId": "Frends.SFTP.WriteFile",
							"PackageVersion": "2.2.0",
							"Name": "Frends.SFTP.WriteFile.SFTP.WriteFile(Input, Connection)",
							"FrameworkIdentifier": ".NETCoreApp"
						}
					]
				},
				"LinkedSubProcess": {},
				"Version": "Acc41"
			}
		}
	]
}