From b3f47ce84bedb93ea4de757777f60f76e901637f Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Fri, 12 Jan 2024 10:19:38 +0100 Subject: [PATCH] moved function provider discovery to spi (#1606) --- .../main/java/io/camunda/connector/feel/FeelEngineWrapper.java | 3 ++- .../services/org.camunda.feel.context.CustomFunctionProvider | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 connector-sdk/feel-wrapper/src/main/resources/META-INF/services/org.camunda.feel.context.CustomFunctionProvider diff --git a/connector-sdk/feel-wrapper/src/main/java/io/camunda/connector/feel/FeelEngineWrapper.java b/connector-sdk/feel-wrapper/src/main/java/io/camunda/connector/feel/FeelEngineWrapper.java index 3accb5b1bc..dbe944659c 100644 --- a/connector-sdk/feel-wrapper/src/main/java/io/camunda/connector/feel/FeelEngineWrapper.java +++ b/connector-sdk/feel-wrapper/src/main/java/io/camunda/connector/feel/FeelEngineWrapper.java @@ -30,6 +30,7 @@ import java.util.stream.StreamSupport; import org.camunda.feel.FeelEngine; import org.camunda.feel.impl.JavaValueMapper; +import org.camunda.feel.impl.SpiServiceLoader; import scala.collection.Iterable; import scala.jdk.javaapi.CollectionConverters; @@ -52,7 +53,7 @@ public FeelEngineWrapper() { this.feelEngine = new FeelEngine.Builder() .customValueMapper(new JavaValueMapper()) - .functionProvider(new FeelConnectorFunctionProvider()) + .functionProvider(SpiServiceLoader.loadFunctionProvider()) .build(); this.objectMapper = new ObjectMapper() diff --git a/connector-sdk/feel-wrapper/src/main/resources/META-INF/services/org.camunda.feel.context.CustomFunctionProvider b/connector-sdk/feel-wrapper/src/main/resources/META-INF/services/org.camunda.feel.context.CustomFunctionProvider new file mode 100644 index 0000000000..69e8c1dc35 --- /dev/null +++ b/connector-sdk/feel-wrapper/src/main/resources/META-INF/services/org.camunda.feel.context.CustomFunctionProvider @@ -0,0 +1 @@ +io.camunda.connector.feel.FeelConnectorFunctionProvider \ No newline at end of file