From 534004d48ff8dc9b30589da565835454d5792030 Mon Sep 17 00:00:00 2001 From: Pedro Fiadeiro Date: Mon, 30 Nov 2020 10:32:04 +0000 Subject: [PATCH 1/4] Adding ProcFwkUtils pipelines to solution --- ProcessingFramework.sln | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ProcessingFramework.sln b/ProcessingFramework.sln index ae89bd65..7f793329 100644 --- a/ProcessingFramework.sln +++ b/ProcessingFramework.sln @@ -120,6 +120,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FactoryTesting", "FactoryTe EndProject Project("{00D1A9C2-B5F0-4AF3-8072-F6C62B433612}") = "MetadataDBTests", "MetadataDBTests\MetadataDBTests.sqlproj", "{32D54B90-932D-44A3-911D-007C4B90BC55}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_ProcFwkUtils", "_ProcFwkUtils", "{6809EDBD-125D-440E-8486-9CFAB9BB5B7D}" + ProjectSection(SolutionItems) = preProject + DataFactory\pipeline\Check For Running Pipeline.json = DataFactory\pipeline\Check For Running Pipeline.json + DataFactory\pipeline\Email Sender.json = DataFactory\pipeline\Email Sender.json + DataFactory\pipeline\Intentional Error.json = DataFactory\pipeline\Intentional Error.json + DataFactory\pipeline\Throw Exception.json = DataFactory\pipeline\Throw Exception.json + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -165,6 +173,7 @@ Global {EBC230DF-D45D-43E4-A74E-32ADA3DDAE7A} = {5A56A63A-351D-467D-A2DA-FDB3C9CBD252} {20313ECA-118E-408D-BB42-8094A7A9CD20} = {CC7B607B-8C84-4E07-A6C8-326923752F92} {463330CD-189F-42B4-984A-8D3C1385645B} = {CC7B607B-8C84-4E07-A6C8-326923752F92} + {6809EDBD-125D-440E-8486-9CFAB9BB5B7D} = {17586826-8BE9-4622-B12E-1683F2A20352} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {170F5302-BB9C-4569-8F43-D859C7678EF0} From 5ef3ab5b6d3612f0089541796a4db165479e8f11 Mon Sep 17 00:00:00 2001 From: Pedro Fiadeiro Date: Mon, 30 Nov 2020 10:33:06 +0000 Subject: [PATCH 2/4] Updating Data Factory components to deploy --- DeploymentTools/DataFactory/ProcFwkComponents.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DeploymentTools/DataFactory/ProcFwkComponents.json b/DeploymentTools/DataFactory/ProcFwkComponents.json index a8591263..3a32f295 100644 --- a/DeploymentTools/DataFactory/ProcFwkComponents.json +++ b/DeploymentTools/DataFactory/ProcFwkComponents.json @@ -13,7 +13,8 @@ "/pipeline/02-Parent.json", "/pipeline/01-Grandparent.json", "/pipeline/Throw Exception.json", - "/pipeline/Check For Running Pipeline.json" + "/pipeline/Check For Running Pipeline.json", + "/pipeline/Email Sender.json" ], "triggers": [ "/trigger/FunctionalTestingTrigger.json" From 436e03003a34511c933c01684cbc2453db689805 Mon Sep 17 00:00:00 2001 From: Pedro Fiadeiro Date: Mon, 30 Nov 2020 10:36:53 +0000 Subject: [PATCH 3/4] Update 04-Infant pipeline to call the new pipeline Email Sender --- DataFactory/pipeline/04-Infant.json | 49 ++++++++++++++++++----------- 1 file changed, 31 insertions(+), 18 deletions(-) diff --git a/DataFactory/pipeline/04-Infant.json b/DataFactory/pipeline/04-Infant.json index b8f92d67..2ee54ef7 100644 --- a/DataFactory/pipeline/04-Infant.json +++ b/DataFactory/pipeline/04-Infant.json @@ -396,8 +396,7 @@ }, { "name": "Send Email", - "description": "Use an Azure Function to perform an SMTP client email send operation.", - "type": "AzureFunctionActivity", + "type": "ExecutePipeline", "dependsOn": [ { "activity": "Get Email Parts", @@ -406,25 +405,39 @@ ] } ], - "policy": { - "timeout": "0.00:10:00", - "retry": 0, - "retryIntervalInSeconds": 30, - "secureOutput": false, - "secureInput": true - }, "userProperties": [], "typeProperties": { - "functionName": "SendEmail", - "method": "POST", - "body": { - "value": "@activity('Get Email Parts').output.firstRow", - "type": "Expression" + "pipeline": { + "referenceName": "Email Sender", + "type": "PipelineReference" + }, + "waitOnCompletion": true, + "parameters": { + "Recipients": { + "value": "@activity('Get Email Parts').output.firstRow.emailRecipients", + "type": "Expression" + }, + "CcRecipients": { + "value": "@activity('Get Email Parts').output.firstRow.emailCcRecipients", + "type": "Expression" + }, + "BccRecipients": { + "value": "@activity('Get Email Parts').output.firstRow.emailBccRecipients", + "type": "Expression" + }, + "Subject": { + "value": "@activity('Get Email Parts').output.firstRow.emailSubject", + "type": "Expression" + }, + "Body": { + "value": "@activity('Get Email Parts').output.firstRow.emailBody", + "type": "Expression" + }, + "Importance": { + "value": "@activity('Get Email Parts').output.firstRow.emailImportance", + "type": "Expression" + } } - }, - "linkedServiceName": { - "referenceName": "FrameworkFunctions", - "type": "LinkedServiceReference" } } ] From c79fefebf34dcc0abb37e0793dcc4991c12419e2 Mon Sep 17 00:00:00 2001 From: Pedro Fiadeiro Date: Mon, 30 Nov 2020 10:38:41 +0000 Subject: [PATCH 4/4] Fixed bug that prevented emails from being sent if recipients choose alers for All status --- MetadataDB/procfwk/Stored Procedures/CheckForEmailAlerts.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MetadataDB/procfwk/Stored Procedures/CheckForEmailAlerts.sql b/MetadataDB/procfwk/Stored Procedures/CheckForEmailAlerts.sql index 735ac6fe..21637650 100644 --- a/MetadataDB/procfwk/Stored Procedures/CheckForEmailAlerts.sql +++ b/MetadataDB/procfwk/Stored Procedures/CheckForEmailAlerts.sql @@ -28,7 +28,10 @@ BEGIN INNER JOIN procfwk.Recipients AS r ON r.RecipientId = pal.RecipientId WHERE ce.PipelineId = @PipelineId - AND ao.BitValue & pal.OutcomesBitValue > 0 + AND ( + ao.BitValue & pal.OutcomesBitValue <> 0 + OR pal.OutcomesBitValue & 1 <> 0 --all + ) AND pal.[Enabled] = 1 AND r.[Enabled] = 1 )