From ce853e1b674a9b12c31143273dd61840620e4d98 Mon Sep 17 00:00:00 2001 From: jaise-aot Date: Thu, 28 Sep 2023 11:09:15 -0700 Subject: [PATCH 1/2] handle arrays in email --- .../processes/Common/CommonEmailWorkflow.bpmn | 24 +++++++++---------- .../processes/SIR/SIRWorkflow.bpmn | 6 +++-- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/Common/CommonEmailWorkflow.bpmn b/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/Common/CommonEmailWorkflow.bpmn index 5ffa2b91..c96632c2 100644 --- a/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/Common/CommonEmailWorkflow.bpmn +++ b/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/Common/CommonEmailWorkflow.bpmn @@ -68,11 +68,11 @@ system.out.println ("name: "+name); "from": "NOREPLYEPD@gov.bc.ca", "priority": "normal", "subject": execution.getVariable("subject"), - "to": [], + "to": execution.getVariable("emailTo"), "tag": "", "attachments": [] } -p.to.push(execution.getVariable("emailTo")) + console.log("Payload") console.log(JSON.stringify(p)) JSON.stringify(p) @@ -149,9 +149,11 @@ system.out.println ("result: "+result); - - - + + + + + @@ -159,17 +161,15 @@ system.out.println ("result: "+result); - - - - - + + + - - + + diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/SIR/SIRWorkflow.bpmn b/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/SIR/SIRWorkflow.bpmn index ead0cdb5..675d8130 100644 --- a/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/SIR/SIRWorkflow.bpmn +++ b/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/SIR/SIRWorkflow.bpmn @@ -58,7 +58,9 @@ var system = java.lang.System; system.out.println ("simpleemail"+execution.getVariable('simpleemail')); var clientEmail = execution.getVariable('simpleemail'); -execution.setVariable('emailTo',clientEmail); +var emailsToArray = []; +emailsToArray.push(clientEmail) +execution.setVariable("emailTo", Java.to(emailsToArray, "java.lang.Object[]")); system.out.println ("emailTo"+execution.getVariable('emailTo')); system.out.println ("firstname "+execution.getVariable('s1-firstname')); var firstname=execution.getVariable('s1-firstname'); @@ -70,7 +72,7 @@ execution.setVariable('name',firstname); Flow_1la2yud - + From dbdd1337758821c8a24bdcd452a45c3a70185764 Mon Sep 17 00:00:00 2001 From: jaise-aot Date: Thu, 28 Sep 2023 17:48:32 -0700 Subject: [PATCH 2/2] email integration in nir workflow --- .../subProcess/NIRBundleWorkflow.bpmn | 19 ++++- .../processes/Common/email-template.dmn | 52 ++++++++++++++ .../templates/nir_application.ftl | 69 +++++++++++++++++++ 3 files changed, 137 insertions(+), 3 deletions(-) create mode 100644 forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/templates/nir_application.ftl diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/Bundling/subProcess/NIRBundleWorkflow.bpmn b/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/Bundling/subProcess/NIRBundleWorkflow.bpmn index 37778d53..aa29d829 100644 --- a/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/Bundling/subProcess/NIRBundleWorkflow.bpmn +++ b/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/Bundling/subProcess/NIRBundleWorkflow.bpmn @@ -35,13 +35,17 @@ Flow_0unffch var system = java.lang.System; var clientEmail = execution.getVariable('simpleemail3'); -execution.setVariable('clientEmail',clientEmail); +var emailsToArray = []; +emailsToArray.push(clientEmail) +execution.setVariable("emailTo", Java.to(emailsToArray, "java.lang.Object[]")); var riskclassification = execution.getVariable('riskclassification'); system.out.println ("formUrl "+execution.getVariable('formUrl')); var siteRiskClassification = execution.getVariable('siteRiskClassification'); system.out.println ("siteRiskClassification "+siteRiskClassification ); execution.setVariable('siteRiskClassification',siteRiskClassification); - +var name=execution.getVariable('nirName'); +system.out.println ("name "+execution.getVariable('nirName')); +execution.setVariable('name',name); @@ -111,6 +115,9 @@ task.execution.setVariable('deleteReason', "completed"); + + nir_updated + Flow_0bwxoom Flow_0x0w3ip @@ -121,6 +128,9 @@ task.execution.setVariable('deleteReason', "completed"); + + nir_updated + Flow_0ixmsle Flow_1cgcuxz @@ -573,7 +583,7 @@ execution.setVariable("applicationStatus", "Rejected"); - + ${action == 'Rejected' } @@ -967,6 +977,9 @@ execution.setVariable("applicationStatus", "Rejected"); + + + diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/Common/email-template.dmn b/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/Common/email-template.dmn index cd140f9b..2554ae6f 100644 --- a/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/Common/email-template.dmn +++ b/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/processes/Common/email-template.dmn @@ -66,6 +66,58 @@ "epd-support@gov.bc.ca" + + + "nom_updated" + + + + + + "NOREPLYEPD@gov.bc.ca" + + + + + + + + + "Notification of Likely or Actual Migration Application Status Update" + + + "templates/nom_application.ftl" + + + "epd-support@gov.bc.ca" + + + + + "nir_updated" + + + + + + "NOREPLYEPD@gov.bc.ca" + + + + + + + + + "Notification of Independent Remediation Application Status Update" + + + "templates/nir_application.ftl" + + + "epd-support@gov.bc.ca" + + diff --git a/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/templates/nir_application.ftl b/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/templates/nir_application.ftl new file mode 100644 index 00000000..589119be --- /dev/null +++ b/forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/templates/nir_application.ftl @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + +
+ + + Site Remediation Services +
+ + + + + + + + + + + + + + + + + + + +
+
+
+

+ Notification of Independent Remediation. +

+
+

+ Dear ${name}, +

+

+ Your Notification of Independent Remediation application has been updated. Current status is ${action}. +

+
+

+ If you need any help, don’t hesitate to reach out to us at ${support} +

+
+
+
+ +

BC Public Services will never send an email that asks you to provide, confirm or verify personal, log on or account information. + DO NOT reply to this email as it was sent from an unmonitored account. +

+
+ + \ No newline at end of file