From 83d3ef4bd1a0465acc29e3703ffe74915b9c5704 Mon Sep 17 00:00:00 2001 From: Pavel Kotelevsky <38818382+chillleader@users.noreply.github.com> Date: Fri, 8 Sep 2023 12:23:38 +0200 Subject: [PATCH] fix(generator): disable feel for result variable (#1119) --- .../generator/dsl/CommonProperties.java | 3 ++- .../core/OutboundTemplateGeneratorTest.java | 27 +++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/connector-sdk/element-template-generator/src/main/java/io/camunda/connector/generator/dsl/CommonProperties.java b/connector-sdk/element-template-generator/src/main/java/io/camunda/connector/generator/dsl/CommonProperties.java index f1af704850..bc3378e90c 100644 --- a/connector-sdk/element-template-generator/src/main/java/io/camunda/connector/generator/dsl/CommonProperties.java +++ b/connector-sdk/element-template-generator/src/main/java/io/camunda/connector/generator/dsl/CommonProperties.java @@ -33,7 +33,8 @@ public class CommonProperties { .id("resultVariable") .group("output") .label("Result Variable") - .description("Name of variable to store the response in"); + .description("Name of variable to store the response in") + .feel(FeelMode.disabled); public static final PropertyBuilder ERROR_EXPRESSION = TextProperty.builder() diff --git a/connector-sdk/element-template-generator/src/test/java/io/camunda/connector/generator/core/OutboundTemplateGeneratorTest.java b/connector-sdk/element-template-generator/src/test/java/io/camunda/connector/generator/core/OutboundTemplateGeneratorTest.java index a319081678..203f8eb87d 100644 --- a/connector-sdk/element-template-generator/src/test/java/io/camunda/connector/generator/core/OutboundTemplateGeneratorTest.java +++ b/connector-sdk/element-template-generator/src/test/java/io/camunda/connector/generator/core/OutboundTemplateGeneratorTest.java @@ -88,6 +88,33 @@ void elementTemplateAnnotation_providesCorrectDefaultValues() { assertThat(template.documentationRef()).isNull(); assertThat(template.description()).isNull(); } + + @Test + void resultVariableProperty() { + var template = generator.generate(MyConnectorFunction.MinimallyAnnotated.class); + var property = getPropertyByLabel("Result Variable", template); + assertThat(property.getType()).isEqualTo("String"); + assertThat(property.getBinding().type()).isEqualTo("zeebe:taskHeader"); + assertThat(property.getFeel()).isNull(); + } + + @Test + void resultExpressionProperty() { + var template = generator.generate(MyConnectorFunction.MinimallyAnnotated.class); + var property = getPropertyByLabel("Result Expression", template); + assertThat(property.getType()).isEqualTo("Text"); + assertThat(property.getBinding().type()).isEqualTo("zeebe:taskHeader"); + assertThat(property.getFeel()).isEqualTo(FeelMode.required); + } + + @Test + void errorExpressionProperty() { + var template = generator.generate(MyConnectorFunction.MinimallyAnnotated.class); + var property = getPropertyByLabel("Error Expression", template); + assertThat(property.getType()).isEqualTo("Text"); + assertThat(property.getBinding().type()).isEqualTo("zeebe:taskHeader"); + assertThat(property.getFeel()).isEqualTo(FeelMode.required); + } } @Nested