From b91b9f5e447fefb1f2d5f1e037f732c5157f4248 Mon Sep 17 00:00:00 2001 From: Muhammad Date: Thu, 28 Mar 2024 11:44:07 +0530 Subject: [PATCH 1/3] feat: Add campaign workflow defenition --- .../workflows/sirenCampaignWorkflow.json | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 rest/src/main/resources/siren/workflows/sirenCampaignWorkflow.json diff --git a/rest/src/main/resources/siren/workflows/sirenCampaignWorkflow.json b/rest/src/main/resources/siren/workflows/sirenCampaignWorkflow.json new file mode 100644 index 0000000000..1dff8ebd3c --- /dev/null +++ b/rest/src/main/resources/siren/workflows/sirenCampaignWorkflow.json @@ -0,0 +1,57 @@ +{ + "accessPolicy": {}, + "name": "siren_campaign_workflow", + "description": "Workflow for executing campaigns", + "version": 1, + "tasks": [ + { + "name": "template_fork", + "taskReferenceName": "temp_pSzeL9pM3AMtpm7hD-WcA_template_fork", + "inputParameters": {}, + "type": "FORK_JOIN", + "forkTasks": [ + [ + { + "name": "send_notification_task", + "taskReferenceName": "prov_j7ooKIGve0iG2n2tH-1Ds_send_notification_task", + "inputParameters": { + "workflowExecutionId": "${workflow.input.workflowExecutionId}", + "providerIntegrationId": "${workflow.input.providerIntegrationId}", + "templateId": "${workflow.input.templateId}", + "notifyVariables": "${workflow.input.notifyVariables}", + "templateVariables": "${workflow.input.templateVariables}" + }, + "type": "SIMPLE", + "startDelay": 0, + "optional": true, + "asyncComplete": false, + "permissive": false + } + ] + ], + "startDelay": 0, + "optional": false, + "asyncComplete": false, + "permissive": false + }, + { + "name": "template_join", + "taskReferenceName": "temp_pSzeL9pM3AMtpm7hD-WcA_template_join", + "inputParameters": {}, + "type": "JOIN", + "startDelay": 0, + "optional": false, + "asyncComplete": false, + "permissive": false + } + ], + "inputParameters": [], + "outputParameters": {}, + "schemaVersion": 2, + "restartable": true, + "workflowStatusListenerEnabled": false, + "ownerEmail": "admin@sirenapp.io", + "timeoutSeconds": 0, + "variables": {}, + "inputTemplate": {} +} \ No newline at end of file From dcc5bdda0fffa271dc0ac7556df21f7a1a5fc056 Mon Sep 17 00:00:00 2001 From: Muhammad Date: Thu, 28 Mar 2024 11:50:08 +0530 Subject: [PATCH 2/3] feat: Create campaign workflow from SirenInitializer --- .../com/netflix/conductor/rest/startup/SirenInitializer.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/rest/src/main/java/com/netflix/conductor/rest/startup/SirenInitializer.java b/rest/src/main/java/com/netflix/conductor/rest/startup/SirenInitializer.java index f3a5a50970..7a3fc396b6 100644 --- a/rest/src/main/java/com/netflix/conductor/rest/startup/SirenInitializer.java +++ b/rest/src/main/java/com/netflix/conductor/rest/startup/SirenInitializer.java @@ -65,6 +65,9 @@ public class SirenInitializer { @Value("classpath:./siren/workflows/sirenWebhookWorkflow.json") private Resource sirenWebhookWorkflow; + @Value("classpath:./siren/workflows/sirenCampaignWorkflow.json") + private Resource sirenCampaignWorkflow; + public SirenInitializer(RestTemplateBuilder restTemplateBuilder) { this.restTemplate = restTemplateBuilder.build(); } @@ -82,6 +85,7 @@ private void createSirenResources() { headers.add(CONTENT_TYPE, APPLICATION_JSON_VALUE); createWorkflow(sirenFinalizeExecutionWorkflow, headers); createWorkflow(sirenWebhookWorkflow, headers); + createWorkflow(sirenCampaignWorkflow, headers); LOGGER.info("Siren workflows are created"); updateTask(sendNotificationTask, headers); From 257db43a3a6b54ec248da55d9587114df9f15182 Mon Sep 17 00:00:00 2001 From: Muhammad Date: Thu, 28 Mar 2024 12:30:21 +0530 Subject: [PATCH 3/3] feat: Set notification task optional value to false --- .../main/resources/siren/workflows/sirenCampaignWorkflow.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest/src/main/resources/siren/workflows/sirenCampaignWorkflow.json b/rest/src/main/resources/siren/workflows/sirenCampaignWorkflow.json index 1dff8ebd3c..b0246432ff 100644 --- a/rest/src/main/resources/siren/workflows/sirenCampaignWorkflow.json +++ b/rest/src/main/resources/siren/workflows/sirenCampaignWorkflow.json @@ -23,7 +23,7 @@ }, "type": "SIMPLE", "startDelay": 0, - "optional": true, + "optional": false, "asyncComplete": false, "permissive": false }