diff --git a/element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/BpmnType.java b/element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/BpmnType.java index 88575b74e2..a3312d7652 100644 --- a/element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/BpmnType.java +++ b/element-template-generator/core/src/main/java/io/camunda/connector/generator/dsl/BpmnType.java @@ -24,6 +24,7 @@ public enum BpmnType { SERVICE_TASK("bpmn:ServiceTask", false, "ServiceTask"), RECEIVE_TASK("bpmn:ReceiveTask", true, "ReceiveTask"), SCRIPT_TASK("bpmn:ScriptTask", false, "ScriptTask"), + SEND_TASK("bpmn:SendTask", false, "SendTask"), START_EVENT("bpmn:StartEvent", false, "StartEvent"), INTERMEDIATE_CATCH_EVENT("bpmn:IntermediateCatchEvent", true, "IntermediateCatchEvent"), INTERMEDIATE_THROW_EVENT("bpmn:IntermediateThrowEvent", true, "IntermediateThrowEvent"), diff --git a/element-template-generator/core/src/main/java/io/camunda/connector/generator/java/util/TemplateGenerationContextUtil.java b/element-template-generator/core/src/main/java/io/camunda/connector/generator/java/util/TemplateGenerationContextUtil.java index 42d1d11582..e5c7f08a5c 100644 --- a/element-template-generator/core/src/main/java/io/camunda/connector/generator/java/util/TemplateGenerationContextUtil.java +++ b/element-template-generator/core/src/main/java/io/camunda/connector/generator/java/util/TemplateGenerationContextUtil.java @@ -30,6 +30,7 @@ public class TemplateGenerationContextUtil { private static final Set OUTBOUND_SUPPORTED_ELEMENT_TYPES = Set.of( BpmnType.SERVICE_TASK, + BpmnType.SEND_TASK, BpmnType.INTERMEDIATE_THROW_EVENT, BpmnType.SCRIPT_TASK, BpmnType.MESSAGE_END_EVENT); diff --git a/element-template-generator/core/src/test/java/io/camunda/connector/generator/dsl/ElementTypeSupportTest.java b/element-template-generator/core/src/test/java/io/camunda/connector/generator/dsl/ElementTypeSupportTest.java index be4f14da1a..ecbab39490 100644 --- a/element-template-generator/core/src/test/java/io/camunda/connector/generator/dsl/ElementTypeSupportTest.java +++ b/element-template-generator/core/src/test/java/io/camunda/connector/generator/dsl/ElementTypeSupportTest.java @@ -72,6 +72,21 @@ void scriptTask() { assertThat(template.elementType().eventDefinition()).isNull(); } + @Test + void sendTask() { + ElementTemplate template = + ElementTemplateBuilder.createOutbound() + .id("id") + .name("name") + .type("type", false) + .appliesTo(BpmnType.TASK) + .elementType(BpmnType.SEND_TASK) + .build(); + assertThat(template.appliesTo()).containsExactly(BpmnType.TASK.getName()); + assertThat(template.elementType().value()).isEqualTo(BpmnType.SEND_TASK.getName()); + assertThat(template.elementType().eventDefinition()).isNull(); + } + @Test void messageEndEvent() { ElementTemplate template = diff --git a/element-template-generator/core/src/test/java/io/camunda/connector/generator/java/OutboundClassBasedTemplateGeneratorTest.java b/element-template-generator/core/src/test/java/io/camunda/connector/generator/java/OutboundClassBasedTemplateGeneratorTest.java index 692cb01934..da53a3d0d1 100644 --- a/element-template-generator/core/src/test/java/io/camunda/connector/generator/java/OutboundClassBasedTemplateGeneratorTest.java +++ b/element-template-generator/core/src/test/java/io/camunda/connector/generator/java/OutboundClassBasedTemplateGeneratorTest.java @@ -223,6 +223,7 @@ void multipleElementTypes_definedInAnnotation() { generator.generate(MyConnectorFunction.WithMultipleElementTypes.class, config); boolean hasServiceTask = false, hasScriptTask = false, + hasSendTask = false, hasMessageThrowEvent = false, hasMessageEndEvent = false; for (var template : templates) { @@ -230,6 +231,8 @@ void multipleElementTypes_definedInAnnotation() { hasServiceTask = true; } else if (template.elementType().equals(ElementTypeWrapper.from(BpmnType.SCRIPT_TASK))) { hasScriptTask = true; + } else if (template.elementType().equals(ElementTypeWrapper.from(BpmnType.SEND_TASK))) { + hasSendTask = true; } else if (template .elementType() .equals(ElementTypeWrapper.from(BpmnType.INTERMEDIATE_THROW_EVENT))) { @@ -240,9 +243,10 @@ void multipleElementTypes_definedInAnnotation() { hasMessageEndEvent = true; } } - assertThat(templates.size()).isEqualTo(4); + assertThat(templates.size()).isEqualTo(5); assertTrue(hasServiceTask); assertTrue(hasScriptTask); + assertTrue(hasSendTask); assertTrue(hasMessageThrowEvent); assertTrue(hasMessageEndEvent); } diff --git a/element-template-generator/core/src/test/java/io/camunda/connector/generator/java/example/outbound/MyConnectorFunction.java b/element-template-generator/core/src/test/java/io/camunda/connector/generator/java/example/outbound/MyConnectorFunction.java index 4085a87b87..164819b400 100644 --- a/element-template-generator/core/src/test/java/io/camunda/connector/generator/java/example/outbound/MyConnectorFunction.java +++ b/element-template-generator/core/src/test/java/io/camunda/connector/generator/java/example/outbound/MyConnectorFunction.java @@ -118,6 +118,7 @@ public static class WithDuplicatePropertyIds extends MyConnectorFunction {} elementTypes = { @ConnectorElementType(appliesTo = BpmnType.TASK, elementType = BpmnType.SERVICE_TASK), @ConnectorElementType(appliesTo = BpmnType.TASK, elementType = BpmnType.SCRIPT_TASK), + @ConnectorElementType(appliesTo = BpmnType.TASK, elementType = BpmnType.SEND_TASK), @ConnectorElementType( appliesTo = BpmnType.END_EVENT, elementType = BpmnType.MESSAGE_END_EVENT),