From 2a55336b35591afafad49412503eb39e41f28250 Mon Sep 17 00:00:00 2001 From: Igor Petrov <108870003+igpetrov@users.noreply.github.com> Date: Tue, 2 Apr 2024 19:04:25 +0300 Subject: [PATCH] chore(slack): migrate slack inbound to generator (#2279) --- .../slack-inbound-boundary.json | 330 +++++++-------- .../slack-inbound-intermediate.json | 331 +++++++-------- .../slack-inbound-message-start.json | 392 +++++++++--------- .../slack-inbound-start-event.json | 206 +++++---- connectors/slack/pom.xml | 21 + .../SlackInboundWebhookExecutable.java | 36 ++ .../inbound/model/SlackWebhookProperties.java | 35 +- 7 files changed, 692 insertions(+), 659 deletions(-) diff --git a/connectors/slack/element-templates/slack-inbound-boundary.json b/connectors/slack/element-templates/slack-inbound-boundary.json index 38c0753b3d..894021508a 100644 --- a/connectors/slack/element-templates/slack-inbound-boundary.json +++ b/connectors/slack/element-templates/slack-inbound-boundary.json @@ -1,174 +1,164 @@ { - "$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", - "name": "Slack Webhook Boundary Event Connector", - "id": "io.camunda.connectors.inbound.Slack.BoundaryEvent.v1", - "description": "Receive events from Slack", - "version": 2, - "documentationRef": "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/slack/?slack=inbound", - "category": { - "id": "connectors", - "name": "Connectors" + "$schema" : "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", + "name" : "Slack Webhook Boundary Event Connector", + "id" : "io.camunda.connectors.inbound.Slack.BoundaryEvent.v1", + "description" : "Receive events from Slack", + "documentationRef" : "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/slack/?slack=inbound", + "version" : 5, + "category" : { + "id" : "connectors", + "name" : "Connectors" }, - "appliesTo": [ - "bpmn:BoundaryEvent" - ], - "elementType": { - "value": "bpmn:BoundaryEvent", - "eventDefinition": "bpmn:MessageEventDefinition" + "appliesTo" : [ "bpmn:BoundaryEvent" ], + "elementType" : { + "value" : "bpmn:BoundaryEvent", + "eventDefinition" : "bpmn:MessageEventDefinition" }, - "groups": [ - { - "id": "endpoint", - "label": "Webhook configuration" - }, - { - "id": "activation", - "label": "Activation" - }, - { - "id": "variable-mapping", - "label": "Variable mapping" - } - ], - "properties": [ - { - "type": "Hidden", - "value": "io.camunda:slack-webhook:1", - "binding": { - "type": "zeebe:property", - "name": "inbound.type" - } - }, - { - "type": "Hidden", - "value": "SlackEventsWebhook", - "binding": { - "type": "zeebe:property", - "name": "inbound.subtype" - } - }, - { - "type": "Hidden", - "generatedValue": { - "type": "uuid" - }, - "binding": { - "type": "bpmn:Message#property", - "name": "name" - } - }, - { - "label": "Webhook ID", - "type": "String", - "group": "endpoint", - "binding": { - "type": "zeebe:property", - "name": "inbound.context" - }, - "description": "The webhook ID is a part of the URL endpoint", - "constraints": { - "notEmpty": true - } - }, - { - "label": "Slack signing secret", - "description": "Slack signing secret. See documentation regarding the Slack signing secret", - "type": "String", - "group": "endpoint", - "feel": "optional", - "binding": { - "type": "zeebe:property", - "name": "inbound.slackSigningSecret" - }, - "constraints": { - "notEmpty": true - } - }, - { - "type": "Hidden", - "value": "=if (body.type != null and body.type = \"url_verification\") then {body:{\"challenge\":body.challenge}, statusCode: 200} else null", - "binding": { - "type": "zeebe:property", - "name": "inbound.verificationExpression" - } - }, - { - "label": "Correlation key (process)", - "type": "String", - "group": "activation", - "feel": "required", - "description": "Sets up the correlation key from process variables", - "binding": { - "type": "bpmn:Message#zeebe:subscription#property", - "name": "correlationKey" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Correlation key (payload)", - "type": "String", - "group": "activation", - "feel": "required", - "binding": { - "type": "zeebe:property", - "name": "correlationKeyExpression" - }, - "description": "Extracts the correlation key from the incoming message payload", - "constraints": { - "notEmpty": true - } - }, - { - "label": "Message ID expression", - "feel": "required", - "type": "String", - "optional": true, - "group": "activation", - "binding": { - "type": "zeebe:property", - "name": "messageIdExpression" - }, - "description": "Expression to extract unique identifier of a message" - }, - { - "label": "Condition", - "type": "String", - "group": "activation", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "activationCondition" - }, - "description": "Condition under which the connector triggers. Leave empty to catch all events." - }, - { - "label": "Result variable", - "type": "String", - "group": "variable-mapping", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultVariable" - }, - "description": "Name of variable to store the result of the connector in" - }, - { - "label": "Result expression", - "type": "String", - "group": "variable-mapping", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultExpression" - }, - "description": "Expression to map the inbound payload to process variables" - } - ], - "icon": { - "contents": "data:image/svg+xml;utf8,%3Csvg%20width%3D%2218%22%20height%3D%2218%22%20%20viewBox%3D%220%200%20127%20127%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cpath%20d%3D%22M27.2%2080c0%207.3-5.9%2013.2-13.2%2013.2C6.7%2093.2.8%2087.3.8%2080c0-7.3%205.9-13.2%2013.2-13.2h13.2V80zm6.6%200c0-7.3%205.9-13.2%2013.2-13.2%207.3%200%2013.2%205.9%2013.2%2013.2v33c0%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V80z%22%20fill%3D%22%23E01E5A%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M47%2027c-7.3%200-13.2-5.9-13.2-13.2C33.8%206.5%2039.7.6%2047%20.6c7.3%200%2013.2%205.9%2013.2%2013.2V27H47zm0%206.7c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H13.9C6.6%2060.1.7%2054.2.7%2046.9c0-7.3%205.9-13.2%2013.2-13.2H47z%22%20fill%3D%22%2336C5F0%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M99.9%2046.9c0-7.3%205.9-13.2%2013.2-13.2%207.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H99.9V46.9zm-6.6%200c0%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V13.8C66.9%206.5%2072.8.6%2080.1.6c7.3%200%2013.2%205.9%2013.2%2013.2v33.1z%22%20fill%3D%22%232EB67D%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M80.1%2099.8c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V99.8h13.2zm0-6.6c-7.3%200-13.2-5.9-13.2-13.2%200-7.3%205.9-13.2%2013.2-13.2h33.1c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H80.1z%22%20fill%3D%22%23ECB22E%22%2F%3E%0A%3C%2Fsvg%3E%0A" + "groups" : [ { + "id" : "endpoint", + "label" : "Webhook configuration" + }, { + "id" : "activation", + "label" : "Activation" + }, { + "id" : "correlation", + "label" : "Correlation" + }, { + "id" : "output", + "label" : "Output mapping" + } ], + "properties" : [ { + "value" : "io.camunda:slack-webhook:1", + "binding" : { + "name" : "inbound.type", + "type" : "zeebe:property" + }, + "type" : "Hidden" + }, { + "id" : "inbound.context", + "label" : "Webhook ID", + "description" : "The webhook ID is a part of the URL endpoint", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "endpoint", + "binding" : { + "name" : "inbound.context", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "inbound.slackSigningSecret", + "label" : "Slack signing secret", + "description" : "Slack signing secret. See documentation regarding the Slack signing secret", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "endpoint", + "binding" : { + "name" : "inbound.slackSigningSecret", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "inbound.verificationExpression", + "label" : "Verification expression", + "optional" : true, + "value" : "=if (body.type != null and body.type = \"url_verification\") then {body:{\"challenge\":body.challenge}, statusCode: 200} else null", + "group" : "endpoint", + "binding" : { + "name" : "inbound.verificationExpression", + "type" : "zeebe:property" + }, + "type" : "Hidden" + }, { + "id" : "activationCondition", + "label" : "Activation condition", + "description" : "Condition under which the Connector triggers. Leave empty to catch all events", + "optional" : true, + "feel" : "required", + "group" : "activation", + "binding" : { + "name" : "activationCondition", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "correlationKeyProcess", + "label" : "Correlation key (process)", + "description" : "Sets up the correlation key from process variables", + "constraints" : { + "notEmpty" : true + }, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "correlationKey", + "type" : "bpmn:Message#zeebe:subscription#property" + }, + "type" : "String" + }, { + "id" : "correlationKeyPayload", + "label" : "Correlation key (payload)", + "description" : "Extracts the correlation key from the incoming message payload", + "constraints" : { + "notEmpty" : true + }, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "correlationKeyExpression", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "messageIdExpression", + "label" : "Message ID expression", + "description" : "Expression to extract unique identifier of a message", + "optional" : true, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "messageIdExpression", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "messageNameUuid", + "generatedValue" : { + "type" : "uuid" + }, + "group" : "correlation", + "binding" : { + "name" : "name", + "type" : "bpmn:Message#property" + }, + "type" : "Hidden" + }, { + "id" : "resultVariable", + "label" : "Result variable", + "description" : "Name of variable to store the response in", + "group" : "output", + "binding" : { + "name" : "resultVariable", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "resultExpression", + "label" : "Result expression", + "description" : "Expression to map the response into process variables", + "feel" : "required", + "group" : "output", + "binding" : { + "name" : "resultExpression", + "type" : "zeebe:property" + }, + "type" : "Text" + } ], + "icon" : { + "contents" : "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI3IiBoZWlnaHQ9IjEyNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjcuMiA4MGMwIDcuMy01LjkgMTMuMi0xMy4yIDEzLjJDNi43IDkzLjIuOCA4Ny4zLjggODBjMC03L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oMzMuMWM3LjMgMCAxMy4yIDUuOSAxMy4yIDEzLjIgMCA3LjMtNS45IDEzLjItMTMuMiAxMy4ySDgwLjF6IiBmaWxsPSIjRUNCMjJFIi8+Cjwvc3ZnPgo=" } -} +} \ No newline at end of file diff --git a/connectors/slack/element-templates/slack-inbound-intermediate.json b/connectors/slack/element-templates/slack-inbound-intermediate.json index d96e3d3bd4..0a7ccf502e 100644 --- a/connectors/slack/element-templates/slack-inbound-intermediate.json +++ b/connectors/slack/element-templates/slack-inbound-intermediate.json @@ -1,175 +1,164 @@ { - "$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", - "name": "Slack Webhook Intermediate Catch Event Connector", - "id": "io.camunda.connectors.inbound.Slack.IntermediateCatchEvent.v1", - "description": "Receive events from Slack", - "version": 4, - "documentationRef": "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/slack/?slack=inbound", - "category": { - "id": "connectors", - "name": "Connectors" + "$schema" : "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", + "name" : "Slack Webhook Intermediate Catch Event Connector", + "id" : "io.camunda.connectors.inbound.Slack.IntermediateCatchEvent.v1", + "description" : "Receive events from Slack", + "documentationRef" : "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/slack/?slack=inbound", + "version" : 5, + "category" : { + "id" : "connectors", + "name" : "Connectors" }, - "appliesTo": [ - "bpmn:IntermediateCatchEvent", - "bpmn:IntermediateThrowEvent" - ], - "elementType": { - "value": "bpmn:IntermediateCatchEvent", - "eventDefinition": "bpmn:MessageEventDefinition" + "appliesTo" : [ "bpmn:IntermediateCatchEvent", "bpmn:IntermediateThrowEvent" ], + "elementType" : { + "value" : "bpmn:IntermediateCatchEvent", + "eventDefinition" : "bpmn:MessageEventDefinition" }, - "groups": [ - { - "id": "endpoint", - "label": "Webhook configuration" - }, - { - "id": "activation", - "label": "Activation" - }, - { - "id": "variable-mapping", - "label": "Variable mapping" - } - ], - "properties": [ - { - "type": "Hidden", - "value": "io.camunda:slack-webhook:1", - "binding": { - "type": "zeebe:property", - "name": "inbound.type" - } - }, - { - "type": "Hidden", - "value": "SlackEventsWebhook", - "binding": { - "type": "zeebe:property", - "name": "inbound.subtype" - } - }, - { - "type": "Hidden", - "generatedValue": { - "type": "uuid" - }, - "binding": { - "type": "bpmn:Message#property", - "name": "name" - } - }, - { - "label": "Webhook ID", - "type": "String", - "group": "endpoint", - "binding": { - "type": "zeebe:property", - "name": "inbound.context" - }, - "description": "The webhook ID is a part of the URL endpoint", - "constraints": { - "notEmpty": true - } - }, - { - "label": "Slack signing secret", - "description": "Slack signing secret. See documentation regarding the Slack signing secret", - "type": "String", - "group": "endpoint", - "feel": "optional", - "binding": { - "type": "zeebe:property", - "name": "inbound.slackSigningSecret" - }, - "constraints": { - "notEmpty": true - } - }, - { - "type": "Hidden", - "value": "=if (body.type != null and body.type = \"url_verification\") then {body:{\"challenge\":body.challenge}, statusCode: 200} else null", - "binding": { - "type": "zeebe:property", - "name": "inbound.verificationExpression" - } - }, - { - "label": "Correlation key (process)", - "type": "String", - "group": "activation", - "feel": "required", - "description": "Sets up the correlation key from process variables", - "binding": { - "type": "bpmn:Message#zeebe:subscription#property", - "name": "correlationKey" - }, - "constraints": { - "notEmpty": true - } - }, - { - "label": "Correlation key (payload)", - "type": "String", - "group": "activation", - "feel": "required", - "binding": { - "type": "zeebe:property", - "name": "correlationKeyExpression" - }, - "description": "Extracts the correlation key from the incoming message payload", - "constraints": { - "notEmpty": true - } - }, - { - "label": "Message ID expression", - "feel": "required", - "type": "String", - "optional": true, - "group": "activation", - "binding": { - "type": "zeebe:property", - "name": "messageIdExpression" - }, - "description": "Expression to extract unique identifier of a message" - }, - { - "label": "Condition", - "type": "String", - "group": "activation", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "activationCondition" - }, - "description": "Condition under which the connector triggers. Leave empty to catch all events." - }, - { - "label": "Result variable", - "type": "String", - "group": "variable-mapping", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultVariable" - }, - "description": "Name of variable to store the result of the connector in" - }, - { - "label": "Result expression", - "type": "String", - "group": "variable-mapping", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultExpression" - }, - "description": "Expression to map the inbound payload to process variables" - } - ], - "icon": { - "contents": "data:image/svg+xml;utf8,%3Csvg%20width%3D%2218%22%20height%3D%2218%22%20%20viewBox%3D%220%200%20127%20127%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cpath%20d%3D%22M27.2%2080c0%207.3-5.9%2013.2-13.2%2013.2C6.7%2093.2.8%2087.3.8%2080c0-7.3%205.9-13.2%2013.2-13.2h13.2V80zm6.6%200c0-7.3%205.9-13.2%2013.2-13.2%207.3%200%2013.2%205.9%2013.2%2013.2v33c0%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V80z%22%20fill%3D%22%23E01E5A%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M47%2027c-7.3%200-13.2-5.9-13.2-13.2C33.8%206.5%2039.7.6%2047%20.6c7.3%200%2013.2%205.9%2013.2%2013.2V27H47zm0%206.7c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H13.9C6.6%2060.1.7%2054.2.7%2046.9c0-7.3%205.9-13.2%2013.2-13.2H47z%22%20fill%3D%22%2336C5F0%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M99.9%2046.9c0-7.3%205.9-13.2%2013.2-13.2%207.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H99.9V46.9zm-6.6%200c0%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V13.8C66.9%206.5%2072.8.6%2080.1.6c7.3%200%2013.2%205.9%2013.2%2013.2v33.1z%22%20fill%3D%22%232EB67D%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M80.1%2099.8c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V99.8h13.2zm0-6.6c-7.3%200-13.2-5.9-13.2-13.2%200-7.3%205.9-13.2%2013.2-13.2h33.1c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H80.1z%22%20fill%3D%22%23ECB22E%22%2F%3E%0A%3C%2Fsvg%3E%0A" + "groups" : [ { + "id" : "endpoint", + "label" : "Webhook configuration" + }, { + "id" : "activation", + "label" : "Activation" + }, { + "id" : "correlation", + "label" : "Correlation" + }, { + "id" : "output", + "label" : "Output mapping" + } ], + "properties" : [ { + "value" : "io.camunda:slack-webhook:1", + "binding" : { + "name" : "inbound.type", + "type" : "zeebe:property" + }, + "type" : "Hidden" + }, { + "id" : "inbound.context", + "label" : "Webhook ID", + "description" : "The webhook ID is a part of the URL endpoint", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "endpoint", + "binding" : { + "name" : "inbound.context", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "inbound.slackSigningSecret", + "label" : "Slack signing secret", + "description" : "Slack signing secret. See documentation regarding the Slack signing secret", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "endpoint", + "binding" : { + "name" : "inbound.slackSigningSecret", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "inbound.verificationExpression", + "label" : "Verification expression", + "optional" : true, + "value" : "=if (body.type != null and body.type = \"url_verification\") then {body:{\"challenge\":body.challenge}, statusCode: 200} else null", + "group" : "endpoint", + "binding" : { + "name" : "inbound.verificationExpression", + "type" : "zeebe:property" + }, + "type" : "Hidden" + }, { + "id" : "activationCondition", + "label" : "Activation condition", + "description" : "Condition under which the Connector triggers. Leave empty to catch all events", + "optional" : true, + "feel" : "required", + "group" : "activation", + "binding" : { + "name" : "activationCondition", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "correlationKeyProcess", + "label" : "Correlation key (process)", + "description" : "Sets up the correlation key from process variables", + "constraints" : { + "notEmpty" : true + }, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "correlationKey", + "type" : "bpmn:Message#zeebe:subscription#property" + }, + "type" : "String" + }, { + "id" : "correlationKeyPayload", + "label" : "Correlation key (payload)", + "description" : "Extracts the correlation key from the incoming message payload", + "constraints" : { + "notEmpty" : true + }, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "correlationKeyExpression", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "messageIdExpression", + "label" : "Message ID expression", + "description" : "Expression to extract unique identifier of a message", + "optional" : true, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "messageIdExpression", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "messageNameUuid", + "generatedValue" : { + "type" : "uuid" + }, + "group" : "correlation", + "binding" : { + "name" : "name", + "type" : "bpmn:Message#property" + }, + "type" : "Hidden" + }, { + "id" : "resultVariable", + "label" : "Result variable", + "description" : "Name of variable to store the response in", + "group" : "output", + "binding" : { + "name" : "resultVariable", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "resultExpression", + "label" : "Result expression", + "description" : "Expression to map the response into process variables", + "feel" : "required", + "group" : "output", + "binding" : { + "name" : "resultExpression", + "type" : "zeebe:property" + }, + "type" : "Text" + } ], + "icon" : { + "contents" : "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI3IiBoZWlnaHQ9IjEyNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjcuMiA4MGMwIDcuMy01LjkgMTMuMi0xMy4yIDEzLjJDNi43IDkzLjIuOCA4Ny4zLjggODBjMC03LjMgNS45LTEzLjIgMTMuMi0xMy4yaDEzLjJWODB6bTYuNiAwYzAtNy4zIDUuOS0xMy4yIDEzLjItMTMuMiA3LjMgMCAxMy4yIDUuOSAxMy4yIDEzLjJ2MzNjMCA3L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} \ No newline at end of file diff --git a/connectors/slack/element-templates/slack-inbound-message-start.json b/connectors/slack/element-templates/slack-inbound-message-start.json index a1d5ec13b2..61c7211ffa 100644 --- a/connectors/slack/element-templates/slack-inbound-message-start.json +++ b/connectors/slack/element-templates/slack-inbound-message-start.json @@ -1,208 +1,192 @@ { - "$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", - "name": "Slack Webhook Message Start Event Connector", - "id": "io.camunda.connectors.inbound.Slack.MessageStartEvent.v1", - "description": "Receive events from Slack", - "version": 2, - "documentationRef": "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/slack/?slack=inbound", - "category": { - "id": "connectors", - "name": "Connectors" + "$schema" : "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", + "name" : "Slack Webhook Message Start Event Connector", + "id" : "io.camunda.connectors.inbound.Slack.MessageStartEvent.v1", + "description" : "Receive events from Slack", + "documentationRef" : "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/slack/?slack=inbound", + "version" : 5, + "category" : { + "id" : "connectors", + "name" : "Connectors" }, - "appliesTo": [ - "bpmn:StartEvent" - ], - "elementType": { - "value": "bpmn:StartEvent", - "eventDefinition": "bpmn:MessageEventDefinition" + "appliesTo" : [ "bpmn:StartEvent" ], + "elementType" : { + "value" : "bpmn:StartEvent", + "eventDefinition" : "bpmn:MessageEventDefinition" }, - "groups": [ - { - "id": "endpoint", - "label": "Webhook configuration" - }, - { - "id": "activation", - "label": "Activation" - }, - { - "id": "correlation", - "label": "Subprocess correlation" - }, - { - "id": "variable-mapping", - "label": "Variable mapping" - } - ], - "properties": [ - { - "type": "Hidden", - "value": "io.camunda:slack-webhook:1", - "binding": { - "type": "zeebe:property", - "name": "inbound.type" - } - }, - { - "type": "Hidden", - "value": "SlackEventsWebhook", - "binding": { - "type": "zeebe:property", - "name": "inbound.subtype" - } - }, - { - "type": "Hidden", - "generatedValue": { - "type": "uuid" - }, - "binding": { - "type": "bpmn:Message#property", - "name": "name" - } - }, - { - "label": "Webhook ID", - "type": "String", - "group": "endpoint", - "binding": { - "type": "zeebe:property", - "name": "inbound.context" - }, - "description": "The webhook ID is a part of the URL endpoint", - "constraints": { - "notEmpty": true - } - }, - { - "label": "Slack signing secret", - "description": "Slack signing secret. See documentation regarding the Slack signing secret", - "type": "String", - "group": "endpoint", - "feel": "optional", - "binding": { - "type": "zeebe:property", - "name": "inbound.slackSigningSecret" - }, - "constraints": { - "notEmpty": true - } - }, - { - "type": "Hidden", - "value": "=if (body.type != null and body.type = \"url_verification\") then {body:{\"challenge\":body.challenge}, statusCode: 200} else null", - "binding": { - "type": "zeebe:property", - "name": "inbound.verificationExpression" - } - }, - { - "label": "Message ID expression", - "feel": "required", - "type": "String", - "optional": true, - "group": "activation", - "binding": { - "type": "zeebe:property", - "name": "messageIdExpression" - }, - "description": "Expression to extract unique identifier of a message" - }, - { - "label": "Condition", - "type": "String", - "group": "activation", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "activationCondition" - }, - "description": "Condition under which the connector triggers. Leave empty to catch all events." - }, - { - "label": "Correlation required", - "description": "Indicates whether correlation is required. This is needed for event-based subprocess message start events", - "id": "correlationRequired", - "group": "correlation", - "type": "Dropdown", - "value": "notRequired", - "choices": [ - { - "name": "Correlation not required", - "value": "notRequired" - }, - { - "name": "Correlation required", - "value": "required" - } - ], - "binding": { - "type": "zeebe:property", - "name": "correlationRequired" - } - }, - { - "label": "Correlation key (process)", - "type": "String", - "group": "correlation", - "feel": "required", - "description": "Sets up the correlation key from process variables", - "binding": { - "type": "bpmn:Message#zeebe:subscription#property", - "name": "correlationKey" - }, - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "correlationRequired", - "equals": "required" - } - }, - { - "label": "Correlation key (payload)", - "type": "String", - "group": "correlation", - "feel": "required", - "binding": { - "type": "zeebe:property", - "name": "correlationKeyExpression" - }, - "description": "Extracts the correlation key from the incoming message payload", - "constraints": { - "notEmpty": true - }, - "condition": { - "property": "correlationRequired", - "equals": "required" - } - }, - { - "label": "Result variable", - "type": "String", - "group": "variable-mapping", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultVariable" - }, - "description": "Name of variable to store the result of the connector in" - }, - { - "label": "Result expression", - "type": "String", - "group": "variable-mapping", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultExpression" - }, - "description": "Expression to map the inbound payload to process variables" - } - ], - "icon": { - "contents": "data:image/svg+xml;utf8,%3Csvg%20width%3D%2218%22%20height%3D%2218%22%20%20viewBox%3D%220%200%20127%20127%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cpath%20d%3D%22M27.2%2080c0%207.3-5.9%2013.2-13.2%2013.2C6.7%2093.2.8%2087.3.8%2080c0-7.3%205.9-13.2%2013.2-13.2h13.2V80zm6.6%200c0-7.3%205.9-13.2%2013.2-13.2%207.3%200%2013.2%205.9%2013.2%2013.2v33c0%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V80z%22%20fill%3D%22%23E01E5A%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M47%2027c-7.3%200-13.2-5.9-13.2-13.2C33.8%206.5%2039.7.6%2047%20.6c7.3%200%2013.2%205.9%2013.2%2013.2V27H47zm0%206.7c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H13.9C6.6%2060.1.7%2054.2.7%2046.9c0-7.3%205.9-13.2%2013.2-13.2H47z%22%20fill%3D%22%2336C5F0%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M99.9%2046.9c0-7.3%205.9-13.2%2013.2-13.2%207.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H99.9V46.9zm-6.6%200c0%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V13.8C66.9%206.5%2072.8.6%2080.1.6c7.3%200%2013.2%205.9%2013.2%2013.2v33.1z%22%20fill%3D%22%232EB67D%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M80.1%2099.8c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V99.8h13.2zm0-6.6c-7.3%200-13.2-5.9-13.2-13.2%200-7.3%205.9-13.2%2013.2-13.2h33.1c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H80.1z%22%20fill%3D%22%23ECB22E%22%2F%3E%0A%3C%2Fsvg%3E%0A" + "groups" : [ { + "id" : "endpoint", + "label" : "Webhook configuration" + }, { + "id" : "activation", + "label" : "Activation" + }, { + "id" : "correlation", + "label" : "Correlation" + }, { + "id" : "output", + "label" : "Output mapping" + } ], + "properties" : [ { + "value" : "io.camunda:slack-webhook:1", + "binding" : { + "name" : "inbound.type", + "type" : "zeebe:property" + }, + "type" : "Hidden" + }, { + "id" : "inbound.context", + "label" : "Webhook ID", + "description" : "The webhook ID is a part of the URL endpoint", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "endpoint", + "binding" : { + "name" : "inbound.context", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "inbound.slackSigningSecret", + "label" : "Slack signing secret", + "description" : "Slack signing secret. See documentation regarding the Slack signing secret", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "group" : "endpoint", + "binding" : { + "name" : "inbound.slackSigningSecret", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "inbound.verificationExpression", + "label" : "Verification expression", + "optional" : true, + "value" : "=if (body.type != null and body.type = \"url_verification\") then {body:{\"challenge\":body.challenge}, statusCode: 200} else null", + "group" : "endpoint", + "binding" : { + "name" : "inbound.verificationExpression", + "type" : "zeebe:property" + }, + "type" : "Hidden" + }, { + "id" : "activationCondition", + "label" : "Activation condition", + "description" : "Condition under which the Connector triggers. Leave empty to catch all events", + "optional" : true, + "feel" : "required", + "group" : "activation", + "binding" : { + "name" : "activationCondition", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "correlationRequired", + "label" : "Subprocess correlation required", + "description" : "Indicates whether correlation is required. This is needed for event-based subprocess message start events", + "value" : "notRequired", + "group" : "correlation", + "binding" : { + "name" : "correlationRequired", + "type" : "zeebe:property" + }, + "type" : "Dropdown", + "choices" : [ { + "name" : "Correlation not required", + "value" : "notRequired" + }, { + "name" : "Correlation required", + "value" : "required" + } ] + }, { + "id" : "correlationKeyProcess", + "label" : "Correlation key (process)", + "description" : "Sets up the correlation key from process variables", + "constraints" : { + "notEmpty" : true + }, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "correlationKey", + "type" : "bpmn:Message#zeebe:subscription#property" + }, + "condition" : { + "property" : "correlationRequired", + "equals" : "required", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "correlationKeyPayload", + "label" : "Correlation key (payload)", + "description" : "Extracts the correlation key from the incoming message payload", + "constraints" : { + "notEmpty" : true + }, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "correlationKeyExpression", + "type" : "zeebe:property" + }, + "condition" : { + "property" : "correlationRequired", + "equals" : "required", + "type" : "simple" + }, + "type" : "String" + }, { + "id" : "messageIdExpression", + "label" : "Message ID expression", + "description" : "Expression to extract unique identifier of a message", + "optional" : true, + "feel" : "required", + "group" : "correlation", + "binding" : { + "name" : "messageIdExpression", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "messageNameUuid", + "generatedValue" : { + "type" : "uuid" + }, + "group" : "correlation", + "binding" : { + "name" : "name", + "type" : "bpmn:Message#property" + }, + "type" : "Hidden" + }, { + "id" : "resultVariable", + "label" : "Result variable", + "description" : "Name of variable to store the response in", + "group" : "output", + "binding" : { + "name" : "resultVariable", + "type" : "zeebe:property" + }, + "type" : "String" + }, { + "id" : "resultExpression", + "label" : "Result expression", + "description" : "Expression to map the response into process variables", + "feel" : "required", + "group" : "output", + "binding" : { + "name" : "resultExpression", + "type" : "ze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bGw9IiMyRUI2N0QiLz4KICA8cGF0aCBkPSJNODAuMSA5OS44YzcuMyAwIDEzLjIgNS45IDEzLjIgMTMuMiAwIDcuMy01LjkgMTMuMi0xMy4yIDEzLjItNy4zIDAtMTMuMi01LjktMTMuMi0xMy4yVjk5LjhoMTMuMnptMC02LjZjLTcuMyAwLTEzLjItNS45LTEzLjItMTMuMiAwLTcuMyA1LjktMTMuMiAxMy4yLTEzLjJoMzMuMWM3LjMgMCAxMy4yIDUuOSAxMy4yIDEzLjIgMCA3LjMtNS45IDEzLjItMTMuMiAxMy4ySDgwLjF6IiBmaWxsPSIjRUNCMjJFIi8+Cjwvc3ZnPgo=" } -} +} \ No newline at end of file diff --git a/connectors/slack/element-templates/slack-inbound-start-event.json b/connectors/slack/element-templates/slack-inbound-start-event.json index 14ec32132f..38ca7f76c4 100644 --- a/connectors/slack/element-templates/slack-inbound-start-event.json +++ b/connectors/slack/element-templates/slack-inbound-start-event.json @@ -1,123 +1,109 @@ { - "$schema": "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", - "name": "Slack Webhook Start Event Connector", - "id": "io.camunda.connectors.inbound.Slack.StartEvent.v1", - "description": "Receive events from Slack", - "version": 3, - "documentationRef": "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/slack/?slack=inbound", - "category": { - "id": "connectors", - "name": "Connectors" + "$schema" : "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", + "name" : "Slack Webhook Start Event Connector", + "id" : "io.camunda.connectors.inbound.Slack.StartEvent.v1", + "description" : "Receive events from Slack", + "documentationRef" : "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/slack/?slack=inbound", + "version" : 5, + "category" : { + "id" : "connectors", + "name" : "Connectors" }, - "appliesTo": [ - "bpmn:StartEvent" - ], - "elementType": { - "value": "bpmn:StartEvent" + "appliesTo" : [ "bpmn:StartEvent" ], + "elementType" : { + "value" : "bpmn:StartEvent" }, - "groups": [ - { - "id": "endpoint", - "label": "Webhook configuration" + "groups" : [ { + "id" : "endpoint", + "label" : "Webhook configuration" + }, { + "id" : "activation", + "label" : "Activation" + }, { + "id" : "output", + "label" : "Output mapping" + } ], + "properties" : [ { + "value" : "io.camunda:slack-webhook:1", + "binding" : { + "name" : "inbound.type", + "type" : "zeebe:property" }, - { - "id": "activation", - "label": "Activation" + "type" : "Hidden" + }, { + "id" : "inbound.context", + "label" : "Webhook ID", + "description" : "The webhook ID is a part of the URL endpoint", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "id": "variable-mapping", - "label": "Variable mapping" - } - ], - "properties": [ - { - "type": "Hidden", - "value": "io.camunda:slack-webhook:1", - "binding": { - "type": "zeebe:property", - "name": "inbound.type" - } + "group" : "endpoint", + "binding" : { + "name" : "inbound.context", + "type" : "zeebe:property" }, - { - "type": "Hidden", - "value": "SlackEventsWebhook", - "binding": { - "type": "zeebe:property", - "name": "inbound.subtype" - } + "type" : "String" + }, { + "id" : "inbound.slackSigningSecret", + "label" : "Slack signing secret", + "description" : "Slack signing secret. See documentation regarding the Slack signing secret", + "optional" : false, + "constraints" : { + "notEmpty" : true }, - { - "label": "Webhook ID", - "type": "String", - "group": "endpoint", - "binding": { - "type": "zeebe:property", - "name": "inbound.context" - }, - "description": "The webhook ID is a part of the URL endpoint", - "constraints": { - "notEmpty": true - } + "group" : "endpoint", + "binding" : { + "name" : "inbound.slackSigningSecret", + "type" : "zeebe:property" }, - { - "label": "Slack signing secret", - "description": "Slack signing secret. See documentation regarding the Slack signing secret", - "type": "String", - "group": "endpoint", - "feel": "optional", - "binding": { - "type": "zeebe:property", - "name": "inbound.slackSigningSecret" - }, - "constraints": { - "notEmpty": true - } + "type" : "String" + }, { + "id" : "inbound.verificationExpression", + "label" : "Verification expression", + "optional" : true, + "value" : "=if (body.type != null and body.type = \"url_verification\") then {body:{\"challenge\":body.challenge}, statusCode: 200} else null", + "group" : "endpoint", + "binding" : { + "name" : "inbound.verificationExpression", + "type" : "zeebe:property" }, - { - "type": "Hidden", - "value": "=if (body.type != null and body.type = \"url_verification\") then {body:{\"challenge\":body.challenge}, statusCode: 200} else null", - "binding": { - "type": "zeebe:property", - "name": "inbound.verificationExpression" - } + "type" : "Hidden" + }, { + "id" : "activationCondition", + "label" : "Activation condition", + "description" : "Condition under which the Connector triggers. Leave empty to catch all events", + "optional" : true, + "feel" : "required", + "group" : "activation", + "binding" : { + "name" : "activationCondition", + "type" : "zeebe:property" }, - { - "label": "Condition", - "type": "String", - "group": "activation", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "activationCondition" - }, - "description": "Condition under which the connector triggers. Leave empty to catch all events." + "type" : "String" + }, { + "id" : "resultVariable", + "label" : "Result variable", + "description" : "Name of variable to store the response in", + "group" : "output", + "binding" : { + "name" : "resultVariable", + "type" : "zeebe:property" }, - { - "label": "Result variable", - "type": "String", - "group": "variable-mapping", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultVariable" - }, - "description": "Name of variable to store the result of the connector in" + "type" : "String" + }, { + "id" : "resultExpression", + "label" : "Result expression", + "description" : "Expression to map the response into process variables", + "feel" : "required", + "group" : "output", + "binding" : { + "name" : "resultExpression", + "type" : "zeebe:property" }, - { - "label": "Result expression", - "type": "String", - "group": "variable-mapping", - "feel": "required", - "optional": true, - "binding": { - "type": "zeebe:property", - "name": "resultExpression" - }, - "description": "Expression to map the inbound payload to process variables" - } - ], - "icon": { - "contents": "data:image/svg+xml;utf8,%3Csvg%20width%3D%2218%22%20height%3D%2218%22%20%20viewBox%3D%220%200%20127%20127%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Cpath%20d%3D%22M27.2%2080c0%207.3-5.9%2013.2-13.2%2013.2C6.7%2093.2.8%2087.3.8%2080c0-7.3%205.9-13.2%2013.2-13.2h13.2V80zm6.6%200c0-7.3%205.9-13.2%2013.2-13.2%207.3%200%2013.2%205.9%2013.2%2013.2v33c0%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V80z%22%20fill%3D%22%23E01E5A%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M47%2027c-7.3%200-13.2-5.9-13.2-13.2C33.8%206.5%2039.7.6%2047%20.6c7.3%200%2013.2%205.9%2013.2%2013.2V27H47zm0%206.7c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H13.9C6.6%2060.1.7%2054.2.7%2046.9c0-7.3%205.9-13.2%2013.2-13.2H47z%22%20fill%3D%22%2336C5F0%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M99.9%2046.9c0-7.3%205.9-13.2%2013.2-13.2%207.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H99.9V46.9zm-6.6%200c0%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V13.8C66.9%206.5%2072.8.6%2080.1.6c7.3%200%2013.2%205.9%2013.2%2013.2v33.1z%22%20fill%3D%22%232EB67D%22%2F%3E%0A%20%20%3Cpath%20d%3D%22M80.1%2099.8c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2-7.3%200-13.2-5.9-13.2-13.2V99.8h13.2zm0-6.6c-7.3%200-13.2-5.9-13.2-13.2%200-7.3%205.9-13.2%2013.2-13.2h33.1c7.3%200%2013.2%205.9%2013.2%2013.2%200%207.3-5.9%2013.2-13.2%2013.2H80.1z%22%20fill%3D%22%23ECB22E%22%2F%3E%0A%3C%2Fsvg%3E%0A" + "type" : "Text" + } ], + "icon" : { + "contents" : "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI3IiBoZWlnaHQ9IjEyNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjcuMiA4MGMwIDcuMy01LjkgMTMuMi0xMy4yIDEzLjJDNi43IDkzLjIuOCA4Ny4zLjggODBjMC03LjMg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MuMWM3LjMgMCAxMy4yIDUuOSAxMy4yIDEzLjIgMCA3LjMtNS45IDEzLjItMTMuMiAxMy4ySDgwLjF6IiBmaWxsPSIjRUNCMjJFIi8+Cjwvc3ZnPgo=" } -} +} \ No newline at end of file diff --git a/connectors/slack/pom.xml b/connectors/slack/pom.xml index c869071c28..2981a0fbde 100644 --- a/connectors/slack/pom.xml +++ b/connectors/slack/pom.xml @@ -76,6 +76,27 @@ true + + io.camunda.connector.slack.inbound.SlackInboundWebhookExecutable + + + io.camunda.connectors.inbound.Slack.StartEvent.v1 + slack-inbound-start-event.json + + + io.camunda.connectors.inbound.Slack.MessageStartEvent.v1 + slack-inbound-message-start.json + + + io.camunda.connectors.inbound.Slack.IntermediateCatchEvent.v1 + slack-inbound-intermediate.json + + + io.camunda.connectors.inbound.Slack.BoundaryEvent.v1 + slack-inbound-boundary.json + + + diff --git a/connectors/slack/src/main/java/io/camunda/connector/slack/inbound/SlackInboundWebhookExecutable.java b/connectors/slack/src/main/java/io/camunda/connector/slack/inbound/SlackInboundWebhookExecutable.java index 78859aed09..3071c59622 100644 --- a/connectors/slack/src/main/java/io/camunda/connector/slack/inbound/SlackInboundWebhookExecutable.java +++ b/connectors/slack/src/main/java/io/camunda/connector/slack/inbound/SlackInboundWebhookExecutable.java @@ -18,6 +18,10 @@ import io.camunda.connector.api.inbound.webhook.WebhookProcessingPayload; import io.camunda.connector.api.inbound.webhook.WebhookResult; import io.camunda.connector.api.json.ConnectorsObjectMapperSupplier; +import io.camunda.connector.generator.dsl.BpmnType; +import io.camunda.connector.generator.java.annotation.ElementTemplate; +import io.camunda.connector.generator.java.annotation.ElementTemplate.ConnectorElementType; +import io.camunda.connector.generator.java.annotation.ElementTemplate.PropertyGroup; import io.camunda.connector.slack.inbound.model.SlackWebhookProcessingResult; import io.camunda.connector.slack.inbound.model.SlackWebhookProperties; import io.camunda.connector.slack.inbound.model.SlackWebhookProperties.SlackConnectorPropertiesWrapper; @@ -33,6 +37,38 @@ import java.util.stream.Collectors; @InboundConnector(name = "Slack Inbound", type = "io.camunda:slack-webhook:1") +@ElementTemplate( + id = "io.camunda.connectors.inbound.Slack.v1", + name = "Slack Webhook Boundary Event Connector", + icon = "icon.svg", + version = 5, + inputDataClass = SlackConnectorPropertiesWrapper.class, + description = "Receive events from Slack", + documentationRef = + "https://docs.camunda.io/docs/components/connectors/out-of-the-box-connectors/slack/?slack=inbound", + propertyGroups = {@PropertyGroup(id = "endpoint", label = "Webhook configuration")}, + elementTypes = { + @ConnectorElementType( + appliesTo = BpmnType.START_EVENT, + elementType = BpmnType.START_EVENT, + templateIdOverride = "io.camunda.connectors.inbound.Slack.StartEvent.v1", + templateNameOverride = "Slack Webhook Start Event Connector"), + @ConnectorElementType( + appliesTo = BpmnType.START_EVENT, + elementType = BpmnType.MESSAGE_START_EVENT, + templateIdOverride = "io.camunda.connectors.inbound.Slack.MessageStartEvent.v1", + templateNameOverride = "Slack Webhook Message Start Event Connector"), + @ConnectorElementType( + appliesTo = {BpmnType.INTERMEDIATE_THROW_EVENT, BpmnType.INTERMEDIATE_CATCH_EVENT}, + elementType = BpmnType.INTERMEDIATE_CATCH_EVENT, + templateIdOverride = "io.camunda.connectors.inbound.Slack.IntermediateCatchEvent.v1", + templateNameOverride = "Slack Webhook Intermediate Catch Event Connector"), + @ConnectorElementType( + appliesTo = BpmnType.BOUNDARY_EVENT, + elementType = BpmnType.BOUNDARY_EVENT, + templateIdOverride = "io.camunda.connectors.inbound.Slack.BoundaryEvent.v1", + templateNameOverride = "Slack Webhook Boundary Event Connector") + }) public class SlackInboundWebhookExecutable implements WebhookConnectorExecutable, VerifiableWebhook { diff --git a/connectors/slack/src/main/java/io/camunda/connector/slack/inbound/model/SlackWebhookProperties.java b/connectors/slack/src/main/java/io/camunda/connector/slack/inbound/model/SlackWebhookProperties.java index 22b0505e36..68705cb49d 100644 --- a/connectors/slack/src/main/java/io/camunda/connector/slack/inbound/model/SlackWebhookProperties.java +++ b/connectors/slack/src/main/java/io/camunda/connector/slack/inbound/model/SlackWebhookProperties.java @@ -8,14 +8,41 @@ import com.slack.api.app_backend.SlackSignature; import io.camunda.connector.api.inbound.webhook.VerifiableWebhook; +import io.camunda.connector.generator.dsl.Property; +import io.camunda.connector.generator.java.annotation.TemplateProperty; +import io.camunda.connector.generator.java.annotation.TemplateProperty.PropertyType; +import jakarta.validation.constraints.NotBlank; import java.util.Map; import java.util.function.Function; public record SlackWebhookProperties( - String context, - String slackSigningSecret, - Function, VerifiableWebhook.WebhookHttpVerificationResult> - verificationExpression) { + @TemplateProperty( + id = "context", + label = "Webhook ID", + group = "endpoint", + description = "The webhook ID is a part of the URL endpoint", + feel = Property.FeelMode.disabled) + @NotBlank + String context, + @TemplateProperty( + id = "slackSigningSecret", + label = "Slack signing secret", + group = "endpoint", + description = + "Slack signing secret. See documentation regarding the Slack signing secret", + feel = Property.FeelMode.disabled) + @NotBlank + String slackSigningSecret, + @TemplateProperty( + id = "verificationExpression", + group = "endpoint", + type = PropertyType.Hidden, + feel = Property.FeelMode.disabled, + optional = true, + defaultValue = + "=if (body.type != null and body.type = \"url_verification\") then {body:{\"challenge\":body.challenge}, statusCode: 200} else null") + Function, VerifiableWebhook.WebhookHttpVerificationResult> + verificationExpression) { public SlackWebhookProperties(SlackConnectorPropertiesWrapper wrapper) { this( wrapper.inbound.context,