From 57272976db610e381b5a02cb0305b9c5582fc648 Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Wed, 25 Oct 2023 10:52:23 +0200 Subject: [PATCH 01/13] moved from job worker to connector --- README.md | 3 - pom.xml | 94 +++++++------------ .../connector/script/LanguageProvider.java | 30 ++++++ .../connector/script/ScriptConnector.java | 59 ++++++++++++ .../script/ScriptConnectorInput.java | 13 +++ .../script/ScriptConnectorLegacy.java | 59 ++++++++++++ .../connector}/script/ScriptEvaluator.java | 40 ++++---- .../script/ScriptResourceProvider.java | 82 ++++++++++++++++ .../script/spi/LanguageProviderExtension.java | 14 +++ .../script/spi/ScriptEvaluatorExtension.java | 18 ++++ .../DefaultLanguageProviderExtension.java | 30 ++++++ .../spi/impl/MustacheEvaluatorExtension.java | 22 +++++ .../java/io/zeebe/script/GraalEvaluator.java | 82 ---------------- .../io/zeebe/script/MustacheEvaluator.java | 13 --- .../zeebe/script/ScriptEngineEvaluator.java | 49 ---------- .../io/zeebe/script/ScriptJobHandler.java | 81 ---------------- .../io/zeebe/script/ZeebeScriptEvaluator.java | 9 -- ...ector.script.spi.LanguageProviderExtension | 1 + ...nector.script.spi.ScriptEvaluatorExtension | 1 + ...tor.api.outbound.OutboundConnectorFunction | 2 + ...camunda.feel.valuemapper.CustomValueMapper | 1 - src/main/resources/application.yaml | 16 ---- src/main/resources/banner.txt | 8 -- .../script-resource-extensions.properties | 11 +++ .../script/EvaluationGroovyTest.java | 4 +- .../script/EvaluationJavaScriptTest.java | 4 +- .../script/EvaluationKotlinTest.java | 4 +- .../script/EvaluationMustacheTest.java | 4 +- .../script/LanguageProviderTest.java | 14 +++ .../script/ScriptEvaluatorTest.java | 19 +--- .../script/ScriptResourceProviderTest.java | 31 ++++++ .../connector}/script/WorkflowTest.java | 9 +- .../script/ZeebeScriptWorkerApplication.java | 3 +- src/test/resources/application.yaml | 7 ++ src/test/resources/test-script.js | 1 + 35 files changed, 472 insertions(+), 366 deletions(-) create mode 100644 src/main/java/io/camunda/community/connector/script/LanguageProvider.java create mode 100644 src/main/java/io/camunda/community/connector/script/ScriptConnector.java create mode 100644 src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java create mode 100644 src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java rename src/main/java/io/{zeebe => camunda/community/connector}/script/ScriptEvaluator.java (63%) create mode 100644 src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java create mode 100644 src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java create mode 100644 src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java create mode 100644 src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java create mode 100644 src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java delete mode 100644 src/main/java/io/zeebe/script/GraalEvaluator.java delete mode 100644 src/main/java/io/zeebe/script/MustacheEvaluator.java delete mode 100644 src/main/java/io/zeebe/script/ScriptEngineEvaluator.java delete mode 100644 src/main/java/io/zeebe/script/ScriptJobHandler.java delete mode 100644 src/main/java/io/zeebe/script/ZeebeScriptEvaluator.java create mode 100644 src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension create mode 100644 src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension create mode 100644 src/main/resources/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction delete mode 100644 src/main/resources/META-INF/services/org.camunda.feel.valuemapper.CustomValueMapper delete mode 100644 src/main/resources/application.yaml delete mode 100644 src/main/resources/banner.txt create mode 100644 src/main/resources/script-resource-extensions.properties rename src/test/java/io/{zeebe => camunda/community/connector}/script/EvaluationGroovyTest.java (95%) rename src/test/java/io/{zeebe => camunda/community/connector}/script/EvaluationJavaScriptTest.java (95%) rename src/test/java/io/{zeebe => camunda/community/connector}/script/EvaluationKotlinTest.java (94%) rename src/test/java/io/{zeebe => camunda/community/connector}/script/EvaluationMustacheTest.java (94%) create mode 100644 src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java rename src/test/java/io/{zeebe => camunda/community/connector}/script/ScriptEvaluatorTest.java (86%) create mode 100644 src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java rename src/test/java/io/{zeebe => camunda/community/connector}/script/WorkflowTest.java (93%) rename src/{main/java/io/zeebe => test/java/io/camunda/community/connector}/script/ZeebeScriptWorkerApplication.java (95%) create mode 100644 src/test/resources/application.yaml create mode 100644 src/test/resources/test-script.js diff --git a/README.md b/README.md index 197890b..c816bb0 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,6 @@ Example BPMN with service task: * required custom headers: * `language` - the name of the script language * `script` - the script to evaluate -* available context/variables in script: - * `job` (ActivatedJob) - the current job - * `zeebeClient` (ZeebeClient) - the client of the worker * the result of the evaluation is passed as `result` variable Available script languages: diff --git a/pom.xml b/pom.xml index 38ed426..106fae5 100644 --- a/pom.xml +++ b/pom.xml @@ -27,8 +27,9 @@ ${java.version} 3.1.5 - 8.2.16 - 8.2.4 + 8.3.0 + 8.3.0 + 8.3.0 2.4.21 1.9.10 @@ -39,11 +40,11 @@ 3.1.1 3.3.1 3.5.1 - 3.2.1 + 3.1.2 2.40.0 3.11.0 0.9.28 - 3.6.1 + 3.6.0 3.12.1 3.6.0 3.0.1 @@ -57,7 +58,7 @@ io.camunda zeebe-bom - ${version.zeebe} + ${version.camunda} import pom @@ -82,36 +83,24 @@ - - - - io.camunda - spring-zeebe-starter - ${version.zeebe.spring} - - - - org.springframework.boot - spring-boot-starter-actuator - - - org.springframework.boot - spring-boot-starter-web + io.camunda.connector + connector-core + provided + ${version.camunda-connectors} - - org.springframework.boot - spring-boot-starter-mustache + com.fasterxml.jackson.core + jackson-databind + + - org.springframework.boot - spring-boot-starter-test - test + com.samskivert + jmustache + compile - - org.codehaus.groovy groovy-all @@ -130,6 +119,12 @@ ${version.graalvm} + + org.graalvm.js + js-scriptengine + ${version.graalvm} + + org.jetbrains.kotlin kotlin-scripting-jsr223 @@ -137,34 +132,35 @@ + + org.springframework.boot + spring-boot-starter-test + test + org.junit.jupiter junit-jupiter 5.10.0 test - org.assertj assertj-core 3.24.2 test - - org.testcontainers - junit-jupiter - 1.19.1 + io.camunda.spring + spring-boot-starter-camunda-test + ${version.camunda-spring} test - - io.camunda - spring-zeebe-test - ${version.zeebe.spring} + io.camunda.connector + spring-boot-starter-camunda-connectors + ${version.camunda-connectors} test - @@ -341,7 +337,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.1 + 3.1.0 @@ -376,26 +372,6 @@ - - com.google.cloud.tools - jib-maven-plugin - 3.4.0 - - - deploy - - build - - - - - - ghcr.io/camunda-community-hub/zeebe-script-worker - ${project.version} - - - - diff --git a/src/main/java/io/camunda/community/connector/script/LanguageProvider.java b/src/main/java/io/camunda/community/connector/script/LanguageProvider.java new file mode 100644 index 0000000..ae80a83 --- /dev/null +++ b/src/main/java/io/camunda/community/connector/script/LanguageProvider.java @@ -0,0 +1,30 @@ +package io.camunda.community.connector.script; + +import io.camunda.community.connector.script.spi.LanguageProviderExtension; +import java.util.Properties; + +public class LanguageProvider { + + private final Properties properties; + + public LanguageProvider() { + properties = new Properties(); + LanguageProviderExtension.load().forEach(e -> properties.putAll(e.getLanguages())); + } + + public LanguageProvider(Properties properties) { + this(); + this.properties.putAll(properties); + } + + public String getLanguageForScriptResource(String scriptResource) { + String fileExtension = scriptResource.substring(scriptResource.lastIndexOf(".") + 1); + String language = properties.getProperty(fileExtension); + if (language == null) { + throw new IllegalStateException( + String.format( + "Could not determine script language from file suffix '%s'", fileExtension)); + } + return language; + } +} diff --git a/src/main/java/io/camunda/community/connector/script/ScriptConnector.java b/src/main/java/io/camunda/community/connector/script/ScriptConnector.java new file mode 100644 index 0000000..699d52c --- /dev/null +++ b/src/main/java/io/camunda/community/connector/script/ScriptConnector.java @@ -0,0 +1,59 @@ +package io.camunda.community.connector.script; + +import io.camunda.connector.api.annotation.OutboundConnector; +import io.camunda.connector.api.outbound.OutboundConnectorContext; +import io.camunda.connector.api.outbound.OutboundConnectorFunction; + +import java.util.Map; + +@OutboundConnector( + type = "io.camunda.community:script", + name = "connector-script", + inputVariables = {}) +public class ScriptConnector implements OutboundConnectorFunction { + static final String PARAM_LANGUAGE = "language"; + static final String PARAM_SCRIPT = "script"; + static final String PARAM_SCRIPT_RESOURCE = "scriptResource"; + static final String PARAM_CONTEXT = "context"; + + private final ScriptEvaluator scriptEvaluator = new ScriptEvaluator(); + private final ScriptResourceProvider scriptResourceProvider = new ScriptResourceProvider(); + private final LanguageProvider languageProvider = new LanguageProvider(); + + @Override + public Object execute(OutboundConnectorContext outboundConnectorContext) throws Exception { + ScriptConnectorInput scriptConnectorInput = + outboundConnectorContext.bindVariables(ScriptConnectorInput.class); + String script = extractScript(scriptConnectorInput); + String language = extractLanguage(scriptConnectorInput); + return scriptEvaluator.evaluate(language, script, scriptConnectorInput.context()); + } + + private String extractLanguage(ScriptConnectorInput scriptConnectorInput) { + if (scriptConnectorInput.language() != null) { + return scriptConnectorInput.language(); + } + if (scriptConnectorInput.scriptResource() != null) { + return languageProvider.getLanguageForScriptResource(scriptConnectorInput.scriptResource()); + } + throw new IllegalStateException(String.format("No '%s' has been provided", PARAM_LANGUAGE)); + } + + private Object generateResponse(String resultVariable, Object evaluationResult) { + if (resultVariable != null && !resultVariable.isBlank()) { + return Map.of(resultVariable, evaluationResult); + } + return null; + } + + private String extractScript(ScriptConnectorInput scriptConnectorInput) { + if (scriptConnectorInput.script() != null) { + return scriptConnectorInput.script(); + } + if (scriptConnectorInput.scriptResource() != null) { + return scriptResourceProvider.provideScript(scriptConnectorInput.scriptResource()); + } + throw new IllegalStateException( + String.format("No '%s' or '%s' has been provided", PARAM_SCRIPT, PARAM_SCRIPT_RESOURCE)); + } +} diff --git a/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java b/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java new file mode 100644 index 0000000..509c4f0 --- /dev/null +++ b/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java @@ -0,0 +1,13 @@ +package io.camunda.community.connector.script; + +import com.fasterxml.jackson.annotation.JsonProperty; + +import java.util.Map; + +import static io.camunda.community.connector.script.ScriptConnector.*; + +public record ScriptConnectorInput( + @JsonProperty(PARAM_LANGUAGE) String language, + @JsonProperty(PARAM_SCRIPT) String script, + @JsonProperty(PARAM_SCRIPT_RESOURCE) String scriptResource, + @JsonProperty(PARAM_CONTEXT) Map context) {} diff --git a/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java b/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java new file mode 100644 index 0000000..b647ff3 --- /dev/null +++ b/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java @@ -0,0 +1,59 @@ +package io.camunda.community.connector.script; + +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.node.ObjectNode; +import io.camunda.connector.api.annotation.OutboundConnector; +import io.camunda.connector.api.outbound.OutboundConnectorContext; +import io.camunda.connector.api.outbound.OutboundConnectorFunction; + +import java.util.Collections; +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; + +@OutboundConnector( + type = "script", + name = "connector-script-legacy", + inputVariables = {}) +public class ScriptConnectorLegacy implements OutboundConnectorFunction { + private static final String PARAM_LANGUAGE = "language"; + private static final String PARAM_HEADER = "script"; + + private final ScriptEvaluator scriptEvaluator = new ScriptEvaluator(); + + @Override + public Object execute(OutboundConnectorContext outboundConnectorContext) throws Exception { + // do not leave behind the old party + final Map customHeaders = + outboundConnectorContext.getJobContext().getCustomHeaders(); + final String language = getLanguage(customHeaders); + final String script = getScript(customHeaders); + + final Map variables = getVariablesAsMap(outboundConnectorContext); + + return scriptEvaluator.evaluate(language, script, variables); + } + + private String getLanguage(Map customHeaders) { + return Optional.ofNullable(customHeaders.get(PARAM_LANGUAGE)) + .orElseThrow( + () -> + new RuntimeException( + String.format("Missing required custom header '%s'", PARAM_LANGUAGE))); + } + + private String getScript(Map customHeaders) { + return Optional.ofNullable(customHeaders.get(PARAM_HEADER)) + .orElseThrow( + () -> + new RuntimeException( + String.format("Missing required custom header '%s'", PARAM_HEADER))); + } + + private Map getVariablesAsMap(OutboundConnectorContext outboundConnectorContext) { + return (Map) outboundConnectorContext.bindVariables(Map.class); + } +} diff --git a/src/main/java/io/zeebe/script/ScriptEvaluator.java b/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java similarity index 63% rename from src/main/java/io/zeebe/script/ScriptEvaluator.java rename to src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java index c2a53f0..9249919 100644 --- a/src/main/java/io/zeebe/script/ScriptEvaluator.java +++ b/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java @@ -13,8 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.zeebe.script; +package io.camunda.community.connector.script; +import io.camunda.community.connector.script.spi.ScriptEvaluatorExtension; import java.util.HashMap; import java.util.Map; import javax.script.Bindings; @@ -22,25 +23,26 @@ import javax.script.ScriptEngine; import javax.script.ScriptEngineManager; import javax.script.ScriptException; -import org.springframework.stereotype.Component; -@Component public class ScriptEvaluator { private final ScriptEngineManager scriptEngineManager = new ScriptEngineManager(); - private final Map additionalEvaluators = - Map.of("mustache", new MustacheEvaluator()); - private final Map cachedScriptEngines = new HashMap<>(); - private final GraalEvaluator graalEvaluator = new GraalEvaluator(); - private final ScriptEngineEvaluator scriptEngineEvaluator = new ScriptEngineEvaluator(); + private final Map scriptEvaluatorExtensions = new HashMap<>(); + + public ScriptEvaluator() { + ScriptEvaluatorExtension.load() + .forEach( + e -> e.getEvaluatedLanguage() + .forEach(language -> scriptEvaluatorExtensions.put(language, e))); + } public Object evaluate(String language, String script, Map variables) { - if (additionalEvaluators.containsKey(language)) { - final var scriptEvaluator = additionalEvaluators.get(language); - return scriptEvaluator.eval(script, variables); + if (scriptEvaluatorExtensions.containsKey(language)) { + final var scriptEvaluator = scriptEvaluatorExtensions.get(language); + return scriptEvaluator.evaluateScript(script, variables); } return evalWithScriptEngine(language, script, variables); @@ -49,17 +51,13 @@ public Object evaluate(String language, String script, Map varia private Object evalWithScriptEngine( String language, String script, Map variables) { try { - if (GraalEvaluator.SUPPORTED_LANGUAGES.contains(language)) { - return graalEvaluator.evaluate(language, script, variables); - } else { - final ScriptEngine scriptEngine = - cachedScriptEngines.computeIfAbsent(language, scriptEngineManager::getEngineByName); - if (scriptEngine == null) { - final String msg = String.format("No script engine found with name '%s'", language); - throw new RuntimeException(msg); - } - return eval(scriptEngine, script, variables); + final ScriptEngine scriptEngine = + cachedScriptEngines.computeIfAbsent(language, scriptEngineManager::getEngineByName); + if (scriptEngine == null) { + final String msg = String.format("No script engine found with name '%s'", language); + throw new RuntimeException(msg); } + return eval(scriptEngine, script, variables); } catch (Exception e) { final String msg = String.format("Failed to evaluate script '%s' (%s)", script, language); throw new RuntimeException(msg, e); diff --git a/src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java b/src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java new file mode 100644 index 0000000..ef56325 --- /dev/null +++ b/src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java @@ -0,0 +1,82 @@ +package io.camunda.community.connector.script; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.function.Function; + +public class ScriptResourceProvider { + private final ResourceLoader[] resourceLoaders = + new ResourceLoader[] { + new ResourceLoader("classpath", this::loadFromClassPath), + new ResourceLoader("file", this::loadFromFile) + }; + + public String provideScript(String scriptResource) { + if (scriptResource == null) { + throw new IllegalStateException("scriptResource must not be null"); + } + for (ResourceLoader loader : resourceLoaders) { + if (is(loader.identifier(), scriptResource)) { + return loader + .strategy() + .apply(scriptResource.substring(loader.identifier().length() + 1).trim()); + } + } + return loadFromUrl(scriptResource); + } + + private boolean is(String resourceType, String scriptResource) { + return scriptResource.startsWith(resourceType + ":"); + } + + private String loadFromClassPath(String scriptResource) { + try (InputStream in = this.getClass().getClassLoader().getResourceAsStream(scriptResource)) { + if (in == null) { + throw new NullPointerException(String.format("No resource found for '%s'", scriptResource)); + } + return new String(in.readAllBytes()); + } catch (Exception e) { + throw new RuntimeException( + String.format( + "An exception happened while loading resource '%s' from the classpath", + scriptResource), + e); + } + } + + private String loadFromFile(String scriptResource) { + try { + return new String(Files.readAllBytes(new File(scriptResource).toPath())); + } catch (Exception e) { + throw new RuntimeException( + String.format( + "An exception happened while loading resource '%s' from the file system", + scriptResource), + e); + } + } + + private String loadFromUrl(String scriptResource) { + try { + URL scriptUrl = new URL(scriptResource); + try(InputStream in = scriptUrl.openStream()){ + return new String(in.readAllBytes()); + } + } catch (Exception e) { + throw new RuntimeException( + String.format( + "An exception happened while loading resource '%s' from a URL", + scriptResource), + e); + } + + } + + private record ResourceLoader(String identifier, Function strategy) {} +} diff --git a/src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java b/src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java new file mode 100644 index 0000000..018ee4f --- /dev/null +++ b/src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java @@ -0,0 +1,14 @@ +package io.camunda.community.connector.script.spi; + +import java.util.List; +import java.util.Properties; +import java.util.ServiceLoader; +import java.util.ServiceLoader.Provider; + +public interface LanguageProviderExtension { + static List load() { + return ServiceLoader.load(LanguageProviderExtension.class).stream().map(Provider::get).toList(); + } + + Properties getLanguages(); +} diff --git a/src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java b/src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java new file mode 100644 index 0000000..5683960 --- /dev/null +++ b/src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java @@ -0,0 +1,18 @@ +package io.camunda.community.connector.script.spi; + +import java.util.List; +import java.util.Map; +import java.util.ServiceLoader; +import java.util.ServiceLoader.Provider; +import java.util.Set; + +public interface ScriptEvaluatorExtension { + static List load(){ + return ServiceLoader + .load(ScriptEvaluatorExtension.class).stream().map(Provider::get).toList(); + } + + Set getEvaluatedLanguage(); + + Object evaluateScript(String script, Map context); +} diff --git a/src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java b/src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java new file mode 100644 index 0000000..37528de --- /dev/null +++ b/src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java @@ -0,0 +1,30 @@ +package io.camunda.community.connector.script.spi.impl; + +import io.camunda.community.connector.script.LanguageProvider; +import io.camunda.community.connector.script.spi.LanguageProviderExtension; +import java.io.IOException; +import java.io.InputStream; +import java.util.Properties; + +public class DefaultLanguageProviderExtension implements LanguageProviderExtension { + private static final String RESOURCE = "script-resource-extensions.properties"; + private Properties properties; + + @Override + public Properties getLanguages() { + if (properties == null) { + loadProperties(); + } + return properties; + } + + private void loadProperties() { + properties = new Properties(); + try (InputStream in = getClass().getClassLoader().getResourceAsStream(RESOURCE)) { + properties.load(in); + } catch (IOException e) { + throw new RuntimeException( + String.format("Unable to load '%s' from the classpath", RESOURCE), e); + } + } +} diff --git a/src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java b/src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java new file mode 100644 index 0000000..3212b50 --- /dev/null +++ b/src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java @@ -0,0 +1,22 @@ +package io.camunda.community.connector.script.spi.impl; + +import com.samskivert.mustache.Mustache; +import com.samskivert.mustache.Template; +import io.camunda.community.connector.script.spi.ScriptEvaluatorExtension; + +import java.util.Map; +import java.util.Set; + +public class MustacheEvaluatorExtension implements ScriptEvaluatorExtension { + @Override + public Set getEvaluatedLanguage() { + return Set.of("mustache"); + } + + @Override + public Object evaluateScript(String script, Map context) { + final Template template = Mustache + .compiler().compile(script); + return template.execute(context); + } +} diff --git a/src/main/java/io/zeebe/script/GraalEvaluator.java b/src/main/java/io/zeebe/script/GraalEvaluator.java deleted file mode 100644 index 6a9daa2..0000000 --- a/src/main/java/io/zeebe/script/GraalEvaluator.java +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright © 2017 camunda services GmbH (info@camunda.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.zeebe.script; - -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.LongStream; -import org.graalvm.polyglot.Context; -import org.graalvm.polyglot.PolyglotException; -import org.graalvm.polyglot.Value; - -public class GraalEvaluator { - - private static final String LANGUAGE_ID_JS = "js"; - - public static final List SUPPORTED_LANGUAGES = Arrays.asList("js", "javascript"); - - public Object evaluate(String language, String script, Map variables) - throws PolyglotException, IllegalArgumentException, IllegalStateException { - - // this throws a FileSystemNotFoundException - final Context context = Context.create(LANGUAGE_ID_JS); - - final Value bindings = context.getBindings(LANGUAGE_ID_JS); - variables.forEach((key, value) -> bindings.putMember(key, value)); - - final Value result = context.eval(LANGUAGE_ID_JS, script); - - return mapValueToObject(result); - } - - private Object mapValueToObject(final Value value) { - if (value.isNull()) { - return null; - - } else if (value.isBoolean()) { - return value.asBoolean(); - - } else if (value.isString()) { - return value.asString(); - - } else if (value.isNumber()) { - if (value.fitsInInt()) { - return value.asInt(); - } else if (value.fitsInLong()) { - return value.asLong(); - } else if (value.fitsInFloat()) { - return value.asFloat(); - } else { - return value.asDouble(); - } - - } else if (value.hasArrayElements()) { - return LongStream.range(0, value.getArraySize()) - .mapToObj(i -> mapValueToObject(value.getArrayElement(i))) - .collect(Collectors.toList()); - - } else if (value.hasMembers()) { - return value.getMemberKeys().stream() - .collect( - Collectors.toMap(Function.identity(), key -> mapValueToObject(value.getMember(key)))); - } - - return "unknown: " + value.toString(); - } -} diff --git a/src/main/java/io/zeebe/script/MustacheEvaluator.java b/src/main/java/io/zeebe/script/MustacheEvaluator.java deleted file mode 100644 index 648739e..0000000 --- a/src/main/java/io/zeebe/script/MustacheEvaluator.java +++ /dev/null @@ -1,13 +0,0 @@ -package io.zeebe.script; - -import com.samskivert.mustache.Mustache; -import com.samskivert.mustache.Template; -import java.util.Map; - -public final class MustacheEvaluator implements ZeebeScriptEvaluator { - - public Object eval(String script, Map context) { - final Template template = Mustache.compiler().compile(script); - return template.execute(context); - } -} diff --git a/src/main/java/io/zeebe/script/ScriptEngineEvaluator.java b/src/main/java/io/zeebe/script/ScriptEngineEvaluator.java deleted file mode 100644 index 40c22e5..0000000 --- a/src/main/java/io/zeebe/script/ScriptEngineEvaluator.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright © 2017 camunda services GmbH (info@camunda.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.zeebe.script; - -import java.util.HashMap; -import java.util.Map; -import javax.script.Bindings; -import javax.script.ScriptContext; -import javax.script.ScriptEngine; -import javax.script.ScriptEngineManager; -import javax.script.ScriptException; - -public class ScriptEngineEvaluator { - - private final ScriptEngineManager scriptEngineManager = new ScriptEngineManager(); - - private final Map cachedScriptEngines = new HashMap<>(); - - public Object evaluate(String language, String script, Map variables) - throws ScriptException { - - final ScriptEngine scriptEngine = - cachedScriptEngines.computeIfAbsent(language, scriptEngineManager::getEngineByName); - - if (scriptEngine == null) { - final String msg = String.format("No script engine found with name '%s'", language); - throw new RuntimeException(msg); - } - - final ScriptContext context = scriptEngine.getContext(); - final Bindings bindings = context.getBindings(ScriptContext.ENGINE_SCOPE); - bindings.putAll(variables); - - return scriptEngine.eval(script, context); - } -} diff --git a/src/main/java/io/zeebe/script/ScriptJobHandler.java b/src/main/java/io/zeebe/script/ScriptJobHandler.java deleted file mode 100644 index 6453e0d..0000000 --- a/src/main/java/io/zeebe/script/ScriptJobHandler.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright © 2017 camunda services GmbH (info@camunda.com) - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package io.zeebe.script; - -import io.camunda.zeebe.client.ZeebeClient; -import io.camunda.zeebe.client.api.response.ActivatedJob; -import io.camunda.zeebe.client.api.worker.JobClient; -import io.camunda.zeebe.client.api.worker.JobHandler; -import io.camunda.zeebe.spring.client.annotation.ZeebeWorker; -import java.util.Collections; -import java.util.Map; -import java.util.Optional; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -@Component -public class ScriptJobHandler implements JobHandler { - - private static final String HEADER_LANGUAGE = "language"; - private static final String HEADER_SCRIPT = "script"; - - private final ScriptEvaluator scriptEvaluator = new ScriptEvaluator(); - - private final ZeebeClient zeebeClient; - - @Autowired - public ScriptJobHandler(ZeebeClient zeebeClient) { - this.zeebeClient = zeebeClient; - } - - @Override - @ZeebeWorker - public void handle(JobClient jobClient, ActivatedJob job) { - - final Map customHeaders = job.getCustomHeaders(); - final String language = getLanguage(customHeaders); - final String script = getScript(customHeaders); - - final Map variables = job.getVariablesAsMap(); - - // add context - variables.put("job", job); - variables.put("zeebeClient", zeebeClient); - - final Object result = scriptEvaluator.evaluate(language, script, variables); - - jobClient - .newCompleteCommand(job.getKey()) - .variables(Collections.singletonMap("result", result)) - .send(); - } - - private String getLanguage(Map customHeaders) { - return Optional.ofNullable(customHeaders.get(HEADER_LANGUAGE)) - .orElseThrow( - () -> - new RuntimeException( - String.format("Missing required custom header '%s'", HEADER_LANGUAGE))); - } - - private String getScript(Map customHeaders) { - return Optional.ofNullable(customHeaders.get(HEADER_SCRIPT)) - .orElseThrow( - () -> - new RuntimeException( - String.format("Missing required custom header '%s'", HEADER_SCRIPT))); - } -} diff --git a/src/main/java/io/zeebe/script/ZeebeScriptEvaluator.java b/src/main/java/io/zeebe/script/ZeebeScriptEvaluator.java deleted file mode 100644 index a018863..0000000 --- a/src/main/java/io/zeebe/script/ZeebeScriptEvaluator.java +++ /dev/null @@ -1,9 +0,0 @@ -package io.zeebe.script; - -import java.util.Map; - -@FunctionalInterface -public interface ZeebeScriptEvaluator { - - Object eval(String script, Map context); -} diff --git a/src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension b/src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension new file mode 100644 index 0000000..06a77e5 --- /dev/null +++ b/src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension @@ -0,0 +1 @@ +io.camunda.community.connector.script.spi.impl.DefaultLanguageProviderExtension \ No newline at end of file diff --git a/src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension b/src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension new file mode 100644 index 0000000..0e24ab9 --- /dev/null +++ b/src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension @@ -0,0 +1 @@ +io.camunda.community.connector.script.spi.impl.MustacheEvaluatorExtension \ No newline at end of file diff --git a/src/main/resources/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction b/src/main/resources/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction new file mode 100644 index 0000000..62dcd73 --- /dev/null +++ b/src/main/resources/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction @@ -0,0 +1,2 @@ +io.camunda.community.connector.script.ScriptConnector +io.camunda.community.connector.script.ScriptConnectorLegacy \ No newline at end of file diff --git a/src/main/resources/META-INF/services/org.camunda.feel.valuemapper.CustomValueMapper b/src/main/resources/META-INF/services/org.camunda.feel.valuemapper.CustomValueMapper deleted file mode 100644 index 406b0de..0000000 --- a/src/main/resources/META-INF/services/org.camunda.feel.valuemapper.CustomValueMapper +++ /dev/null @@ -1 +0,0 @@ -org.camunda.feel.impl.JavaValueMapper \ No newline at end of file diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml deleted file mode 100644 index 30aafd4..0000000 --- a/src/main/resources/application.yaml +++ /dev/null @@ -1,16 +0,0 @@ -zeebe: - client: - worker: - defaultName: script-worker - defaultType: script - threads: 3 - - job.timeout: 10000 - broker.contactPoint: 127.0.0.1:26500 - security.plaintext: true - -logging: - level: - root: ERROR - io.zeebe: INFO - io.zeebe.script: DEBUG diff --git a/src/main/resources/banner.txt b/src/main/resources/banner.txt deleted file mode 100644 index d532a9b..0000000 --- a/src/main/resources/banner.txt +++ /dev/null @@ -1,8 +0,0 @@ - -___ __ - _/ _ _ |_ _ (_ _ _ . _ |_ | | _ _ | _ _ -/__ (- (- |_) (- __) (_ | | |_) |_ |/\| (_) | |( (- | - | - -============================================================= - ${application.formatted-version} diff --git a/src/main/resources/script-resource-extensions.properties b/src/main/resources/script-resource-extensions.properties new file mode 100644 index 0000000..9ce05b2 --- /dev/null +++ b/src/main/resources/script-resource-extensions.properties @@ -0,0 +1,11 @@ +# javascript +js=javascript +# groovy +groovy=groovy +gvy=groovy +gy=groovy +gsh=groovy +# mustache +mustache=mustache +# kotlin +kt=kotlin \ No newline at end of file diff --git a/src/test/java/io/zeebe/script/EvaluationGroovyTest.java b/src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java similarity index 95% rename from src/test/java/io/zeebe/script/EvaluationGroovyTest.java rename to src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java index 6c557a4..09aae8b 100644 --- a/src/test/java/io/zeebe/script/EvaluationGroovyTest.java +++ b/src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.zeebe.script; +package io.camunda.community.connector.script; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; @@ -21,6 +21,8 @@ import java.util.Collections; import java.util.List; import java.util.Map; + +import io.camunda.community.connector.script.ScriptEvaluator; import org.junit.jupiter.api.Test; public class EvaluationGroovyTest { diff --git a/src/test/java/io/zeebe/script/EvaluationJavaScriptTest.java b/src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java similarity index 95% rename from src/test/java/io/zeebe/script/EvaluationJavaScriptTest.java rename to src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java index 6f8ea60..a3aab47 100644 --- a/src/test/java/io/zeebe/script/EvaluationJavaScriptTest.java +++ b/src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.zeebe.script; +package io.camunda.community.connector.script; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; @@ -21,6 +21,8 @@ import java.util.Collections; import java.util.List; import java.util.Map; + +import io.camunda.community.connector.script.ScriptEvaluator; import org.junit.jupiter.api.Test; public class EvaluationJavaScriptTest { diff --git a/src/test/java/io/zeebe/script/EvaluationKotlinTest.java b/src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java similarity index 94% rename from src/test/java/io/zeebe/script/EvaluationKotlinTest.java rename to src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java index b22a98e..bfa4444 100644 --- a/src/test/java/io/zeebe/script/EvaluationKotlinTest.java +++ b/src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java @@ -1,4 +1,4 @@ -package io.zeebe.script; +package io.camunda.community.connector.script; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.entry; @@ -6,6 +6,8 @@ import java.util.Collections; import java.util.List; import java.util.Map; + +import io.camunda.community.connector.script.ScriptEvaluator; import org.junit.jupiter.api.Test; public class EvaluationKotlinTest { diff --git a/src/test/java/io/zeebe/script/EvaluationMustacheTest.java b/src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java similarity index 94% rename from src/test/java/io/zeebe/script/EvaluationMustacheTest.java rename to src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java index 2a4cfeb..8fdb0b7 100644 --- a/src/test/java/io/zeebe/script/EvaluationMustacheTest.java +++ b/src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java @@ -13,12 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.zeebe.script; +package io.camunda.community.connector.script; import static org.assertj.core.api.Assertions.assertThat; import java.util.List; import java.util.Map; + +import io.camunda.community.connector.script.ScriptEvaluator; import org.junit.jupiter.api.Test; public class EvaluationMustacheTest { diff --git a/src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java b/src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java new file mode 100644 index 0000000..d0f718c --- /dev/null +++ b/src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java @@ -0,0 +1,14 @@ +package io.camunda.community.connector.script; + +import org.junit.jupiter.api.Test; + +import static org.assertj.core.api.Assertions.*; + +public class LanguageProviderTest { + @Test + void shouldReturnLanguage(){ + LanguageProvider provider = new LanguageProvider(); + String languageForScriptResource = provider.getLanguageForScriptResource("some-resource.js"); + assertThat(languageForScriptResource).isEqualTo("javascript"); + } +} diff --git a/src/test/java/io/zeebe/script/ScriptEvaluatorTest.java b/src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java similarity index 86% rename from src/test/java/io/zeebe/script/ScriptEvaluatorTest.java rename to src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java index aa3f8a3..cc54c0e 100644 --- a/src/test/java/io/zeebe/script/ScriptEvaluatorTest.java +++ b/src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java @@ -13,12 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.zeebe.script; +package io.camunda.community.connector.script; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.util.Collections; + +import io.camunda.community.connector.script.ScriptEvaluator; import org.junit.jupiter.api.Test; public class ScriptEvaluatorTest { @@ -39,13 +41,6 @@ public void shouldEvaluateGroovy() { assertThat(result).isEqualTo(123); } - @Test - public void shouldEvaluateFeel() { - final Object result = scriptEvaluator.evaluate("feel", "123", Collections.emptyMap()); - - assertThat(result).isEqualTo(123L); - } - @Test public void shouldEvaluateKotlin() { final Object result = scriptEvaluator.evaluate("kotlin", "123", Collections.emptyMap()); @@ -71,14 +66,6 @@ public void shouldEvaluateGroovyWithVariables() { assertThat(result).isEqualTo(123); } - @Test - public void shouldEvaluateFeelWithVariables() { - - final Object result = scriptEvaluator.evaluate("feel", "a", Collections.singletonMap("a", 123)); - - assertThat(result).isEqualTo(123L); - } - @Test public void shouldEvaluateKotlinWithVariables() { final Object result = diff --git a/src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java b/src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java new file mode 100644 index 0000000..f155e9d --- /dev/null +++ b/src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java @@ -0,0 +1,31 @@ +package io.camunda.community.connector.script; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; + +import static org.assertj.core.api.Assertions.*; + +public class ScriptResourceProviderTest { + @Test + void shouldLoadClasspathResource() { + String scriptResource = "classpath:test-script.js"; + ScriptResourceProvider resourceProvider = new ScriptResourceProvider(); + String script = resourceProvider.provideScript(scriptResource); + assertThat(script).isEqualTo("a + b;"); + } + + @Test + void shouldLoadFileResource(@TempDir File directory) throws IOException { + File scriptFile = new File(directory, "test-script.js"); + Files.writeString(scriptFile.toPath(), "a + b;"); + String scriptResource = "file:" + scriptFile; + ScriptResourceProvider resourceProvider = new ScriptResourceProvider(); + String script = resourceProvider.provideScript(scriptResource); + assertThat(script).isEqualTo("a + b;"); + } +} diff --git a/src/test/java/io/zeebe/script/WorkflowTest.java b/src/test/java/io/camunda/community/connector/script/WorkflowTest.java similarity index 93% rename from src/test/java/io/zeebe/script/WorkflowTest.java rename to src/test/java/io/camunda/community/connector/script/WorkflowTest.java index 84f71fe..82101ee 100644 --- a/src/test/java/io/zeebe/script/WorkflowTest.java +++ b/src/test/java/io/camunda/community/connector/script/WorkflowTest.java @@ -1,4 +1,4 @@ -package io.zeebe.script; +package io.camunda.community.connector.script; import static org.assertj.core.api.Assertions.assertThat; @@ -9,6 +9,8 @@ import io.camunda.zeebe.spring.test.ZeebeSpringTest; import java.util.Collections; import java.util.Map; + +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; @@ -30,7 +32,8 @@ public void shouldReturnResult() { t -> t.zeebeJobType("script") .zeebeTaskHeader("language", "groovy") - .zeebeTaskHeader("script", "x + 1")) + .zeebeTaskHeader("script", "x + 1") + .zeebeTaskHeader("resultVariable","result")) .done(); final var workflowInstanceResult = @@ -40,6 +43,7 @@ public void shouldReturnResult() { } @Test + @Disabled public void shouldGetCurrentJob() { final BpmnModelInstance workflow = @@ -60,6 +64,7 @@ public void shouldGetCurrentJob() { } @Test + @Disabled public void shouldUseZeebeClient() { final String groovyScript = "zeebeClient.newPublishMessageCommand()" diff --git a/src/main/java/io/zeebe/script/ZeebeScriptWorkerApplication.java b/src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java similarity index 95% rename from src/main/java/io/zeebe/script/ZeebeScriptWorkerApplication.java rename to src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java index 8b3d8ec..fdbceb4 100644 --- a/src/main/java/io/zeebe/script/ZeebeScriptWorkerApplication.java +++ b/src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java @@ -13,14 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package io.zeebe.script; +package io.camunda.community.connector.script; import io.camunda.zeebe.spring.client.EnableZeebeClient; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication -@EnableZeebeClient public class ZeebeScriptWorkerApplication { public static void main(String[] args) { diff --git a/src/test/resources/application.yaml b/src/test/resources/application.yaml new file mode 100644 index 0000000..d28a711 --- /dev/null +++ b/src/test/resources/application.yaml @@ -0,0 +1,7 @@ +camunda.operate.enabled: false +camunda: + connector: + webhook: + enabled: false + polling: + enabled: false \ No newline at end of file diff --git a/src/test/resources/test-script.js b/src/test/resources/test-script.js new file mode 100644 index 0000000..b321213 --- /dev/null +++ b/src/test/resources/test-script.js @@ -0,0 +1 @@ +a + b; \ No newline at end of file From 9dbeb5ee37867d42ef49f556be3dba996b46dd05 Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Fri, 27 Oct 2023 09:59:35 +0200 Subject: [PATCH 02/13] tranformation --- README.md | 2 +- connector/dependency-reduced-pom.xml | 186 +++++++++++++++ connector/pom.xml | 98 ++++++++ .../connector/script/LanguageProvider.java | 0 .../connector/script/ScriptConnector.java | 1 - .../script/ScriptConnectorInput.java | 5 +- .../script/ScriptConnectorLegacy.java | 26 +- .../connector/script/ScriptEvaluator.java | 5 +- .../script/ScriptResourceProvider.java | 12 +- .../script/spi/LanguageProviderExtension.java | 0 .../script/spi/ScriptEvaluatorExtension.java | 5 +- .../DefaultLanguageProviderExtension.java | 1 - .../spi/impl/MustacheEvaluatorExtension.java | 4 +- ...ector.script.spi.LanguageProviderExtension | 0 ...nector.script.spi.ScriptEvaluatorExtension | 0 ...tor.api.outbound.OutboundConnectorFunction | 0 .../services/javax.script.ScriptEngineFactory | 3 + .../script-resource-extensions.properties | 0 .../script/EvaluationGroovyTest.java | 2 - .../script/EvaluationJavaScriptTest.java | 2 - .../script/EvaluationKotlinTest.java | 2 - .../script/EvaluationMustacheTest.java | 2 - .../script/LanguageProviderTest.java | 6 +- .../connector/script/ScriptEvaluatorTest.java | 2 - .../script/ScriptResourceProviderTest.java | 8 +- .../connector/script/WorkflowTest.java | 3 +- .../script/ZeebeScriptWorkerApplication.java | 1 - .../src}/test/resources/application.yaml | 0 .../src}/test/resources/test-script.js | 0 ...ector.script.spi.LanguageProviderExtension | 1 + ...nector.script.spi.ScriptEvaluatorExtension | 1 + ...tor.api.outbound.OutboundConnectorFunction | 2 + .../services/javax.script.ScriptEngineFactory | 3 + .../script-resource-extensions.properties | 11 + .../target/maven-archiver/pom.properties | 3 + .../compile/default-compile/createdFiles.lst | 11 + .../compile/default-compile/inputFiles.lst | 10 + .../default-testCompile/createdFiles.lst | 9 + .../default-testCompile/inputFiles.lst | 9 + connector/target/spotless-index | 21 ++ ....connector.script.EvaluationGroovyTest.xml | 80 +++++++ ...nector.script.EvaluationJavaScriptTest.xml | 130 ++++++++++ ....connector.script.EvaluationKotlinTest.xml | 75 ++++++ ...onnector.script.EvaluationMustacheTest.xml | 80 +++++++ ....connector.script.LanguageProviderTest.xml | 76 ++++++ ...y.connector.script.ScriptEvaluatorTest.xml | 111 +++++++++ ...ctor.script.ScriptResourceProviderTest.xml | 77 ++++++ ...ommunity.connector.script.WorkflowTest.xml | 155 ++++++++++++ ....connector.script.EvaluationGroovyTest.txt | 4 + ...script.EvaluationJavaScriptTest-output.txt | 45 ++++ ...nector.script.EvaluationJavaScriptTest.txt | 4 + ....connector.script.EvaluationKotlinTest.txt | 4 + ...onnector.script.EvaluationMustacheTest.txt | 4 + ....connector.script.LanguageProviderTest.txt | 4 + ...ctor.script.ScriptEvaluatorTest-output.txt | 27 +++ ...y.connector.script.ScriptEvaluatorTest.txt | 4 + ...ctor.script.ScriptResourceProviderTest.txt | 4 + ...y.connector.script.WorkflowTest-output.txt | 70 ++++++ ...ommunity.connector.script.WorkflowTest.txt | 4 + .../target/test-classes/application.yaml | 7 + connector/target/test-classes/test-script.js | 1 + docker/docker-compose.yml | 17 +- pom.xml | 222 +++++------------- runtime/pom.xml | 53 +++++ .../community/connector/script/App.java | 11 + runtime/target/maven-archiver/pom.properties | 3 + .../compile/default-compile/createdFiles.lst | 1 + .../compile/default-compile/inputFiles.lst | 1 + ...nector-runtime-1.2.1-SNAPSHOT.jar.original | Bin 0 -> 3258 bytes runtime/target/spotless-index | 3 + 70 files changed, 1504 insertions(+), 230 deletions(-) create mode 100644 connector/dependency-reduced-pom.xml create mode 100644 connector/pom.xml rename {src => connector/src}/main/java/io/camunda/community/connector/script/LanguageProvider.java (100%) rename {src => connector/src}/main/java/io/camunda/community/connector/script/ScriptConnector.java (99%) rename {src => connector/src}/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java (99%) rename {src => connector/src}/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java (74%) rename {src => connector/src}/main/java/io/camunda/community/connector/script/ScriptEvaluator.java (94%) rename {src => connector/src}/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java (88%) rename {src => connector/src}/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java (100%) rename {src => connector/src}/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java (69%) rename {src => connector/src}/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java (93%) rename {src => connector/src}/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java (87%) rename {src => connector/src}/main/resources/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension (100%) rename {src => connector/src}/main/resources/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension (100%) rename {src => connector/src}/main/resources/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction (100%) create mode 100644 connector/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory rename {src => connector/src}/main/resources/script-resource-extensions.properties (100%) rename {src => connector/src}/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java (97%) rename {src => connector/src}/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java (97%) rename {src => connector/src}/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java (96%) rename {src => connector/src}/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java (97%) rename {src => connector/src}/test/java/io/camunda/community/connector/script/LanguageProviderTest.java (92%) rename {src => connector/src}/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java (97%) rename {src => connector/src}/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java (96%) rename {src => connector/src}/test/java/io/camunda/community/connector/script/WorkflowTest.java (98%) rename {src => connector/src}/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java (94%) rename {src => connector/src}/test/resources/application.yaml (100%) rename {src => connector/src}/test/resources/test-script.js (100%) create mode 100644 connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension create mode 100644 connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension create mode 100644 connector/target/classes/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction create mode 100644 connector/target/classes/META-INF/services/javax.script.ScriptEngineFactory create mode 100644 connector/target/classes/script-resource-extensions.properties create mode 100644 connector/target/maven-archiver/pom.properties create mode 100644 connector/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 connector/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst create mode 100644 connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst create mode 100644 connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst create mode 100644 connector/target/spotless-index create mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationGroovyTest.xml create mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationJavaScriptTest.xml create mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationKotlinTest.xml create mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationMustacheTest.xml create mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.LanguageProviderTest.xml create mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptEvaluatorTest.xml create mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptResourceProviderTest.xml create mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.WorkflowTest.xml create mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationGroovyTest.txt create mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest-output.txt create mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest.txt create mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationKotlinTest.txt create mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationMustacheTest.txt create mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.LanguageProviderTest.txt create mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest-output.txt create mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest.txt create mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.ScriptResourceProviderTest.txt create mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest-output.txt create mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest.txt create mode 100644 connector/target/test-classes/application.yaml create mode 100644 connector/target/test-classes/test-script.js create mode 100644 runtime/pom.xml create mode 100644 runtime/src/main/java/io/camunda/community/connector/script/App.java create mode 100644 runtime/target/maven-archiver/pom.properties create mode 100644 runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst create mode 100644 runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst create mode 100644 runtime/target/script-connector-runtime-1.2.1-SNAPSHOT.jar.original create mode 100644 runtime/target/spotless-index diff --git a/README.md b/README.md index c816bb0..299c526 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# zeebe-script-worker +# Skript Connector [![](https://img.shields.io/badge/Community%20Extension-An%20open%20source%20community%20maintained%20project-FF4700)](https://github.com/camunda-community-hub/community) [![](https://img.shields.io/badge/Lifecycle-Stable-brightgreen)](https://github.com/Camunda-Community-Hub/community/blob/main/extension-lifecycle.md#stable-) diff --git a/connector/dependency-reduced-pom.xml b/connector/dependency-reduced-pom.xml new file mode 100644 index 0000000..814b036 --- /dev/null +++ b/connector/dependency-reduced-pom.xml @@ -0,0 +1,186 @@ + + + + script-connector-parent + io.camunda.connectors.community + 1.2.1-SNAPSHOT + + 4.0.0 + script-connector + Script Connector + + + + maven-shade-plugin + + + package + + shade + + + + + true + + + + + + + + + + io.camunda.connector + connector-core + 8.3.0 + provided + + + com.fasterxml.jackson.core + jackson-databind + 2.15.3 + provided + + + org.springframework.boot + spring-boot-starter-test + 3.1.5 + test + + + spring-boot-starter + org.springframework.boot + + + spring-boot-test + org.springframework.boot + + + spring-boot-test-autoconfigure + org.springframework.boot + + + json-path + com.jayway.jsonpath + + + jakarta.xml.bind-api + jakarta.xml.bind + + + json-smart + net.minidev + + + hamcrest + org.hamcrest + + + mockito-core + org.mockito + + + mockito-junit-jupiter + org.mockito + + + jsonassert + org.skyscreamer + + + spring-core + org.springframework + + + spring-test + org.springframework + + + xmlunit-core + org.xmlunit + + + + + org.junit.jupiter + junit-jupiter + 5.9.3 + test + + + junit-jupiter-api + org.junit.jupiter + + + junit-jupiter-params + org.junit.jupiter + + + junit-jupiter-engine + org.junit.jupiter + + + + + org.assertj + assertj-core + 3.24.2 + test + + + byte-buddy + net.bytebuddy + + + + + io.camunda.spring + spring-boot-starter-camunda-test + 8.3.0 + test + + + spring-boot-starter-camunda-test-common + io.camunda.spring + + + zeebe-process-test-extension + io.camunda + + + + + io.camunda.connector + spring-boot-starter-camunda-connectors + 8.3.0 + test + + + connector-runtime-spring + io.camunda.connector + + + connector-validation + io.camunda.connector + + + spring-boot-starter-camunda + io.camunda.spring + + + camunda-operate-client-java + io.camunda + + + spring-boot-starter-web + org.springframework.boot + + + spring-boot-starter-actuator + org.springframework.boot + + + + + diff --git a/connector/pom.xml b/connector/pom.xml new file mode 100644 index 0000000..e569a85 --- /dev/null +++ b/connector/pom.xml @@ -0,0 +1,98 @@ + + + 4.0.0 + Script Connector + script-connector + + + io.camunda.connectors.community + script-connector-parent + 1.2.1-SNAPSHOT + + + + + io.camunda.connector + connector-core + provided + + + com.fasterxml.jackson.core + jackson-databind + provided + + + + + com.samskivert + jmustache + + + org.codehaus.groovy + groovy-all + + + org.graalvm.js + js + + + org.graalvm.js + js-scriptengine + + + org.jetbrains.kotlin + kotlin-scripting-jsr223 + + + + org.springframework.boot + spring-boot-starter-test + test + + + org.junit.jupiter + junit-jupiter + test + + + org.assertj + assertj-core + test + + + io.camunda.spring + spring-boot-starter-camunda-test + test + + + io.camunda.connector + spring-boot-starter-camunda-connectors + test + + + + + + + org.apache.maven.plugins + maven-shade-plugin + + true + + + + + + + package + + shade + + + + + + + diff --git a/src/main/java/io/camunda/community/connector/script/LanguageProvider.java b/connector/src/main/java/io/camunda/community/connector/script/LanguageProvider.java similarity index 100% rename from src/main/java/io/camunda/community/connector/script/LanguageProvider.java rename to connector/src/main/java/io/camunda/community/connector/script/LanguageProvider.java diff --git a/src/main/java/io/camunda/community/connector/script/ScriptConnector.java b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java similarity index 99% rename from src/main/java/io/camunda/community/connector/script/ScriptConnector.java rename to connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java index 699d52c..f7eb605 100644 --- a/src/main/java/io/camunda/community/connector/script/ScriptConnector.java +++ b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java @@ -3,7 +3,6 @@ import io.camunda.connector.api.annotation.OutboundConnector; import io.camunda.connector.api.outbound.OutboundConnectorContext; import io.camunda.connector.api.outbound.OutboundConnectorFunction; - import java.util.Map; @OutboundConnector( diff --git a/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java similarity index 99% rename from src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java rename to connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java index 509c4f0..7923047 100644 --- a/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java +++ b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java @@ -1,11 +1,10 @@ package io.camunda.community.connector.script; -import com.fasterxml.jackson.annotation.JsonProperty; +import static io.camunda.community.connector.script.ScriptConnector.*; +import com.fasterxml.jackson.annotation.JsonProperty; import java.util.Map; -import static io.camunda.community.connector.script.ScriptConnector.*; - public record ScriptConnectorInput( @JsonProperty(PARAM_LANGUAGE) String language, @JsonProperty(PARAM_SCRIPT) String script, diff --git a/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java similarity index 74% rename from src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java rename to connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java index b647ff3..886317a 100644 --- a/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java +++ b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java @@ -1,18 +1,11 @@ package io.camunda.community.connector.script; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.node.ObjectNode; +import static java.util.Optional.*; + import io.camunda.connector.api.annotation.OutboundConnector; import io.camunda.connector.api.outbound.OutboundConnectorContext; import io.camunda.connector.api.outbound.OutboundConnectorFunction; - -import java.util.Collections; -import java.util.Iterator; import java.util.Map; -import java.util.Map.Entry; -import java.util.Optional; -import java.util.stream.Collectors; -import java.util.stream.StreamSupport; @OutboundConnector( type = "script", @@ -20,6 +13,7 @@ inputVariables = {}) public class ScriptConnectorLegacy implements OutboundConnectorFunction { private static final String PARAM_LANGUAGE = "language"; + private static final String PARAM_SCRIPT_FORMAT = "scriptFormat"; private static final String PARAM_HEADER = "script"; private final ScriptEvaluator scriptEvaluator = new ScriptEvaluator(); @@ -38,15 +32,19 @@ public Object execute(OutboundConnectorContext outboundConnectorContext) throws } private String getLanguage(Map customHeaders) { - return Optional.ofNullable(customHeaders.get(PARAM_LANGUAGE)) - .orElseThrow( + return ofNullable(customHeaders.get(PARAM_SCRIPT_FORMAT)) + .orElseGet( () -> - new RuntimeException( - String.format("Missing required custom header '%s'", PARAM_LANGUAGE))); + ofNullable(customHeaders.get(PARAM_LANGUAGE)) + .orElseThrow( + () -> + new RuntimeException( + String.format( + "Missing required custom header '%s'", PARAM_LANGUAGE)))); } private String getScript(Map customHeaders) { - return Optional.ofNullable(customHeaders.get(PARAM_HEADER)) + return ofNullable(customHeaders.get(PARAM_HEADER)) .orElseThrow( () -> new RuntimeException( diff --git a/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java b/connector/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java similarity index 94% rename from src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java rename to connector/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java index 9249919..1571247 100644 --- a/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java +++ b/connector/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java @@ -34,8 +34,9 @@ public class ScriptEvaluator { public ScriptEvaluator() { ScriptEvaluatorExtension.load() .forEach( - e -> e.getEvaluatedLanguage() - .forEach(language -> scriptEvaluatorExtensions.put(language, e))); + e -> + e.getEvaluatedLanguage() + .forEach(language -> scriptEvaluatorExtensions.put(language, e))); } public Object evaluate(String language, String script, Map variables) { diff --git a/src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java b/connector/src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java similarity index 88% rename from src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java rename to connector/src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java index ef56325..61db700 100644 --- a/src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java +++ b/connector/src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java @@ -1,13 +1,9 @@ package io.camunda.community.connector.script; import java.io.File; -import java.io.IOException; import java.io.InputStream; -import java.net.MalformedURLException; -import java.net.URI; import java.net.URL; import java.nio.file.Files; -import java.nio.file.Path; import java.util.function.Function; public class ScriptResourceProvider { @@ -65,17 +61,15 @@ private String loadFromFile(String scriptResource) { private String loadFromUrl(String scriptResource) { try { URL scriptUrl = new URL(scriptResource); - try(InputStream in = scriptUrl.openStream()){ + try (InputStream in = scriptUrl.openStream()) { return new String(in.readAllBytes()); } } catch (Exception e) { throw new RuntimeException( - String.format( - "An exception happened while loading resource '%s' from a URL", - scriptResource), + String.format( + "An exception happened while loading resource '%s' from a URL", scriptResource), e); } - } private record ResourceLoader(String identifier, Function strategy) {} diff --git a/src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java b/connector/src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java similarity index 100% rename from src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java rename to connector/src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java diff --git a/src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java b/connector/src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java similarity index 69% rename from src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java rename to connector/src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java index 5683960..53889f2 100644 --- a/src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java +++ b/connector/src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java @@ -7,9 +7,8 @@ import java.util.Set; public interface ScriptEvaluatorExtension { - static List load(){ - return ServiceLoader - .load(ScriptEvaluatorExtension.class).stream().map(Provider::get).toList(); + static List load() { + return ServiceLoader.load(ScriptEvaluatorExtension.class).stream().map(Provider::get).toList(); } Set getEvaluatedLanguage(); diff --git a/src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java b/connector/src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java similarity index 93% rename from src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java rename to connector/src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java index 37528de..9aab06e 100644 --- a/src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java +++ b/connector/src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java @@ -1,6 +1,5 @@ package io.camunda.community.connector.script.spi.impl; -import io.camunda.community.connector.script.LanguageProvider; import io.camunda.community.connector.script.spi.LanguageProviderExtension; import java.io.IOException; import java.io.InputStream; diff --git a/src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java b/connector/src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java similarity index 87% rename from src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java rename to connector/src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java index 3212b50..24a821e 100644 --- a/src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java +++ b/connector/src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java @@ -3,7 +3,6 @@ import com.samskivert.mustache.Mustache; import com.samskivert.mustache.Template; import io.camunda.community.connector.script.spi.ScriptEvaluatorExtension; - import java.util.Map; import java.util.Set; @@ -15,8 +14,7 @@ public Set getEvaluatedLanguage() { @Override public Object evaluateScript(String script, Map context) { - final Template template = Mustache - .compiler().compile(script); + final Template template = Mustache.compiler().compile(script); return template.execute(context); } } diff --git a/src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension b/connector/src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension similarity index 100% rename from src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension rename to connector/src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension diff --git a/src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension b/connector/src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension similarity index 100% rename from src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension rename to connector/src/main/resources/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension diff --git a/src/main/resources/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction b/connector/src/main/resources/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction similarity index 100% rename from src/main/resources/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction rename to connector/src/main/resources/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction diff --git a/connector/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory b/connector/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory new file mode 100644 index 0000000..d8da373 --- /dev/null +++ b/connector/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory @@ -0,0 +1,3 @@ +com.oracle.truffle.js.scriptengine.GraalJSEngineFactory +kotlin.script.experimental.jsr223.KotlinJsr223DefaultScriptEngineFactory +org.codehaus.groovy.jsr223.GroovyScriptEngineFactory \ No newline at end of file diff --git a/src/main/resources/script-resource-extensions.properties b/connector/src/main/resources/script-resource-extensions.properties similarity index 100% rename from src/main/resources/script-resource-extensions.properties rename to connector/src/main/resources/script-resource-extensions.properties diff --git a/src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java b/connector/src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java similarity index 97% rename from src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java rename to connector/src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java index 09aae8b..1bf7acc 100644 --- a/src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java +++ b/connector/src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java @@ -21,8 +21,6 @@ import java.util.Collections; import java.util.List; import java.util.Map; - -import io.camunda.community.connector.script.ScriptEvaluator; import org.junit.jupiter.api.Test; public class EvaluationGroovyTest { diff --git a/src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java b/connector/src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java similarity index 97% rename from src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java rename to connector/src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java index a3aab47..d67d438 100644 --- a/src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java +++ b/connector/src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java @@ -21,8 +21,6 @@ import java.util.Collections; import java.util.List; import java.util.Map; - -import io.camunda.community.connector.script.ScriptEvaluator; import org.junit.jupiter.api.Test; public class EvaluationJavaScriptTest { diff --git a/src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java b/connector/src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java similarity index 96% rename from src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java rename to connector/src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java index bfa4444..e9e284f 100644 --- a/src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java +++ b/connector/src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java @@ -6,8 +6,6 @@ import java.util.Collections; import java.util.List; import java.util.Map; - -import io.camunda.community.connector.script.ScriptEvaluator; import org.junit.jupiter.api.Test; public class EvaluationKotlinTest { diff --git a/src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java b/connector/src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java similarity index 97% rename from src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java rename to connector/src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java index 8fdb0b7..e54e4b3 100644 --- a/src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java +++ b/connector/src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java @@ -19,8 +19,6 @@ import java.util.List; import java.util.Map; - -import io.camunda.community.connector.script.ScriptEvaluator; import org.junit.jupiter.api.Test; public class EvaluationMustacheTest { diff --git a/src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java b/connector/src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java similarity index 92% rename from src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java rename to connector/src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java index d0f718c..e0b93b7 100644 --- a/src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java +++ b/connector/src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java @@ -1,12 +1,12 @@ package io.camunda.community.connector.script; -import org.junit.jupiter.api.Test; - import static org.assertj.core.api.Assertions.*; +import org.junit.jupiter.api.Test; + public class LanguageProviderTest { @Test - void shouldReturnLanguage(){ + void shouldReturnLanguage() { LanguageProvider provider = new LanguageProvider(); String languageForScriptResource = provider.getLanguageForScriptResource("some-resource.js"); assertThat(languageForScriptResource).isEqualTo("javascript"); diff --git a/src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java b/connector/src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java similarity index 97% rename from src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java rename to connector/src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java index cc54c0e..f4818e5 100644 --- a/src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java +++ b/connector/src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java @@ -19,8 +19,6 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy; import java.util.Collections; - -import io.camunda.community.connector.script.ScriptEvaluator; import org.junit.jupiter.api.Test; public class ScriptEvaluatorTest { diff --git a/src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java b/connector/src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java similarity index 96% rename from src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java rename to connector/src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java index f155e9d..73956aa 100644 --- a/src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java +++ b/connector/src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java @@ -1,14 +1,12 @@ package io.camunda.community.connector.script; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; +import static org.assertj.core.api.Assertions.*; import java.io.File; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; - -import static org.assertj.core.api.Assertions.*; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; public class ScriptResourceProviderTest { @Test diff --git a/src/test/java/io/camunda/community/connector/script/WorkflowTest.java b/connector/src/test/java/io/camunda/community/connector/script/WorkflowTest.java similarity index 98% rename from src/test/java/io/camunda/community/connector/script/WorkflowTest.java rename to connector/src/test/java/io/camunda/community/connector/script/WorkflowTest.java index 82101ee..c5b491c 100644 --- a/src/test/java/io/camunda/community/connector/script/WorkflowTest.java +++ b/connector/src/test/java/io/camunda/community/connector/script/WorkflowTest.java @@ -9,7 +9,6 @@ import io.camunda.zeebe.spring.test.ZeebeSpringTest; import java.util.Collections; import java.util.Map; - import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -33,7 +32,7 @@ public void shouldReturnResult() { t.zeebeJobType("script") .zeebeTaskHeader("language", "groovy") .zeebeTaskHeader("script", "x + 1") - .zeebeTaskHeader("resultVariable","result")) + .zeebeTaskHeader("resultVariable", "result")) .done(); final var workflowInstanceResult = diff --git a/src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java b/connector/src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java similarity index 94% rename from src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java rename to connector/src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java index fdbceb4..2eb5212 100644 --- a/src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java +++ b/connector/src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java @@ -15,7 +15,6 @@ */ package io.camunda.community.connector.script; -import io.camunda.zeebe.spring.client.EnableZeebeClient; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; diff --git a/src/test/resources/application.yaml b/connector/src/test/resources/application.yaml similarity index 100% rename from src/test/resources/application.yaml rename to connector/src/test/resources/application.yaml diff --git a/src/test/resources/test-script.js b/connector/src/test/resources/test-script.js similarity index 100% rename from src/test/resources/test-script.js rename to connector/src/test/resources/test-script.js diff --git a/connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension b/connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension new file mode 100644 index 0000000..06a77e5 --- /dev/null +++ b/connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension @@ -0,0 +1 @@ +io.camunda.community.connector.script.spi.impl.DefaultLanguageProviderExtension \ No newline at end of file diff --git a/connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension b/connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension new file mode 100644 index 0000000..0e24ab9 --- /dev/null +++ b/connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension @@ -0,0 +1 @@ +io.camunda.community.connector.script.spi.impl.MustacheEvaluatorExtension \ No newline at end of file diff --git a/connector/target/classes/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction b/connector/target/classes/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction new file mode 100644 index 0000000..62dcd73 --- /dev/null +++ b/connector/target/classes/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction @@ -0,0 +1,2 @@ +io.camunda.community.connector.script.ScriptConnector +io.camunda.community.connector.script.ScriptConnectorLegacy \ No newline at end of file diff --git a/connector/target/classes/META-INF/services/javax.script.ScriptEngineFactory b/connector/target/classes/META-INF/services/javax.script.ScriptEngineFactory new file mode 100644 index 0000000..d8da373 --- /dev/null +++ b/connector/target/classes/META-INF/services/javax.script.ScriptEngineFactory @@ -0,0 +1,3 @@ +com.oracle.truffle.js.scriptengine.GraalJSEngineFactory +kotlin.script.experimental.jsr223.KotlinJsr223DefaultScriptEngineFactory +org.codehaus.groovy.jsr223.GroovyScriptEngineFactory \ No newline at end of file diff --git a/connector/target/classes/script-resource-extensions.properties b/connector/target/classes/script-resource-extensions.properties new file mode 100644 index 0000000..9ce05b2 --- /dev/null +++ b/connector/target/classes/script-resource-extensions.properties @@ -0,0 +1,11 @@ +# javascript +js=javascript +# groovy +groovy=groovy +gvy=groovy +gy=groovy +gsh=groovy +# mustache +mustache=mustache +# kotlin +kt=kotlin \ No newline at end of file diff --git a/connector/target/maven-archiver/pom.properties b/connector/target/maven-archiver/pom.properties new file mode 100644 index 0000000..907964f --- /dev/null +++ b/connector/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=script-connector +groupId=io.camunda.connectors.community +version=1.2.1-SNAPSHOT diff --git a/connector/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/connector/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..335b849 --- /dev/null +++ b/connector/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1,11 @@ +io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.class +io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.class +io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.class +io/camunda/community/connector/script/ScriptEvaluator.class +io/camunda/community/connector/script/ScriptResourceProvider$ResourceLoader.class +io/camunda/community/connector/script/ScriptConnectorLegacy.class +io/camunda/community/connector/script/ScriptResourceProvider.class +io/camunda/community/connector/script/LanguageProvider.class +io/camunda/community/connector/script/spi/LanguageProviderExtension.class +io/camunda/community/connector/script/ScriptConnectorInput.class +io/camunda/community/connector/script/ScriptConnector.class diff --git a/connector/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/connector/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..192d8f3 --- /dev/null +++ b/connector/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1,10 @@ +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/LanguageProvider.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java diff --git a/connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst new file mode 100644 index 0000000..777ce02 --- /dev/null +++ b/connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst @@ -0,0 +1,9 @@ +io/camunda/community/connector/script/EvaluationMustacheTest.class +io/camunda/community/connector/script/EvaluationGroovyTest.class +io/camunda/community/connector/script/ScriptEvaluatorTest.class +io/camunda/community/connector/script/EvaluationKotlinTest.class +io/camunda/community/connector/script/WorkflowTest.class +io/camunda/community/connector/script/LanguageProviderTest.class +io/camunda/community/connector/script/ZeebeScriptWorkerApplication.class +io/camunda/community/connector/script/ScriptResourceProviderTest.class +io/camunda/community/connector/script/EvaluationJavaScriptTest.class diff --git a/connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst new file mode 100644 index 0000000..d948e17 --- /dev/null +++ b/connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst @@ -0,0 +1,9 @@ +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/WorkflowTest.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java +/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java diff --git a/connector/target/spotless-index b/connector/target/spotless-index new file mode 100644 index 0000000..4b44b82 --- /dev/null +++ b/connector/target/spotless-index @@ -0,0 +1,21 @@ +utIHZnvRNj7xTrAcWnBwv7VWpI3WvC5yI7m6aijW2Yo= +pom.xml 2023-10-27T07:36:58.821063413Z +src/main/java/io/camunda/community/connector/script/LanguageProvider.java 2023-10-25T07:48:30.289623662Z +src/main/java/io/camunda/community/connector/script/ScriptConnector.java 2023-10-26T17:42:33.669668276Z +src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java 2023-10-26T17:42:33.665233565Z +src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java 2023-10-26T17:42:09.186069783Z +src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java 2023-10-26T17:42:47.867526457Z +src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java 2023-10-26T17:42:47.842465090Z +src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java 2023-10-25T07:48:30.302029426Z +src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java 2023-10-26T17:42:47.816028310Z +src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java 2023-10-26T17:42:33.631307676Z +src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java 2023-10-26T17:42:47.796067708Z +src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java 2023-10-26T17:42:33.635446083Z +src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java 2023-10-26T17:42:33.661262591Z +src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java 2023-10-26T17:42:33.639697488Z +src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java 2023-10-26T17:42:33.678283516Z +src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java 2023-10-26T17:42:47.728615703Z +src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java 2023-10-26T17:42:33.684434446Z +src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java 2023-10-26T17:42:33.673876605Z +src/test/java/io/camunda/community/connector/script/WorkflowTest.java 2023-10-26T17:42:47.699944985Z +src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java 2023-10-26T17:42:33.648306311Z diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationGroovyTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationGroovyTest.xml new file mode 100644 index 0000000..1456592 --- /dev/null +++ b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationGroovyTest.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationJavaScriptTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationJavaScriptTest.xml new file mode 100644 index 0000000..0f17518 --- /dev/null +++ b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationJavaScriptTest.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +]]> + + + ' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +]]> + + + ' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +]]> + + + ' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +]]> + + + ' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +]]> + + \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationKotlinTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationKotlinTest.xml new file mode 100644 index 0000000..411a2da --- /dev/null +++ b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationKotlinTest.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationMustacheTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationMustacheTest.xml new file mode 100644 index 0000000..1a902b8 --- /dev/null +++ b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationMustacheTest.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.LanguageProviderTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.LanguageProviderTest.xml new file mode 100644 index 0000000..c1eab0b --- /dev/null +++ b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.LanguageProviderTest.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptEvaluatorTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptEvaluatorTest.xml new file mode 100644 index 0000000..ce922aa --- /dev/null +++ b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptEvaluatorTest.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +]]> + + + ' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +]]> + + + + ' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +]]> + + + \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptResourceProviderTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptResourceProviderTest.xml new file mode 100644 index 0000000..7597cb0 --- /dev/null +++ b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptResourceProviderTest.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.WorkflowTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.WorkflowTest.xml new file mode 100644 index 0000000..11df359 --- /dev/null +++ b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.WorkflowTest.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationGroovyTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationGroovyTest.txt new file mode 100644 index 0000000..91e993f --- /dev/null +++ b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationGroovyTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: io.camunda.community.connector.script.EvaluationGroovyTest +------------------------------------------------------------------------------- +Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.051 s -- in io.camunda.community.connector.script.EvaluationGroovyTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest-output.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest-output.txt new file mode 100644 index 0000000..289f9b9 --- /dev/null +++ b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest-output.txt @@ -0,0 +1,45 @@ +[To redirect Truffle log output to a file use one of the following options: +* '--log.file=' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +[To redirect Truffle log output to a file use one of the following options: +* '--log.file=' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +[To redirect Truffle log output to a file use one of the following options: +* '--log.file=' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +[To redirect Truffle log output to a file use one of the following options: +* '--log.file=' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +[To redirect Truffle log output to a file use one of the following options: +* '--log.file=' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest.txt new file mode 100644 index 0000000..4477f88 --- /dev/null +++ b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: io.camunda.community.connector.script.EvaluationJavaScriptTest +------------------------------------------------------------------------------- +Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.157 s -- in io.camunda.community.connector.script.EvaluationJavaScriptTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationKotlinTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationKotlinTest.txt new file mode 100644 index 0000000..47f04fd --- /dev/null +++ b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationKotlinTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: io.camunda.community.connector.script.EvaluationKotlinTest +------------------------------------------------------------------------------- +Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.843 s -- in io.camunda.community.connector.script.EvaluationKotlinTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationMustacheTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationMustacheTest.txt new file mode 100644 index 0000000..210b38a --- /dev/null +++ b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationMustacheTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: io.camunda.community.connector.script.EvaluationMustacheTest +------------------------------------------------------------------------------- +Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 s -- in io.camunda.community.connector.script.EvaluationMustacheTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.LanguageProviderTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.LanguageProviderTest.txt new file mode 100644 index 0000000..2881103 --- /dev/null +++ b/connector/target/surefire-reports/io.camunda.community.connector.script.LanguageProviderTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: io.camunda.community.connector.script.LanguageProviderTest +------------------------------------------------------------------------------- +Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s -- in io.camunda.community.connector.script.LanguageProviderTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest-output.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest-output.txt new file mode 100644 index 0000000..ab8181c --- /dev/null +++ b/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest-output.txt @@ -0,0 +1,27 @@ +[To redirect Truffle log output to a file use one of the following options: +* '--log.file=' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +[To redirect Truffle log output to a file use one of the following options: +* '--log.file=' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. +[To redirect Truffle log output to a file use one of the following options: +* '--log.file=' if the option is passed using a guest language launcher. +* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. +* Configure logging using the polyglot embedding API.] +[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. +The guest application code will therefore be executed in interpreted mode only. +Execution only in interpreted mode will strongly impact the guest application performance. +For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. +To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest.txt new file mode 100644 index 0000000..e6b3470 --- /dev/null +++ b/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: io.camunda.community.connector.script.ScriptEvaluatorTest +------------------------------------------------------------------------------- +Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.405 s -- in io.camunda.community.connector.script.ScriptEvaluatorTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptResourceProviderTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptResourceProviderTest.txt new file mode 100644 index 0000000..2f8375d --- /dev/null +++ b/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptResourceProviderTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: io.camunda.community.connector.script.ScriptResourceProviderTest +------------------------------------------------------------------------------- +Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.014 s -- in io.camunda.community.connector.script.ScriptResourceProviderTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest-output.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest-output.txt new file mode 100644 index 0000000..68e3265 --- /dev/null +++ b/connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest-output.txt @@ -0,0 +1,70 @@ +09:57:27.627 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [io.camunda.community.connector.script.WorkflowTest]: WorkflowTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration. +09:57:27.705 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration io.camunda.community.connector.script.ZeebeScriptWorkerApplication for test class io.camunda.community.connector.script.WorkflowTest + + . ____ _ __ _ _ + /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ +( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ + \\/ ___)| |_)| | | | | || (_| | ) ) ) ) + ' |____| .__|_| |_|_| |_\__, | / / / / + =========|_|==============|___/=/_/_/_/ + :: Spring Boot :: (v3.1.5) + +2023-10-27T09:57:28.166+02:00 INFO 13425 --- [ main] i.c.c.connector.script.WorkflowTest : Starting WorkflowTest using Java 21.0.1 with PID 13425 (started by jonathanlukas in /Users/jonathanlukas/git/camunda/zeebe-script-worker/connector) +2023-10-27T09:57:28.167+02:00 INFO 13425 --- [ main] i.c.c.connector.script.WorkflowTest : No active profile set, falling back to 1 default profile: "default" +2023-10-27T09:57:28.980+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.camunda.zeebe.spring.client.annotation.processor.AnnotationProcessorConfiguration' of type [io.camunda.zeebe.spring.client.annotation.processor.AnnotationProcessorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:28.982+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.camunda.connector.runtime.outbound.OutboundConnectorRuntimeConfiguration' of type [io.camunda.connector.runtime.outbound.OutboundConnectorRuntimeConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.002+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'zeebe.client-io.camunda.zeebe.spring.client.properties.ZeebeClientConfigurationProperties' of type [io.camunda.zeebe.spring.client.properties.ZeebeClientConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.002+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.camunda.zeebe.spring.client.configuration.ZeebeClientAllAutoConfiguration' of type [io.camunda.zeebe.spring.client.configuration.ZeebeClientAllAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.004+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'zeebeClientExecutorService' of type [io.camunda.zeebe.spring.client.jobhandling.ZeebeClientExecutorService] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.007+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'commandExceptionHandlingStrategy' of type [io.camunda.zeebe.spring.client.jobhandling.DefaultCommandExceptionHandlingStrategy] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.008+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.camunda.zeebe.spring.client.CamundaAutoConfiguration' of type [io.camunda.zeebe.spring.client.CamundaAutoConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.009+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.camunda.connector.runtime.OutboundConnectorsAutoConfiguration' of type [io.camunda.connector.runtime.OutboundConnectorsAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.083+02:00 INFO 13425 --- [ main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper@4a14227a)), function-provider: io.camunda.connector.feel.FeelConnectorFunctionProvider@1b254f9b, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] +2023-10-27T09:57:29.212+02:00 INFO 13425 --- [ main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper@179683c3)), function-provider: io.camunda.connector.feel.FeelConnectorFunctionProvider@31b280af, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] +2023-10-27T09:57:29.225+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'objectMapper' of type [com.fasterxml.jackson.databind.json.JsonMapper] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.225+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'zeebeJsonMapper' of type [io.camunda.zeebe.client.impl.ZeebeObjectMapper] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.226+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.camunda.zeebe.spring.client.configuration.ZeebeActuatorConfiguration' of type [io.camunda.zeebe.spring.client.configuration.ZeebeActuatorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.252+02:00 INFO 13425 --- [ main] i.c.z.s.c.a.MicrometerMetricsRecorder : Enabling Micrometer based metrics for spring-zeebe (available via Actuator) +2023-10-27T09:57:29.252+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'micrometerMetricsRecorder' of type [io.camunda.zeebe.spring.client.actuator.MicrometerMetricsRecorder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.254+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'jobWorkerManager' of type [io.camunda.zeebe.spring.client.jobhandling.JobWorkerManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.262+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'outboundConnectorFactory' of type [io.camunda.connector.runtime.core.outbound.DefaultOutboundConnectorFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.264+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'defaultSecretProvider' of type [io.camunda.connector.runtime.env.SpringEnvironmentSecretProvider] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.265+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'springSecretProviderAggregator' of type [io.camunda.connector.runtime.core.secret.SecretProviderAggregator] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.268+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'outboundConnectorManager' of type [io.camunda.connector.runtime.outbound.lifecycle.OutboundConnectorManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.270+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'annotationProcessor' of type [io.camunda.connector.runtime.outbound.lifecycle.OutboundConnectorAnnotationProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.271+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'deploymentPostProcessor' of type [io.camunda.zeebe.spring.client.annotation.processor.ZeebeDeploymentAnnotationProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.273+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'propertyBasedZeebeWorkerValueCustomizer' of type [io.camunda.zeebe.spring.client.properties.PropertyBasedZeebeWorkerValueCustomizer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.275+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'zeebeWorkerPostProcessor' of type [io.camunda.zeebe.spring.client.annotation.processor.ZeebeWorkerAnnotationProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) +2023-10-27T09:57:29.562+02:00 WARN 13425 --- [ main] o.s.b.a.m.MustacheAutoConfiguration : Cannot find template location: classpath:/templates/ (please add some templates, check your Mustache configuration, or set spring.mustache.check-template-location=false) +2023-10-27T09:57:29.570+02:00 INFO 13425 --- [ main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper@54bd2345)), function-provider: io.camunda.connector.feel.FeelConnectorFunctionProvider@48b5669c, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] +2023-10-27T09:57:29.944+02:00 INFO 13425 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path '/actuator' +2023-10-27T09:57:29.990+02:00 INFO 13425 --- [ main] i.c.c.connector.script.WorkflowTest : Started WorkflowTest in 2.124 seconds (process running for 10.546) +2023-10-27T09:57:30.088+02:00 INFO 13425 --- [ main] i.c.z.s.test.ZeebeTestExecutionListener : Create Zeebe in-memory engine for test run on random port: 61300... +2023-10-27T09:57:30.449+02:00 INFO 13425 --- [ zb-actors-13] io.camunda.zeebe.logstreams : Recovered state of partition 1 from snapshot at position -1 +2023-10-27T09:57:30.484+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@4178b4ab)), function-provider: io.camunda.zeebe.feel.impl.FeelFunctionProvider@57546a8d, clock: io.camunda.zeebe.engine.processing.bpmn.clock.ZeebeFeelEngineClock@539d4074, configuration: {externalFunctionsEnabled: false}] +2023-10-27T09:57:30.533+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.dmn.DmnEngine : DMN-Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@778cb5cf)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, audit-loggers: List(), configuration: Configuration(false,false,false)] +2023-10-27T09:57:30.535+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.dmn.NoUnpackValueMapper@16da5391)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] +2023-10-27T09:57:30.564+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.dmn.DmnEngine : DMN-Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@168b4c40)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, audit-loggers: List(), configuration: Configuration(false,false,false)] +2023-10-27T09:57:30.564+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.dmn.NoUnpackValueMapper@60e7f530)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] +2023-10-27T09:57:30.588+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.dmn.DmnEngine : DMN-Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@49bef4c7)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, audit-loggers: List(), configuration: Configuration(false,false,false)] +2023-10-27T09:57:30.588+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.dmn.NoUnpackValueMapper@5e3df12)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] +2023-10-27T09:57:30.590+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@637795d3)), function-provider: io.camunda.zeebe.feel.impl.FeelFunctionProvider@6378eb65, clock: io.camunda.zeebe.engine.processing.bpmn.clock.ZeebeFeelEngineClock@413b9b8e, configuration: {externalFunctionsEnabled: false}] +2023-10-27T09:57:30.625+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@64000559)), function-provider: io.camunda.zeebe.feel.impl.FeelFunctionProvider@2ffc8a06, clock: io.camunda.zeebe.engine.processing.bpmn.clock.ZeebeFeelEngineClock@14bcc36f, configuration: {externalFunctionsEnabled: false}] +2023-10-27T09:57:30.626+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@1a53c292)), function-provider: io.camunda.zeebe.feel.impl.FeelFunctionProvider@7813a124, clock: io.camunda.zeebe.engine.processing.bpmn.clock.ZeebeFeelEngineClock@40c115eb, configuration: {externalFunctionsEnabled: false}] +2023-10-27T09:57:30.650+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.dmn.DmnEngine : DMN-Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@58300ed0)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, audit-loggers: List(), configuration: Configuration(false,false,false)] +2023-10-27T09:57:30.650+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.dmn.NoUnpackValueMapper@654a1fa7)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] +2023-10-27T09:57:30.700+02:00 INFO 13425 --- [ zb-actors-13] io.camunda.zeebe.processor : Processor starts replay of events. [snapshot-position: -1, replay-mode: PROCESSING] +2023-10-27T09:57:30.701+02:00 INFO 13425 --- [ zb-actors-13] io.camunda.zeebe.processor : Processor finished replay, with [lastProcessedPosition: -1, lastWrittenPosition: -1] +2023-10-27T09:57:30.703+02:00 INFO 13425 --- [ main] z.s.t.AbstractZeebeTestExecutionListener : Test engine setup. Now starting deployments and workers... +2023-10-27T09:57:30.769+02:00 INFO 13425 --- [ main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper@69464a0f)), function-provider: io.camunda.connector.feel.FeelConnectorFunctionProvider@3f2f83d5, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] +2023-10-27T09:57:30.782+02:00 INFO 13425 --- [ main] i.c.z.s.c.jobhandling.JobWorkerManager : . Starting Zeebe worker: ZeebeWorkerValue{type='io.camunda.community:script', name='connector-script', timeout=null, maxJobsActive=null, requestTimeout=null, pollInterval=null, autoComplete=true, fetchVariables=[], enabled=null, methodInfo=null} +2023-10-27T09:57:30.783+02:00 INFO 13425 --- [ main] i.c.z.s.c.jobhandling.JobWorkerManager : . Starting Zeebe worker: ZeebeWorkerValue{type='script', name='connector-script-legacy', timeout=null, maxJobsActive=null, requestTimeout=null, pollInterval=null, autoComplete=true, fetchVariables=[], enabled=null, methodInfo=null} +2023-10-27T09:57:30.784+02:00 INFO 13425 --- [ main] z.s.t.AbstractZeebeTestExecutionListener : ...deployments and workers started. +WARNING: A Java agent has been loaded dynamically (/Users/jonathanlukas/.m2/repository/net/bytebuddy/byte-buddy-agent/1.14.9/byte-buddy-agent-1.14.9.jar) +WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning +WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information +WARNING: Dynamic loading of agents will be disallowed by default in a future release +2023-10-27T09:57:32.039+02:00 INFO 13425 --- [pool-6-thread-1] i.c.c.r.c.outbound.ConnectorJobHandler : Received job 2251799813685273 +2023-10-27T09:57:32.129+02:00 INFO 13425 --- [ zb-actors-1] io.camunda.zeebe.logstreams : Close appender for log stream null +2023-10-27T09:57:32.129+02:00 INFO 13425 --- [ zb-actors-1] i.c.zeebe.logstreams.impl.log.Sequencer : Closing sequencer for writing +2023-10-27T09:57:32.130+02:00 INFO 13425 --- [ zb-actors-11] io.camunda.zeebe.logstreams : On closing logstream null close 2 readers diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest.txt new file mode 100644 index 0000000..55bad23 --- /dev/null +++ b/connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest.txt @@ -0,0 +1,4 @@ +------------------------------------------------------------------------------- +Test set: io.camunda.community.connector.script.WorkflowTest +------------------------------------------------------------------------------- +Tests run: 3, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 4.699 s -- in io.camunda.community.connector.script.WorkflowTest diff --git a/connector/target/test-classes/application.yaml b/connector/target/test-classes/application.yaml new file mode 100644 index 0000000..d28a711 --- /dev/null +++ b/connector/target/test-classes/application.yaml @@ -0,0 +1,7 @@ +camunda.operate.enabled: false +camunda: + connector: + webhook: + enabled: false + polling: + enabled: false \ No newline at end of file diff --git a/connector/target/test-classes/test-script.js b/connector/target/test-classes/test-script.js new file mode 100644 index 0000000..b321213 --- /dev/null +++ b/connector/target/test-classes/test-script.js @@ -0,0 +1 @@ +a + b; \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 47f892b..a8d6a61 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -6,8 +6,8 @@ networks: services: zeebe: - container_name: zeebe_broker - image: camunda/zeebe:8.1.5 + container_name: zeebe + image: camunda/zeebe:8.3.0 environment: - ZEEBE_LOG_LEVEL=debug ports: @@ -16,11 +16,18 @@ services: networks: - zeebe_network zeebe-script-worker: - container_name: zeebe-script-worker - image: ghcr.io/camunda-community-hub/zeebe-script-worker:1.2.0 + container_name: connector-runtime + image: camunda/connectors:8.3.0 environment: - - zeebe.client.broker.contactPoint=zeebe:26500 + - ZEEBE_CLIENT_BROKER_GATEWAY-ADDRESS=zeebe:26500 + - ZEEBE_CLIENT_SECURITY_PLAINTEXT=true + - CAMUNDA_CONNECTOR_POLLING_ENABLED=false + - CAMUNDA_CONNECTOR_WEBHOOK_ENABLED=false + - SPRING_MAIN_WEB-APPLICATION-TYPE=none + - OPERATE_CLIENT_ENABLED=false depends_on: - zeebe networks: - zeebe_network + volumes: + - ./../connector/target/script-connector-1.2.1-SNAPSHOT-shaded.jar:/opt/app/script-connector.jar diff --git a/pom.xml b/pom.xml index 106fae5..13de980 100644 --- a/pom.xml +++ b/pom.xml @@ -3,11 +3,15 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - Zeebe Script Worker - io.zeebe - zeebe-script-worker + Script Connector Parent + + connector + runtime + + io.camunda.connectors.community + script-connector-parent 1.2.1-SNAPSHOT - jar + pom org.camunda.community @@ -50,6 +54,7 @@ 3.0.1 1.14.2 3.3.0 + 3.3.0 @@ -78,91 +83,49 @@ pom import - + + io.camunda.connector + connector-core + ${version.camunda-connectors} + + + io.camunda.spring + spring-boot-starter-camunda-test + ${version.camunda-spring} + + + io.camunda.connector + spring-boot-starter-camunda-connectors + ${version.camunda-connectors} + + + org.codehaus.groovy + groovy-all + ${version.groovy} + + + org.graalvm.js + js + ${version.graalvm} + + + org.graalvm.js + js-scriptengine + ${version.graalvm} + + + org.jetbrains.kotlin + kotlin-scripting-jsr223 + ${version.kotlin} + + + io.camunda.connectors.community + script-connector + ${project.version} + - - - io.camunda.connector - connector-core - provided - ${version.camunda-connectors} - - - com.fasterxml.jackson.core - jackson-databind - - - - - - com.samskivert - jmustache - compile - - - org.codehaus.groovy - groovy-all - ${version.groovy} - - - - org.graalvm.sdk - graal-sdk - ${version.graalvm} - - - - org.graalvm.js - js - ${version.graalvm} - - - - org.graalvm.js - js-scriptengine - ${version.graalvm} - - - - org.jetbrains.kotlin - kotlin-scripting-jsr223 - ${version.kotlin} - - - - - org.springframework.boot - spring-boot-starter-test - test - - - org.junit.jupiter - junit-jupiter - 5.10.0 - test - - - org.assertj - assertj-core - 3.24.2 - test - - - io.camunda.spring - spring-boot-starter-camunda-test - ${version.camunda-spring} - test - - - io.camunda.connector - spring-boot-starter-camunda-connectors - ${version.camunda-connectors} - test - - - @@ -255,7 +218,7 @@ - + @@ -277,8 +240,8 @@ *.md .gitignore - - + + true 2 @@ -286,9 +249,9 @@ - + - + @@ -323,7 +286,7 @@ - + @@ -332,47 +295,6 @@ - - - - org.apache.maven.plugins - maven-surefire-plugin - 3.1.0 - - - - org.apache.maven.plugins - maven-javadoc-plugin - - ${version.java} - - - - - org.springframework.boot - spring-boot-maven-plugin - ${version.spring.boot} - - - - repackage - - - - - - - - org.jetbrains.kotlin - kotlin-compiler-embeddable - - - - - - @@ -423,38 +345,4 @@ - - - - zeebe - Zeebe Repository - https://artifacts.camunda.com/artifactory/zeebe-io/ - - true - - - false - - - - - zeebe-snapshots - Zeebe Snapshot Repository - https://artifacts.camunda.com/artifactory/zeebe-io-snapshots/ - - false - - - true - - - - - - https://github.com/camunda-community-hub/zeebe-script-worker - scm:git:git@github.com:camunda-community-hub/zeebe-script-worker.git - scm:git:git@github.com:camunda-community-hub/zeebe-script-worker.git - HEAD - - diff --git a/runtime/pom.xml b/runtime/pom.xml new file mode 100644 index 0000000..f59cf74 --- /dev/null +++ b/runtime/pom.xml @@ -0,0 +1,53 @@ + + + 4.0.0 + + io.camunda.connectors.community + script-connector-parent + 1.2.1-SNAPSHOT + + + script-connector-runtime + Script Connector Runtime + + + + io.camunda.connectors.community + script-connector + + + io.camunda.connector + spring-boot-starter-camunda-connectors + + + + + + org.springframework.boot + spring-boot-maven-plugin + ${version.spring.boot} + + + + repackage + + + + + + + + org.jetbrains.kotlin + kotlin-compiler-embeddable + + + + + + + + \ No newline at end of file diff --git a/runtime/src/main/java/io/camunda/community/connector/script/App.java b/runtime/src/main/java/io/camunda/community/connector/script/App.java new file mode 100644 index 0000000..3ecb93a --- /dev/null +++ b/runtime/src/main/java/io/camunda/community/connector/script/App.java @@ -0,0 +1,11 @@ +package io.camunda.community.connector.script; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class App { + public static void main(String[] args) { + SpringApplication.run(App.class, args); + } +} diff --git a/runtime/target/maven-archiver/pom.properties b/runtime/target/maven-archiver/pom.properties new file mode 100644 index 0000000..d96cf1f --- /dev/null +++ b/runtime/target/maven-archiver/pom.properties @@ -0,0 +1,3 @@ +artifactId=script-connector-runtime +groupId=io.camunda.connectors.community +version=1.2.1-SNAPSHOT diff --git a/runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst new file mode 100644 index 0000000..7f0f934 --- /dev/null +++ b/runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst @@ -0,0 +1 @@ +io/camunda/community/connector/script/App.class diff --git a/runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst new file mode 100644 index 0000000..4677ffd --- /dev/null +++ b/runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst @@ -0,0 +1 @@ +/Users/jonathanlukas/git/camunda/zeebe-script-worker/runtime/src/main/java/io/camunda/community/connector/script/App.java diff --git a/runtime/target/script-connector-runtime-1.2.1-SNAPSHOT.jar.original b/runtime/target/script-connector-runtime-1.2.1-SNAPSHOT.jar.original new file mode 100644 index 0000000000000000000000000000000000000000..68f794f7fd238dfb632f452e225b5aaec29044ca GIT binary patch literal 3258 zcmWIWW@h1HVBlb2F!7HLXFvj+K(?=Ih@-BjpPPOFP?-o&83$O|L-qdqi-FR{j0_Aw zQG_yIM?X(D*WeI6U$@@AgIvu90xs{H{%^1sSXp)2ckh;_wGuCFXXHjog?D-`tiN9+ zeA_vn`ST3(-n3m09~~9F>m=;$G1*xrly9rM@~P=9ZuS!w>RDyv?htmK_e49GZIj!T zXNp&Pnp<>w7n@$}WqWHMy+}Pjut`ehtlX+jNp^e77fjVsh5h+@DfeY(pY&YuMdHQ_ z3#;DEM+I;GUwP|eboeB$QoX3sJzwm1%r)=32l5nlzcT|pm6;FrHFgEu5CzGJxutn2 ziFg!>qAEcWg!DKW?KZ{;Xx{mqVKx4@_C36LNQ!u_|}; z=hi>w`y>zZUOTz0V9U2pSF7eK9bL<^STOH#-+?o`g3Pkrm)VrBx)y#d_SBsy{pp4$ zWJN_!O*Zv;9<}YK%5KTbz?I8p*5B&TseLiqe{=2$n~B%s_r^pN`=!1PiF?W0b+oif z??UtqW8Dq&Ctl3IZFT*f^9oUk^lbrGy)3!j>)rS~f2Cl>tiRiN8W)8fc`f6=&3FH! zJw>X`a=D(|OT2IIa@xPp!9L+Y`a+KfPinJmu2#A7w%+a8Xt(Z|$MR^^&ZO1XZZEp* zQhsUwvm+Ld3?{$T@^m2^^v2iD=MXU!7Y(Dzg{)TUKG4%+Xnkv&PC)wKrePI8zrh$NyuSm%z$3!dlHY?w;!Wy8OA7@VU!1rZu1D9KG~R)?<(C z(Z2>q6ZTxPoN|A+)slZbn|armu4-j`8sy(6?q>e=y3N#CX^XN#^fH!BJ*1VHTo|dS zc2_ukZ{l;cp2_7(#T+-zoVYb{s`$%y&viDvoa5Ad$m^Elmzc7y zW(hdF<#9>+26^sWxeV_-_0H#)Up%?*dP8-e;`Z|WhqaD;S@6P^euZ1246 zxj2febGG;FHMc#I)q)#3>r-_08MT&tPP^tcE3(FL!B5sVj=O`jgjn7zSmoWbic4*6 z?tx8{x7S_lW8~Adtf?=lDJrnB>uDC)bnxPV^KMcbw$Hm4mRRPxUoU&f-0A{j<$$a$ z$~)Z64{8g!onYO0ZPO9PhAg&9y|kz2q=mMp+AE)%=iR({@7sgrx>9X**LwxHjZGYO z{B~Sg&xlCkpc*>=SZ`Y-Fli?PaTt}8ctKHqL26M+W@@qRDMP*n1s;csb9Xy5SvSwt z%UUF^AnMB=71Y(aefr6_&!4*n?ooPC)5g{0s%sF)l)CYfhoO2g_x4MSo0?}x&%O9} z#kVtm7w&uJ88lI|!rUVNd+MEUnYL%x1H2iTM3}MHsh|c21PCy^bp)~Cl@LT5qBKWu zfI#&zENN6n)`rv^!Dlh3wubZFugbjnY9dHK@sP%v_^B2%ecr?P=61X*ks%C^{ zbzoVJrkQZt0=MCy)&;`w64DLF)7Ajlib$X6tqqvHOB!zhZAD5fh&V??7<$_S5`hrI zvDI=2!}qh099}rR1g-OsEyq^=AS_?RPF>3prBQ%4E3iUmVBiHpQ=k{~fxQ(51^_Av BOF;kt literal 0 HcmV?d00001 diff --git a/runtime/target/spotless-index b/runtime/target/spotless-index new file mode 100644 index 0000000..8d36f60 --- /dev/null +++ b/runtime/target/spotless-index @@ -0,0 +1,3 @@ +sxcJ+sQ94Ntqsx4ZtGuNZjNjACy3xzdHs8+A+vidvg4= +pom.xml 2023-10-27T07:57:09.617921783Z +src/main/java/io/camunda/community/connector/script/App.java 2023-10-27T07:52:53.355613122Z From 6effa8a7de50f6d1c191632a01236a85184a39d9 Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Fri, 27 Oct 2023 11:27:10 +0200 Subject: [PATCH 03/13] gitignore --- .gitignore | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 4213124..9b09632 100644 --- a/.gitignore +++ b/.gitignore @@ -21,11 +21,11 @@ # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml hs_err_pid* -/.classpath -/.project -/.settings -/target - -# intellij +target .idea *.iml + +#eclipse +**.project +**.classpath +**.settings From 88876e80b5b866ed0a1bcae4ffa7fb031b5d15f8 Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Fri, 27 Oct 2023 11:27:50 +0200 Subject: [PATCH 04/13] added changes --- connector/pom.xml | 3 +++ .../camunda/community/connector/script/ScriptConnector.java | 4 ++-- .../community/connector/script/ScriptConnectorLegacy.java | 2 +- docker/docker-compose.yml | 2 +- pom.xml | 2 -- 5 files changed, 7 insertions(+), 6 deletions(-) diff --git a/connector/pom.xml b/connector/pom.xml index e569a85..d60ffca 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -79,7 +79,10 @@ org.apache.maven.plugins maven-shade-plugin + ${project.build.finalName}-with-script-engines true + true + ${project.build.directory}/dependency-reduced-pom.xml diff --git a/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java index f7eb605..8a376e5 100644 --- a/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java +++ b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java @@ -6,8 +6,8 @@ import java.util.Map; @OutboundConnector( - type = "io.camunda.community:script", - name = "connector-script", + type = "io.camunda.community:script-connector", + name = "script-connector", inputVariables = {}) public class ScriptConnector implements OutboundConnectorFunction { static final String PARAM_LANGUAGE = "language"; diff --git a/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java index 886317a..cad0647 100644 --- a/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java +++ b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java @@ -9,7 +9,7 @@ @OutboundConnector( type = "script", - name = "connector-script-legacy", + name = "script-connector-legacy", inputVariables = {}) public class ScriptConnectorLegacy implements OutboundConnectorFunction { private static final String PARAM_LANGUAGE = "language"; diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index a8d6a61..648d0fb 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -30,4 +30,4 @@ services: networks: - zeebe_network volumes: - - ./../connector/target/script-connector-1.2.1-SNAPSHOT-shaded.jar:/opt/app/script-connector.jar + - ./../connector/target/script-connector-1.2.1-SNAPSHOT-with-script-engines.jar:/opt/app/script-connector.jar diff --git a/pom.xml b/pom.xml index 13de980..2bd29cc 100644 --- a/pom.xml +++ b/pom.xml @@ -67,7 +67,6 @@ import pom - org.jetbrains.kotlin kotlin-bom @@ -75,7 +74,6 @@ pom import - org.springframework.boot spring-boot-dependencies From c743834769d412eec468877a3a1a0563f006a896 Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Fri, 27 Oct 2023 11:32:09 +0200 Subject: [PATCH 05/13] Delete connector/target directory --- ...ector.script.spi.LanguageProviderExtension | 1 - ...nector.script.spi.ScriptEvaluatorExtension | 1 - ...tor.api.outbound.OutboundConnectorFunction | 2 - .../services/javax.script.ScriptEngineFactory | 3 - .../script-resource-extensions.properties | 11 -- .../target/maven-archiver/pom.properties | 3 - .../compile/default-compile/createdFiles.lst | 11 -- .../compile/default-compile/inputFiles.lst | 10 -- .../default-testCompile/createdFiles.lst | 9 - .../default-testCompile/inputFiles.lst | 9 - connector/target/spotless-index | 21 --- ....connector.script.EvaluationGroovyTest.xml | 80 --------- ...nector.script.EvaluationJavaScriptTest.xml | 130 --------------- ....connector.script.EvaluationKotlinTest.xml | 75 --------- ...onnector.script.EvaluationMustacheTest.xml | 80 --------- ....connector.script.LanguageProviderTest.xml | 76 --------- ...y.connector.script.ScriptEvaluatorTest.xml | 111 ------------- ...ctor.script.ScriptResourceProviderTest.xml | 77 --------- ...ommunity.connector.script.WorkflowTest.xml | 155 ------------------ ....connector.script.EvaluationGroovyTest.txt | 4 - ...script.EvaluationJavaScriptTest-output.txt | 45 ----- ...nector.script.EvaluationJavaScriptTest.txt | 4 - ....connector.script.EvaluationKotlinTest.txt | 4 - ...onnector.script.EvaluationMustacheTest.txt | 4 - ....connector.script.LanguageProviderTest.txt | 4 - ...ctor.script.ScriptEvaluatorTest-output.txt | 27 --- ...y.connector.script.ScriptEvaluatorTest.txt | 4 - ...ctor.script.ScriptResourceProviderTest.txt | 4 - ...y.connector.script.WorkflowTest-output.txt | 70 -------- ...ommunity.connector.script.WorkflowTest.txt | 4 - .../target/test-classes/application.yaml | 7 - connector/target/test-classes/test-script.js | 1 - 32 files changed, 1047 deletions(-) delete mode 100644 connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension delete mode 100644 connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension delete mode 100644 connector/target/classes/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction delete mode 100644 connector/target/classes/META-INF/services/javax.script.ScriptEngineFactory delete mode 100644 connector/target/classes/script-resource-extensions.properties delete mode 100644 connector/target/maven-archiver/pom.properties delete mode 100644 connector/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst delete mode 100644 connector/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst delete mode 100644 connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst delete mode 100644 connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst delete mode 100644 connector/target/spotless-index delete mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationGroovyTest.xml delete mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationJavaScriptTest.xml delete mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationKotlinTest.xml delete mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationMustacheTest.xml delete mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.LanguageProviderTest.xml delete mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptEvaluatorTest.xml delete mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptResourceProviderTest.xml delete mode 100644 connector/target/surefire-reports/TEST-io.camunda.community.connector.script.WorkflowTest.xml delete mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationGroovyTest.txt delete mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest-output.txt delete mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest.txt delete mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationKotlinTest.txt delete mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationMustacheTest.txt delete mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.LanguageProviderTest.txt delete mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest-output.txt delete mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest.txt delete mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.ScriptResourceProviderTest.txt delete mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest-output.txt delete mode 100644 connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest.txt delete mode 100644 connector/target/test-classes/application.yaml delete mode 100644 connector/target/test-classes/test-script.js diff --git a/connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension b/connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension deleted file mode 100644 index 06a77e5..0000000 --- a/connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.LanguageProviderExtension +++ /dev/null @@ -1 +0,0 @@ -io.camunda.community.connector.script.spi.impl.DefaultLanguageProviderExtension \ No newline at end of file diff --git a/connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension b/connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension deleted file mode 100644 index 0e24ab9..0000000 --- a/connector/target/classes/META-INF/services/io.camunda.community.connector.script.spi.ScriptEvaluatorExtension +++ /dev/null @@ -1 +0,0 @@ -io.camunda.community.connector.script.spi.impl.MustacheEvaluatorExtension \ No newline at end of file diff --git a/connector/target/classes/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction b/connector/target/classes/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction deleted file mode 100644 index 62dcd73..0000000 --- a/connector/target/classes/META-INF/services/io.camunda.connector.api.outbound.OutboundConnectorFunction +++ /dev/null @@ -1,2 +0,0 @@ -io.camunda.community.connector.script.ScriptConnector -io.camunda.community.connector.script.ScriptConnectorLegacy \ No newline at end of file diff --git a/connector/target/classes/META-INF/services/javax.script.ScriptEngineFactory b/connector/target/classes/META-INF/services/javax.script.ScriptEngineFactory deleted file mode 100644 index d8da373..0000000 --- a/connector/target/classes/META-INF/services/javax.script.ScriptEngineFactory +++ /dev/null @@ -1,3 +0,0 @@ -com.oracle.truffle.js.scriptengine.GraalJSEngineFactory -kotlin.script.experimental.jsr223.KotlinJsr223DefaultScriptEngineFactory -org.codehaus.groovy.jsr223.GroovyScriptEngineFactory \ No newline at end of file diff --git a/connector/target/classes/script-resource-extensions.properties b/connector/target/classes/script-resource-extensions.properties deleted file mode 100644 index 9ce05b2..0000000 --- a/connector/target/classes/script-resource-extensions.properties +++ /dev/null @@ -1,11 +0,0 @@ -# javascript -js=javascript -# groovy -groovy=groovy -gvy=groovy -gy=groovy -gsh=groovy -# mustache -mustache=mustache -# kotlin -kt=kotlin \ No newline at end of file diff --git a/connector/target/maven-archiver/pom.properties b/connector/target/maven-archiver/pom.properties deleted file mode 100644 index 907964f..0000000 --- a/connector/target/maven-archiver/pom.properties +++ /dev/null @@ -1,3 +0,0 @@ -artifactId=script-connector -groupId=io.camunda.connectors.community -version=1.2.1-SNAPSHOT diff --git a/connector/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/connector/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst deleted file mode 100644 index 335b849..0000000 --- a/connector/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ /dev/null @@ -1,11 +0,0 @@ -io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.class -io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.class -io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.class -io/camunda/community/connector/script/ScriptEvaluator.class -io/camunda/community/connector/script/ScriptResourceProvider$ResourceLoader.class -io/camunda/community/connector/script/ScriptConnectorLegacy.class -io/camunda/community/connector/script/ScriptResourceProvider.class -io/camunda/community/connector/script/LanguageProvider.class -io/camunda/community/connector/script/spi/LanguageProviderExtension.class -io/camunda/community/connector/script/ScriptConnectorInput.class -io/camunda/community/connector/script/ScriptConnector.class diff --git a/connector/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/connector/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst deleted file mode 100644 index 192d8f3..0000000 --- a/connector/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ /dev/null @@ -1,10 +0,0 @@ -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/LanguageProvider.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java diff --git a/connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst b/connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst deleted file mode 100644 index 777ce02..0000000 --- a/connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/createdFiles.lst +++ /dev/null @@ -1,9 +0,0 @@ -io/camunda/community/connector/script/EvaluationMustacheTest.class -io/camunda/community/connector/script/EvaluationGroovyTest.class -io/camunda/community/connector/script/ScriptEvaluatorTest.class -io/camunda/community/connector/script/EvaluationKotlinTest.class -io/camunda/community/connector/script/WorkflowTest.class -io/camunda/community/connector/script/LanguageProviderTest.class -io/camunda/community/connector/script/ZeebeScriptWorkerApplication.class -io/camunda/community/connector/script/ScriptResourceProviderTest.class -io/camunda/community/connector/script/EvaluationJavaScriptTest.class diff --git a/connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst b/connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst deleted file mode 100644 index d948e17..0000000 --- a/connector/target/maven-status/maven-compiler-plugin/testCompile/default-testCompile/inputFiles.lst +++ /dev/null @@ -1,9 +0,0 @@ -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/WorkflowTest.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java -/Users/jonathanlukas/git/camunda/zeebe-script-worker/connector/src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java diff --git a/connector/target/spotless-index b/connector/target/spotless-index deleted file mode 100644 index 4b44b82..0000000 --- a/connector/target/spotless-index +++ /dev/null @@ -1,21 +0,0 @@ -utIHZnvRNj7xTrAcWnBwv7VWpI3WvC5yI7m6aijW2Yo= -pom.xml 2023-10-27T07:36:58.821063413Z -src/main/java/io/camunda/community/connector/script/LanguageProvider.java 2023-10-25T07:48:30.289623662Z -src/main/java/io/camunda/community/connector/script/ScriptConnector.java 2023-10-26T17:42:33.669668276Z -src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java 2023-10-26T17:42:33.665233565Z -src/main/java/io/camunda/community/connector/script/ScriptConnectorLegacy.java 2023-10-26T17:42:09.186069783Z -src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java 2023-10-26T17:42:47.867526457Z -src/main/java/io/camunda/community/connector/script/ScriptResourceProvider.java 2023-10-26T17:42:47.842465090Z -src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java 2023-10-25T07:48:30.302029426Z -src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java 2023-10-26T17:42:47.816028310Z -src/main/java/io/camunda/community/connector/script/spi/impl/DefaultLanguageProviderExtension.java 2023-10-26T17:42:33.631307676Z -src/main/java/io/camunda/community/connector/script/spi/impl/MustacheEvaluatorExtension.java 2023-10-26T17:42:47.796067708Z -src/test/java/io/camunda/community/connector/script/EvaluationGroovyTest.java 2023-10-26T17:42:33.635446083Z -src/test/java/io/camunda/community/connector/script/EvaluationJavaScriptTest.java 2023-10-26T17:42:33.661262591Z -src/test/java/io/camunda/community/connector/script/EvaluationKotlinTest.java 2023-10-26T17:42:33.639697488Z -src/test/java/io/camunda/community/connector/script/EvaluationMustacheTest.java 2023-10-26T17:42:33.678283516Z -src/test/java/io/camunda/community/connector/script/LanguageProviderTest.java 2023-10-26T17:42:47.728615703Z -src/test/java/io/camunda/community/connector/script/ScriptEvaluatorTest.java 2023-10-26T17:42:33.684434446Z -src/test/java/io/camunda/community/connector/script/ScriptResourceProviderTest.java 2023-10-26T17:42:33.673876605Z -src/test/java/io/camunda/community/connector/script/WorkflowTest.java 2023-10-26T17:42:47.699944985Z -src/test/java/io/camunda/community/connector/script/ZeebeScriptWorkerApplication.java 2023-10-26T17:42:33.648306311Z diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationGroovyTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationGroovyTest.xml deleted file mode 100644 index 1456592..0000000 --- a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationGroovyTest.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationJavaScriptTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationJavaScriptTest.xml deleted file mode 100644 index 0f17518..0000000 --- a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationJavaScriptTest.xml +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -]]> - - - ' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -]]> - - - ' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -]]> - - - ' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -]]> - - - ' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -]]> - - \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationKotlinTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationKotlinTest.xml deleted file mode 100644 index 411a2da..0000000 --- a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationKotlinTest.xml +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationMustacheTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationMustacheTest.xml deleted file mode 100644 index 1a902b8..0000000 --- a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.EvaluationMustacheTest.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.LanguageProviderTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.LanguageProviderTest.xml deleted file mode 100644 index c1eab0b..0000000 --- a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.LanguageProviderTest.xml +++ /dev/null @@ -1,76 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptEvaluatorTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptEvaluatorTest.xml deleted file mode 100644 index ce922aa..0000000 --- a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptEvaluatorTest.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -]]> - - - ' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -]]> - - - - ' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -]]> - - - \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptResourceProviderTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptResourceProviderTest.xml deleted file mode 100644 index 7597cb0..0000000 --- a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.ScriptResourceProviderTest.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.WorkflowTest.xml b/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.WorkflowTest.xml deleted file mode 100644 index 11df359..0000000 --- a/connector/target/surefire-reports/TEST-io.camunda.community.connector.script.WorkflowTest.xml +++ /dev/null @@ -1,155 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationGroovyTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationGroovyTest.txt deleted file mode 100644 index 91e993f..0000000 --- a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationGroovyTest.txt +++ /dev/null @@ -1,4 +0,0 @@ -------------------------------------------------------------------------------- -Test set: io.camunda.community.connector.script.EvaluationGroovyTest -------------------------------------------------------------------------------- -Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.051 s -- in io.camunda.community.connector.script.EvaluationGroovyTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest-output.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest-output.txt deleted file mode 100644 index 289f9b9..0000000 --- a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest-output.txt +++ /dev/null @@ -1,45 +0,0 @@ -[To redirect Truffle log output to a file use one of the following options: -* '--log.file=' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -[To redirect Truffle log output to a file use one of the following options: -* '--log.file=' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -[To redirect Truffle log output to a file use one of the following options: -* '--log.file=' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -[To redirect Truffle log output to a file use one of the following options: -* '--log.file=' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -[To redirect Truffle log output to a file use one of the following options: -* '--log.file=' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest.txt deleted file mode 100644 index 4477f88..0000000 --- a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationJavaScriptTest.txt +++ /dev/null @@ -1,4 +0,0 @@ -------------------------------------------------------------------------------- -Test set: io.camunda.community.connector.script.EvaluationJavaScriptTest -------------------------------------------------------------------------------- -Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.157 s -- in io.camunda.community.connector.script.EvaluationJavaScriptTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationKotlinTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationKotlinTest.txt deleted file mode 100644 index 47f04fd..0000000 --- a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationKotlinTest.txt +++ /dev/null @@ -1,4 +0,0 @@ -------------------------------------------------------------------------------- -Test set: io.camunda.community.connector.script.EvaluationKotlinTest -------------------------------------------------------------------------------- -Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.843 s -- in io.camunda.community.connector.script.EvaluationKotlinTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationMustacheTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationMustacheTest.txt deleted file mode 100644 index 210b38a..0000000 --- a/connector/target/surefire-reports/io.camunda.community.connector.script.EvaluationMustacheTest.txt +++ /dev/null @@ -1,4 +0,0 @@ -------------------------------------------------------------------------------- -Test set: io.camunda.community.connector.script.EvaluationMustacheTest -------------------------------------------------------------------------------- -Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.013 s -- in io.camunda.community.connector.script.EvaluationMustacheTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.LanguageProviderTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.LanguageProviderTest.txt deleted file mode 100644 index 2881103..0000000 --- a/connector/target/surefire-reports/io.camunda.community.connector.script.LanguageProviderTest.txt +++ /dev/null @@ -1,4 +0,0 @@ -------------------------------------------------------------------------------- -Test set: io.camunda.community.connector.script.LanguageProviderTest -------------------------------------------------------------------------------- -Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 s -- in io.camunda.community.connector.script.LanguageProviderTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest-output.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest-output.txt deleted file mode 100644 index ab8181c..0000000 --- a/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest-output.txt +++ /dev/null @@ -1,27 +0,0 @@ -[To redirect Truffle log output to a file use one of the following options: -* '--log.file=' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -[To redirect Truffle log output to a file use one of the following options: -* '--log.file=' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. -[To redirect Truffle log output to a file use one of the following options: -* '--log.file=' if the option is passed using a guest language launcher. -* '-Dpolyglot.log.file=' if the option is passed using the host Java launcher. -* Configure logging using the polyglot embedding API.] -[engine] WARNING: The polyglot context is using an implementation that does not support runtime compilation. -The guest application code will therefore be executed in interpreted mode only. -Execution only in interpreted mode will strongly impact the guest application performance. -For more information on using GraalVM see https://www.graalvm.org/java/quickstart/. -To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property. diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest.txt deleted file mode 100644 index e6b3470..0000000 --- a/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptEvaluatorTest.txt +++ /dev/null @@ -1,4 +0,0 @@ -------------------------------------------------------------------------------- -Test set: io.camunda.community.connector.script.ScriptEvaluatorTest -------------------------------------------------------------------------------- -Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.405 s -- in io.camunda.community.connector.script.ScriptEvaluatorTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptResourceProviderTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptResourceProviderTest.txt deleted file mode 100644 index 2f8375d..0000000 --- a/connector/target/surefire-reports/io.camunda.community.connector.script.ScriptResourceProviderTest.txt +++ /dev/null @@ -1,4 +0,0 @@ -------------------------------------------------------------------------------- -Test set: io.camunda.community.connector.script.ScriptResourceProviderTest -------------------------------------------------------------------------------- -Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.014 s -- in io.camunda.community.connector.script.ScriptResourceProviderTest diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest-output.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest-output.txt deleted file mode 100644 index 68e3265..0000000 --- a/connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest-output.txt +++ /dev/null @@ -1,70 +0,0 @@ -09:57:27.627 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [io.camunda.community.connector.script.WorkflowTest]: WorkflowTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration. -09:57:27.705 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration io.camunda.community.connector.script.ZeebeScriptWorkerApplication for test class io.camunda.community.connector.script.WorkflowTest - - . ____ _ __ _ _ - /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ -( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ - \\/ ___)| |_)| | | | | || (_| | ) ) ) ) - ' |____| .__|_| |_|_| |_\__, | / / / / - =========|_|==============|___/=/_/_/_/ - :: Spring Boot :: (v3.1.5) - -2023-10-27T09:57:28.166+02:00 INFO 13425 --- [ main] i.c.c.connector.script.WorkflowTest : Starting WorkflowTest using Java 21.0.1 with PID 13425 (started by jonathanlukas in /Users/jonathanlukas/git/camunda/zeebe-script-worker/connector) -2023-10-27T09:57:28.167+02:00 INFO 13425 --- [ main] i.c.c.connector.script.WorkflowTest : No active profile set, falling back to 1 default profile: "default" -2023-10-27T09:57:28.980+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.camunda.zeebe.spring.client.annotation.processor.AnnotationProcessorConfiguration' of type [io.camunda.zeebe.spring.client.annotation.processor.AnnotationProcessorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:28.982+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.camunda.connector.runtime.outbound.OutboundConnectorRuntimeConfiguration' of type [io.camunda.connector.runtime.outbound.OutboundConnectorRuntimeConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.002+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'zeebe.client-io.camunda.zeebe.spring.client.properties.ZeebeClientConfigurationProperties' of type [io.camunda.zeebe.spring.client.properties.ZeebeClientConfigurationProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.002+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.camunda.zeebe.spring.client.configuration.ZeebeClientAllAutoConfiguration' of type [io.camunda.zeebe.spring.client.configuration.ZeebeClientAllAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.004+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'zeebeClientExecutorService' of type [io.camunda.zeebe.spring.client.jobhandling.ZeebeClientExecutorService] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.007+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'commandExceptionHandlingStrategy' of type [io.camunda.zeebe.spring.client.jobhandling.DefaultCommandExceptionHandlingStrategy] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.008+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.camunda.zeebe.spring.client.CamundaAutoConfiguration' of type [io.camunda.zeebe.spring.client.CamundaAutoConfiguration$$SpringCGLIB$$0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.009+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.camunda.connector.runtime.OutboundConnectorsAutoConfiguration' of type [io.camunda.connector.runtime.OutboundConnectorsAutoConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.083+02:00 INFO 13425 --- [ main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper@4a14227a)), function-provider: io.camunda.connector.feel.FeelConnectorFunctionProvider@1b254f9b, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] -2023-10-27T09:57:29.212+02:00 INFO 13425 --- [ main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper@179683c3)), function-provider: io.camunda.connector.feel.FeelConnectorFunctionProvider@31b280af, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] -2023-10-27T09:57:29.225+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'objectMapper' of type [com.fasterxml.jackson.databind.json.JsonMapper] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.225+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'zeebeJsonMapper' of type [io.camunda.zeebe.client.impl.ZeebeObjectMapper] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.226+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'io.camunda.zeebe.spring.client.configuration.ZeebeActuatorConfiguration' of type [io.camunda.zeebe.spring.client.configuration.ZeebeActuatorConfiguration] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.252+02:00 INFO 13425 --- [ main] i.c.z.s.c.a.MicrometerMetricsRecorder : Enabling Micrometer based metrics for spring-zeebe (available via Actuator) -2023-10-27T09:57:29.252+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'micrometerMetricsRecorder' of type [io.camunda.zeebe.spring.client.actuator.MicrometerMetricsRecorder] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.254+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'jobWorkerManager' of type [io.camunda.zeebe.spring.client.jobhandling.JobWorkerManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.262+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'outboundConnectorFactory' of type [io.camunda.connector.runtime.core.outbound.DefaultOutboundConnectorFactory] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.264+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'defaultSecretProvider' of type [io.camunda.connector.runtime.env.SpringEnvironmentSecretProvider] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.265+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'springSecretProviderAggregator' of type [io.camunda.connector.runtime.core.secret.SecretProviderAggregator] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.268+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'outboundConnectorManager' of type [io.camunda.connector.runtime.outbound.lifecycle.OutboundConnectorManager] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.270+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'annotationProcessor' of type [io.camunda.connector.runtime.outbound.lifecycle.OutboundConnectorAnnotationProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.271+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'deploymentPostProcessor' of type [io.camunda.zeebe.spring.client.annotation.processor.ZeebeDeploymentAnnotationProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.273+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'propertyBasedZeebeWorkerValueCustomizer' of type [io.camunda.zeebe.spring.client.properties.PropertyBasedZeebeWorkerValueCustomizer] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.275+02:00 INFO 13425 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'zeebeWorkerPostProcessor' of type [io.camunda.zeebe.spring.client.annotation.processor.ZeebeWorkerAnnotationProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) -2023-10-27T09:57:29.562+02:00 WARN 13425 --- [ main] o.s.b.a.m.MustacheAutoConfiguration : Cannot find template location: classpath:/templates/ (please add some templates, check your Mustache configuration, or set spring.mustache.check-template-location=false) -2023-10-27T09:57:29.570+02:00 INFO 13425 --- [ main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper@54bd2345)), function-provider: io.camunda.connector.feel.FeelConnectorFunctionProvider@48b5669c, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] -2023-10-27T09:57:29.944+02:00 INFO 13425 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path '/actuator' -2023-10-27T09:57:29.990+02:00 INFO 13425 --- [ main] i.c.c.connector.script.WorkflowTest : Started WorkflowTest in 2.124 seconds (process running for 10.546) -2023-10-27T09:57:30.088+02:00 INFO 13425 --- [ main] i.c.z.s.test.ZeebeTestExecutionListener : Create Zeebe in-memory engine for test run on random port: 61300... -2023-10-27T09:57:30.449+02:00 INFO 13425 --- [ zb-actors-13] io.camunda.zeebe.logstreams : Recovered state of partition 1 from snapshot at position -1 -2023-10-27T09:57:30.484+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@4178b4ab)), function-provider: io.camunda.zeebe.feel.impl.FeelFunctionProvider@57546a8d, clock: io.camunda.zeebe.engine.processing.bpmn.clock.ZeebeFeelEngineClock@539d4074, configuration: {externalFunctionsEnabled: false}] -2023-10-27T09:57:30.533+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.dmn.DmnEngine : DMN-Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@778cb5cf)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, audit-loggers: List(), configuration: Configuration(false,false,false)] -2023-10-27T09:57:30.535+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.dmn.NoUnpackValueMapper@16da5391)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] -2023-10-27T09:57:30.564+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.dmn.DmnEngine : DMN-Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@168b4c40)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, audit-loggers: List(), configuration: Configuration(false,false,false)] -2023-10-27T09:57:30.564+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.dmn.NoUnpackValueMapper@60e7f530)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] -2023-10-27T09:57:30.588+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.dmn.DmnEngine : DMN-Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@49bef4c7)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, audit-loggers: List(), configuration: Configuration(false,false,false)] -2023-10-27T09:57:30.588+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.dmn.NoUnpackValueMapper@5e3df12)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] -2023-10-27T09:57:30.590+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@637795d3)), function-provider: io.camunda.zeebe.feel.impl.FeelFunctionProvider@6378eb65, clock: io.camunda.zeebe.engine.processing.bpmn.clock.ZeebeFeelEngineClock@413b9b8e, configuration: {externalFunctionsEnabled: false}] -2023-10-27T09:57:30.625+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@64000559)), function-provider: io.camunda.zeebe.feel.impl.FeelFunctionProvider@2ffc8a06, clock: io.camunda.zeebe.engine.processing.bpmn.clock.ZeebeFeelEngineClock@14bcc36f, configuration: {externalFunctionsEnabled: false}] -2023-10-27T09:57:30.626+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@1a53c292)), function-provider: io.camunda.zeebe.feel.impl.FeelFunctionProvider@7813a124, clock: io.camunda.zeebe.engine.processing.bpmn.clock.ZeebeFeelEngineClock@40c115eb, configuration: {externalFunctionsEnabled: false}] -2023-10-27T09:57:30.650+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.dmn.DmnEngine : DMN-Engine created. [value-mapper: CompositeValueMapper(List(io.camunda.zeebe.feel.impl.MessagePackValueMapper@58300ed0)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, audit-loggers: List(), configuration: Configuration(false,false,false)] -2023-10-27T09:57:30.650+02:00 INFO 13425 --- [ zb-actors-13] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.dmn.NoUnpackValueMapper@654a1fa7)), function-provider: org.camunda.feel.context.FunctionProvider$EmptyFunctionProvider$@75fd473a, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] -2023-10-27T09:57:30.700+02:00 INFO 13425 --- [ zb-actors-13] io.camunda.zeebe.processor : Processor starts replay of events. [snapshot-position: -1, replay-mode: PROCESSING] -2023-10-27T09:57:30.701+02:00 INFO 13425 --- [ zb-actors-13] io.camunda.zeebe.processor : Processor finished replay, with [lastProcessedPosition: -1, lastWrittenPosition: -1] -2023-10-27T09:57:30.703+02:00 INFO 13425 --- [ main] z.s.t.AbstractZeebeTestExecutionListener : Test engine setup. Now starting deployments and workers... -2023-10-27T09:57:30.769+02:00 INFO 13425 --- [ main] org.camunda.feel.FeelEngine : Engine created. [value-mapper: CompositeValueMapper(List(org.camunda.feel.impl.JavaValueMapper@69464a0f)), function-provider: io.camunda.connector.feel.FeelConnectorFunctionProvider@3f2f83d5, clock: SystemClock, configuration: {externalFunctionsEnabled: false}] -2023-10-27T09:57:30.782+02:00 INFO 13425 --- [ main] i.c.z.s.c.jobhandling.JobWorkerManager : . Starting Zeebe worker: ZeebeWorkerValue{type='io.camunda.community:script', name='connector-script', timeout=null, maxJobsActive=null, requestTimeout=null, pollInterval=null, autoComplete=true, fetchVariables=[], enabled=null, methodInfo=null} -2023-10-27T09:57:30.783+02:00 INFO 13425 --- [ main] i.c.z.s.c.jobhandling.JobWorkerManager : . Starting Zeebe worker: ZeebeWorkerValue{type='script', name='connector-script-legacy', timeout=null, maxJobsActive=null, requestTimeout=null, pollInterval=null, autoComplete=true, fetchVariables=[], enabled=null, methodInfo=null} -2023-10-27T09:57:30.784+02:00 INFO 13425 --- [ main] z.s.t.AbstractZeebeTestExecutionListener : ...deployments and workers started. -WARNING: A Java agent has been loaded dynamically (/Users/jonathanlukas/.m2/repository/net/bytebuddy/byte-buddy-agent/1.14.9/byte-buddy-agent-1.14.9.jar) -WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning -WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information -WARNING: Dynamic loading of agents will be disallowed by default in a future release -2023-10-27T09:57:32.039+02:00 INFO 13425 --- [pool-6-thread-1] i.c.c.r.c.outbound.ConnectorJobHandler : Received job 2251799813685273 -2023-10-27T09:57:32.129+02:00 INFO 13425 --- [ zb-actors-1] io.camunda.zeebe.logstreams : Close appender for log stream null -2023-10-27T09:57:32.129+02:00 INFO 13425 --- [ zb-actors-1] i.c.zeebe.logstreams.impl.log.Sequencer : Closing sequencer for writing -2023-10-27T09:57:32.130+02:00 INFO 13425 --- [ zb-actors-11] io.camunda.zeebe.logstreams : On closing logstream null close 2 readers diff --git a/connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest.txt b/connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest.txt deleted file mode 100644 index 55bad23..0000000 --- a/connector/target/surefire-reports/io.camunda.community.connector.script.WorkflowTest.txt +++ /dev/null @@ -1,4 +0,0 @@ -------------------------------------------------------------------------------- -Test set: io.camunda.community.connector.script.WorkflowTest -------------------------------------------------------------------------------- -Tests run: 3, Failures: 0, Errors: 0, Skipped: 2, Time elapsed: 4.699 s -- in io.camunda.community.connector.script.WorkflowTest diff --git a/connector/target/test-classes/application.yaml b/connector/target/test-classes/application.yaml deleted file mode 100644 index d28a711..0000000 --- a/connector/target/test-classes/application.yaml +++ /dev/null @@ -1,7 +0,0 @@ -camunda.operate.enabled: false -camunda: - connector: - webhook: - enabled: false - polling: - enabled: false \ No newline at end of file diff --git a/connector/target/test-classes/test-script.js b/connector/target/test-classes/test-script.js deleted file mode 100644 index b321213..0000000 --- a/connector/target/test-classes/test-script.js +++ /dev/null @@ -1 +0,0 @@ -a + b; \ No newline at end of file From 342e6c536068ffc1d1e5f8a3a04990ad93b4e326 Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Fri, 27 Oct 2023 11:32:33 +0200 Subject: [PATCH 06/13] Delete runtime/target directory --- runtime/target/maven-archiver/pom.properties | 3 --- .../compile/default-compile/createdFiles.lst | 1 - .../compile/default-compile/inputFiles.lst | 1 - ...connector-runtime-1.2.1-SNAPSHOT.jar.original | Bin 3258 -> 0 bytes runtime/target/spotless-index | 3 --- 5 files changed, 8 deletions(-) delete mode 100644 runtime/target/maven-archiver/pom.properties delete mode 100644 runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst delete mode 100644 runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst delete mode 100644 runtime/target/script-connector-runtime-1.2.1-SNAPSHOT.jar.original delete mode 100644 runtime/target/spotless-index diff --git a/runtime/target/maven-archiver/pom.properties b/runtime/target/maven-archiver/pom.properties deleted file mode 100644 index d96cf1f..0000000 --- a/runtime/target/maven-archiver/pom.properties +++ /dev/null @@ -1,3 +0,0 @@ -artifactId=script-connector-runtime -groupId=io.camunda.connectors.community -version=1.2.1-SNAPSHOT diff --git a/runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst deleted file mode 100644 index 7f0f934..0000000 --- a/runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst +++ /dev/null @@ -1 +0,0 @@ -io/camunda/community/connector/script/App.class diff --git a/runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst deleted file mode 100644 index 4677ffd..0000000 --- a/runtime/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ /dev/null @@ -1 +0,0 @@ -/Users/jonathanlukas/git/camunda/zeebe-script-worker/runtime/src/main/java/io/camunda/community/connector/script/App.java diff --git a/runtime/target/script-connector-runtime-1.2.1-SNAPSHOT.jar.original b/runtime/target/script-connector-runtime-1.2.1-SNAPSHOT.jar.original deleted file mode 100644 index 68f794f7fd238dfb632f452e225b5aaec29044ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3258 zcmWIWW@h1HVBlb2F!7HLXFvj+K(?=Ih@-BjpPPOFP?-o&83$O|L-qdqi-FR{j0_Aw zQG_yIM?X(D*WeI6U$@@AgIvu90xs{H{%^1sSXp)2ckh;_wGuCFXXHjog?D-`tiN9+ zeA_vn`ST3(-n3m09~~9F>m=;$G1*xrly9rM@~P=9ZuS!w>RDyv?htmK_e49GZIj!T zXNp&Pnp<>w7n@$}WqWHMy+}Pjut`ehtlX+jNp^e77fjVsh5h+@DfeY(pY&YuMdHQ_ z3#;DEM+I;GUwP|eboeB$QoX3sJzwm1%r)=32l5nlzcT|pm6;FrHFgEu5CzGJxutn2 ziFg!>qAEcWg!DKW?KZ{;Xx{mqVKx4@_C36LNQ!u_|}; z=hi>w`y>zZUOTz0V9U2pSF7eK9bL<^STOH#-+?o`g3Pkrm)VrBx)y#d_SBsy{pp4$ zWJN_!O*Zv;9<}YK%5KTbz?I8p*5B&TseLiqe{=2$n~B%s_r^pN`=!1PiF?W0b+oif z??UtqW8Dq&Ctl3IZFT*f^9oUk^lbrGy)3!j>)rS~f2Cl>tiRiN8W)8fc`f6=&3FH! zJw>X`a=D(|OT2IIa@xPp!9L+Y`a+KfPinJmu2#A7w%+a8Xt(Z|$MR^^&ZO1XZZEp* zQhsUwvm+Ld3?{$T@^m2^^v2iD=MXU!7Y(Dzg{)TUKG4%+Xnkv&PC)wKrePI8zrh$NyuSm%z$3!dlHY?w;!Wy8OA7@VU!1rZu1D9KG~R)?<(C z(Z2>q6ZTxPoN|A+)slZbn|armu4-j`8sy(6?q>e=y3N#CX^XN#^fH!BJ*1VHTo|dS zc2_ukZ{l;cp2_7(#T+-zoVYb{s`$%y&viDvoa5Ad$m^Elmzc7y zW(hdF<#9>+26^sWxeV_-_0H#)Up%?*dP8-e;`Z|WhqaD;S@6P^euZ1246 zxj2febGG;FHMc#I)q)#3>r-_08MT&tPP^tcE3(FL!B5sVj=O`jgjn7zSmoWbic4*6 z?tx8{x7S_lW8~Adtf?=lDJrnB>uDC)bnxPV^KMcbw$Hm4mRRPxUoU&f-0A{j<$$a$ z$~)Z64{8g!onYO0ZPO9PhAg&9y|kz2q=mMp+AE)%=iR({@7sgrx>9X**LwxHjZGYO z{B~Sg&xlCkpc*>=SZ`Y-Fli?PaTt}8ctKHqL26M+W@@qRDMP*n1s;csb9Xy5SvSwt z%UUF^AnMB=71Y(aefr6_&!4*n?ooPC)5g{0s%sF)l)CYfhoO2g_x4MSo0?}x&%O9} z#kVtm7w&uJ88lI|!rUVNd+MEUnYL%x1H2iTM3}MHsh|c21PCy^bp)~Cl@LT5qBKWu zfI#&zENN6n)`rv^!Dlh3wubZFugbjnY9dHK@sP%v_^B2%ecr?P=61X*ks%C^{ zbzoVJrkQZt0=MCy)&;`w64DLF)7Ajlib$X6tqqvHOB!zhZAD5fh&V??7<$_S5`hrI zvDI=2!}qh099}rR1g-OsEyq^=AS_?RPF>3prBQ%4E3iUmVBiHpQ=k{~fxQ(51^_Av BOF;kt diff --git a/runtime/target/spotless-index b/runtime/target/spotless-index deleted file mode 100644 index 8d36f60..0000000 --- a/runtime/target/spotless-index +++ /dev/null @@ -1,3 +0,0 @@ -sxcJ+sQ94Ntqsx4ZtGuNZjNjACy3xzdHs8+A+vidvg4= -pom.xml 2023-10-27T07:57:09.617921783Z -src/main/java/io/camunda/community/connector/script/App.java 2023-10-27T07:52:53.355613122Z From c0cc8e557e6d62b902837c988227368aa76546ed Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Fri, 27 Oct 2023 11:32:47 +0200 Subject: [PATCH 07/13] Delete connector/dependency-reduced-pom.xml --- connector/dependency-reduced-pom.xml | 186 --------------------------- 1 file changed, 186 deletions(-) delete mode 100644 connector/dependency-reduced-pom.xml diff --git a/connector/dependency-reduced-pom.xml b/connector/dependency-reduced-pom.xml deleted file mode 100644 index 814b036..0000000 --- a/connector/dependency-reduced-pom.xml +++ /dev/null @@ -1,186 +0,0 @@ - - - - script-connector-parent - io.camunda.connectors.community - 1.2.1-SNAPSHOT - - 4.0.0 - script-connector - Script Connector - - - - maven-shade-plugin - - - package - - shade - - - - - true - - - - - - - - - - io.camunda.connector - connector-core - 8.3.0 - provided - - - com.fasterxml.jackson.core - jackson-databind - 2.15.3 - provided - - - org.springframework.boot - spring-boot-starter-test - 3.1.5 - test - - - spring-boot-starter - org.springframework.boot - - - spring-boot-test - org.springframework.boot - - - spring-boot-test-autoconfigure - org.springframework.boot - - - json-path - com.jayway.jsonpath - - - jakarta.xml.bind-api - jakarta.xml.bind - - - json-smart - net.minidev - - - hamcrest - org.hamcrest - - - mockito-core - org.mockito - - - mockito-junit-jupiter - org.mockito - - - jsonassert - org.skyscreamer - - - spring-core - org.springframework - - - spring-test - org.springframework - - - xmlunit-core - org.xmlunit - - - - - org.junit.jupiter - junit-jupiter - 5.9.3 - test - - - junit-jupiter-api - org.junit.jupiter - - - junit-jupiter-params - org.junit.jupiter - - - junit-jupiter-engine - org.junit.jupiter - - - - - org.assertj - assertj-core - 3.24.2 - test - - - byte-buddy - net.bytebuddy - - - - - io.camunda.spring - spring-boot-starter-camunda-test - 8.3.0 - test - - - spring-boot-starter-camunda-test-common - io.camunda.spring - - - zeebe-process-test-extension - io.camunda - - - - - io.camunda.connector - spring-boot-starter-camunda-connectors - 8.3.0 - test - - - connector-runtime-spring - io.camunda.connector - - - connector-validation - io.camunda.connector - - - spring-boot-starter-camunda - io.camunda.spring - - - camunda-operate-client-java - io.camunda - - - spring-boot-starter-web - org.springframework.boot - - - spring-boot-starter-actuator - org.springframework.boot - - - - - From 9a279a0aedeadef1236b9bea3a328ab7e6a94169 Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Mon, 30 Oct 2023 21:03:59 +0100 Subject: [PATCH 08/13] make use of element template generation --- .../element-templates/script-connector.json | 163 ++++++++++++++++++ connector/pom.xml | 24 ++- .../connector/script/LanguageProvider.java | 2 +- .../connector/script/ScriptConnector.java | 46 +++-- .../script/ScriptConnectorInput.java | 51 +++++- .../connector/script/WorkflowTest.java | 23 +++ pom.xml | 11 +- 7 files changed, 291 insertions(+), 29 deletions(-) create mode 100644 connector/element-templates/script-connector.json diff --git a/connector/element-templates/script-connector.json b/connector/element-templates/script-connector.json new file mode 100644 index 0000000..9942b42 --- /dev/null +++ b/connector/element-templates/script-connector.json @@ -0,0 +1,163 @@ +{ + "$schema" : "https://unpkg.com/@camunda/zeebe-element-templates-json-schema/resources/schema.json", + "name" : "Script Connector", + "id" : "io.camunda.community:script-connector", + "description" : "A connector to execute a script", + "version" : 1, + "category" : { + "id" : "connectors", + "name" : "Connectors" + }, + "appliesTo" : [ "bpmn:Task" ], + "elementType" : { + "value" : "bpmn:ServiceTask" + }, + "groups" : [ { + "id" : "default", + "label" : "Properties" + }, { + "id" : "output", + "label" : "Output mapping" + }, { + "id" : "error", + "label" : "Error handling" + }, { + "id" : "retries", + "label" : "Retries" + } ], + "properties" : [ { + "value" : "io.camunda.community:script-connector", + "binding" : { + "type" : "zeebe:taskDefinition:type" + }, + "type" : "Hidden" + }, { + "id" : "script.type", + "label" : "Type", + "group" : "default", + "binding" : { + "name" : "script.type", + "type" : "zeebe:input" + }, + "type" : "Dropdown", + "choices" : [ { + "name" : "Embedded", + "value" : "embedded" + }, { + "name" : "Resource", + "value" : "resource" + } ] + }, { + "id" : "script.embedded", + "label" : "Script", + "description" : "The script to be executed", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "feel" : "optional", + "group" : "default", + "binding" : { + "name" : "script.embedded", + "type" : "zeebe:input" + }, + "condition" : { + "property" : "script.type", + "equals" : "embedded" + }, + "type" : "String" + }, { + "id" : "script.language", + "label" : "Script Language", + "description" : "The language the script uses", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "feel" : "optional", + "group" : "default", + "binding" : { + "name" : "script.language", + "type" : "zeebe:input" + }, + "condition" : { + "property" : "script.type", + "equals" : "embedded" + }, + "type" : "String" + }, { + "id" : "script.resource", + "label" : "Script resource", + "description" : "The resource that should be executed", + "optional" : false, + "constraints" : { + "notEmpty" : true + }, + "feel" : "optional", + "group" : "default", + "binding" : { + "name" : "script.resource", + "type" : "zeebe:input" + }, + "condition" : { + "property" : "script.type", + "equals" : "resource" + }, + "type" : "String" + }, { + "id" : "context", + "label" : "Script context", + "description" : "The context that is available to the script", + "optional" : false, + "feel" : "required", + "group" : "default", + "binding" : { + "name" : "context", + "type" : "zeebe:input" + }, + "type" : "String" + }, { + "id" : "resultVariable", + "label" : "Result variable", + "description" : "Name of variable to store the response in", + "group" : "output", + "binding" : { + "key" : "resultVariable", + "type" : "zeebe:taskHeader" + }, + "type" : "String" + }, { + "id" : "resultExpression", + "label" : "Result expression", + "description" : "Expression to map the response into process variables", + "feel" : "required", + "group" : "output", + "binding" : { + "key" : "resultExpression", + "type" : "zeebe:taskHeader" + }, + "type" : "Text" + }, { + "id" : "errorExpression", + "label" : "Error expression", + "description" : "Expression to handle errors. Details in the documentation.", + "feel" : "required", + "group" : "error", + "binding" : { + "key" : "errorExpression", + "type" : "zeebe:taskHeader" + }, + "type" : "Text" + }, { + "id" : "retryBackoff", + "label" : "Retry backoff", + "description" : "ISO-8601 duration to wait between retries", + "value" : "PT0S", + "group" : "retries", + "binding" : { + "key" : "retryBackoff", + "type" : "zeebe:taskHeader" + }, + "type" : "Hidden" + } ] +} \ No newline at end of file diff --git a/connector/pom.xml b/connector/pom.xml index d60ffca..4591fe6 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -18,13 +18,18 @@ connector-core provided + + io.camunda.connector + element-template-generator + true + com.fasterxml.jackson.core jackson-databind provided - + com.samskivert jmustache @@ -96,6 +101,23 @@ + + io.camunda.connector + element-template-generator-maven-plugin + + + io.camunda.community.connector.script.ScriptConnector + + + + + verify + + generate-templates + + + + diff --git a/connector/src/main/java/io/camunda/community/connector/script/LanguageProvider.java b/connector/src/main/java/io/camunda/community/connector/script/LanguageProvider.java index ae80a83..ff1a4d6 100644 --- a/connector/src/main/java/io/camunda/community/connector/script/LanguageProvider.java +++ b/connector/src/main/java/io/camunda/community/connector/script/LanguageProvider.java @@ -23,7 +23,7 @@ public String getLanguageForScriptResource(String scriptResource) { if (language == null) { throw new IllegalStateException( String.format( - "Could not determine script language from file suffix '%s'", fileExtension)); + "Could not determine scriptType language from file suffix '%s'", fileExtension)); } return language; } diff --git a/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java index 8a376e5..cfdd05f 100644 --- a/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java +++ b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java @@ -1,19 +1,26 @@ package io.camunda.community.connector.script; +import io.camunda.community.connector.script.ScriptConnectorInput.Type; +import io.camunda.community.connector.script.ScriptConnectorInput.Type.Embedded; +import io.camunda.community.connector.script.ScriptConnectorInput.Type.Resource; import io.camunda.connector.api.annotation.OutboundConnector; import io.camunda.connector.api.outbound.OutboundConnectorContext; import io.camunda.connector.api.outbound.OutboundConnectorFunction; +import io.camunda.connector.generator.annotation.ElementTemplate; import java.util.Map; @OutboundConnector( - type = "io.camunda.community:script-connector", + type = ScriptConnector.SCRIPT_CONNECTOR_TYPE, name = "script-connector", - inputVariables = {}) + inputVariables = {"script", "context"}) +@ElementTemplate( + id = ScriptConnector.SCRIPT_CONNECTOR_TYPE, + name = "Script Connector", + version = 1, + inputDataClass = ScriptConnectorInput.class, + description = "A connector to execute a script") public class ScriptConnector implements OutboundConnectorFunction { - static final String PARAM_LANGUAGE = "language"; - static final String PARAM_SCRIPT = "script"; - static final String PARAM_SCRIPT_RESOURCE = "scriptResource"; - static final String PARAM_CONTEXT = "context"; + public static final String SCRIPT_CONNECTOR_TYPE = "io.camunda.community:script-connector"; private final ScriptEvaluator scriptEvaluator = new ScriptEvaluator(); private final ScriptResourceProvider scriptResourceProvider = new ScriptResourceProvider(); @@ -29,13 +36,14 @@ public Object execute(OutboundConnectorContext outboundConnectorContext) throws } private String extractLanguage(ScriptConnectorInput scriptConnectorInput) { - if (scriptConnectorInput.language() != null) { - return scriptConnectorInput.language(); + Type script = scriptConnectorInput.script(); + if (script instanceof Embedded e) { + return e.language(); + } else if (script instanceof Resource r) { + return languageProvider.getLanguageForScriptResource(r.resource()); + } else { + throw new IllegalStateException("No script or resource has been provided"); } - if (scriptConnectorInput.scriptResource() != null) { - return languageProvider.getLanguageForScriptResource(scriptConnectorInput.scriptResource()); - } - throw new IllegalStateException(String.format("No '%s' has been provided", PARAM_LANGUAGE)); } private Object generateResponse(String resultVariable, Object evaluationResult) { @@ -46,13 +54,13 @@ private Object generateResponse(String resultVariable, Object evaluationResult) } private String extractScript(ScriptConnectorInput scriptConnectorInput) { - if (scriptConnectorInput.script() != null) { - return scriptConnectorInput.script(); - } - if (scriptConnectorInput.scriptResource() != null) { - return scriptResourceProvider.provideScript(scriptConnectorInput.scriptResource()); + Type script = scriptConnectorInput.script(); + if (script instanceof Embedded e) { + return e.embedded(); + } else if (script instanceof Resource r) { + return scriptResourceProvider.provideScript(r.resource()); + } else { + throw new IllegalStateException("No script or resource has been provided"); } - throw new IllegalStateException( - String.format("No '%s' or '%s' has been provided", PARAM_SCRIPT, PARAM_SCRIPT_RESOURCE)); } } diff --git a/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java index 7923047..a78a73d 100644 --- a/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java +++ b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java @@ -1,12 +1,49 @@ package io.camunda.community.connector.script; -import static io.camunda.community.connector.script.ScriptConnector.*; - -import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeInfo.Id; +import io.camunda.community.connector.script.ScriptConnectorInput.Type.Embedded; +import io.camunda.community.connector.script.ScriptConnectorInput.Type.Resource; +import io.camunda.connector.generator.annotation.TemplateProperty; +import io.camunda.connector.generator.dsl.Property.FeelMode; +import jakarta.validation.Valid; +import jakarta.validation.constraints.NotNull; import java.util.Map; +@JsonIgnoreProperties(ignoreUnknown = true) public record ScriptConnectorInput( - @JsonProperty(PARAM_LANGUAGE) String language, - @JsonProperty(PARAM_SCRIPT) String script, - @JsonProperty(PARAM_SCRIPT_RESOURCE) String scriptResource, - @JsonProperty(PARAM_CONTEXT) Map context) {} + @TemplateProperty(label = "Script description", description = "How the script is implemented") + @NotNull + @Valid + Type script, + @TemplateProperty( + label = "Script context", + feel = FeelMode.required, + description = "The context that is available to the script") + Map context) { + + @JsonTypeInfo(use = Id.NAME, property = "type") + @JsonSubTypes({ + @JsonSubTypes.Type(value = Embedded.class, name = "embedded"), + @JsonSubTypes.Type(value = Resource.class, name = "resource") + }) + sealed interface Type { + record Embedded( + @TemplateProperty(label = "Script", description = "The script to be executed") @NotNull + String embedded, + @TemplateProperty(label = "Script Language", description = "The language the script uses") + @NotNull + String language) + implements Type {} + + record Resource( + @TemplateProperty( + label = "Script resource", + description = "The resource that should be executed") + @NotNull + String resource) + implements Type {} + } +} diff --git a/connector/src/test/java/io/camunda/community/connector/script/WorkflowTest.java b/connector/src/test/java/io/camunda/community/connector/script/WorkflowTest.java index c5b491c..7562a86 100644 --- a/connector/src/test/java/io/camunda/community/connector/script/WorkflowTest.java +++ b/connector/src/test/java/io/camunda/community/connector/script/WorkflowTest.java @@ -1,5 +1,6 @@ package io.camunda.community.connector.script; +import static io.camunda.community.connector.script.ScriptConnector.*; import static org.assertj.core.api.Assertions.assertThat; import io.camunda.zeebe.client.ZeebeClient; @@ -41,6 +42,28 @@ public void shouldReturnResult() { assertThat(workflowInstanceResult.getVariablesAsMap()).containsEntry("result", 3); } + @Test + void shouldReturnResultConnector() { + BpmnModelInstance modelInstance = + Bpmn.createExecutableProcess("process") + .startEvent() + .scriptTask( + "task", + t -> + t.zeebeJobType(SCRIPT_CONNECTOR_TYPE) + .zeebeInput("={a:a,b:a}", "context") + .zeebeInput("a+b", "script.embedded") + .zeebeInput("embedded", "script.type") + .zeebeInput("javascript", "script.language") + .zeebeTaskHeader("resultVariable", "result")) + .endEvent() + .done(); + final var workflowInstanceResult = + deployAndCreateInstance(modelInstance, Collections.singletonMap("a", 3)); + + assertThat(workflowInstanceResult.getVariablesAsMap()).containsEntry("result", 6); + } + @Test @Disabled public void shouldGetCurrentJob() { diff --git a/pom.xml b/pom.xml index 2bd29cc..4dea843 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,6 @@ - io.camunda zeebe-bom @@ -86,6 +85,11 @@ connector-core ${version.camunda-connectors} + + io.camunda.connector + element-template-generator + ${version.camunda-connectors} + io.camunda.spring spring-boot-starter-camunda-test @@ -127,6 +131,11 @@ + + io.camunda.connector + element-template-generator-maven-plugin + ${version.camunda-connectors} + org.sonatype.plugins nexus-staging-maven-plugin From ae07f5db8aade8ef136eecd762105d15dd3e8885 Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Tue, 31 Oct 2023 08:13:34 +0100 Subject: [PATCH 09/13] do not generate templates in build pipeline --- connector/pom.xml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/connector/pom.xml b/connector/pom.xml index 4591fe6..1212d86 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -84,7 +84,6 @@ org.apache.maven.plugins maven-shade-plugin - ${project.build.finalName}-with-script-engines true true ${project.build.directory}/dependency-reduced-pom.xml @@ -109,14 +108,6 @@ io.camunda.community.connector.script.ScriptConnector - - - verify - - generate-templates - - - From 5bda8fcb1296ee47ffb29a7ed29873cc93458dc5 Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Tue, 31 Oct 2023 08:16:24 +0100 Subject: [PATCH 10/13] changed asset name --- .github/workflows/deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2fe8b27..ea27500 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -56,7 +56,7 @@ jobs: with: upload_url: ${{ github.event.release.upload_url }} asset_path: ${{ steps.release.outputs.artifacts_archive_path }} - asset_name: camunda-7-to-8-migration.zip + asset_name: script-connector.zip asset_content_type: application/zip - name: Publish Unit Test Results id: publish From a9648c1857e47f4227a44991f06324444a19afaf Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Tue, 31 Oct 2023 08:20:32 +0100 Subject: [PATCH 11/13] removed duplicate version --- pom.xml | 4 ++-- runtime/pom.xml | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 4dea843..4307e51 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ ${java.version} ${java.version} - 3.1.5 + 3.1.5 8.3.0 8.3.0 8.3.0 @@ -76,7 +76,7 @@ org.springframework.boot spring-boot-dependencies - ${version.spring.boot} + ${version.spring-boot} pom import diff --git a/runtime/pom.xml b/runtime/pom.xml index f59cf74..da435a3 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -27,7 +27,6 @@ org.springframework.boot spring-boot-maven-plugin - ${version.spring.boot} From d1fccc39db4393762102e0839c2bf34942bff78c Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Tue, 31 Oct 2023 10:38:55 +0100 Subject: [PATCH 12/13] changes --- README.md | 79 +++++++++++-------- .../element-templates/script-connector.json | 4 +- connector/pom.xml | 5 +- .../connector/script/LanguageProvider.java | 2 +- .../script/ScriptConnectorInput.java | 8 +- .../services/javax.script.ScriptEngineFactory | 3 - docker/docker-compose.yml | 27 +++++-- runtime/pom.xml | 46 +++++++++++ runtime/src/main/resources/application.yaml | 7 ++ .../community/connector/script/AppTest.java | 63 +++++++++++++++ 10 files changed, 190 insertions(+), 54 deletions(-) delete mode 100644 connector/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory create mode 100644 runtime/src/main/resources/application.yaml create mode 100644 runtime/src/test/java/io/camunda/community/connector/script/AppTest.java diff --git a/README.md b/README.md index 299c526..c51e9b0 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,17 @@ [![Compatible with: Camunda Platform 8](https://img.shields.io/badge/Compatible%20with-Camunda%20Platform%208-0072Ce)](https://github.com/camunda-community-hub/community/blob/main/extension-lifecycle.md#compatiblilty) - -_This is a community project meant for playing around with Zeebe. It is not officially supported by the Zeebe Team (i.e. no gurantees). Everybody is invited to contribute!_ -A Zeebe worker to evaluate scripts (i.e. script tasks). Scripts are useful for prototyping, to do (simple) calculations, or creating/modifying variables. +_This is a community project that provides a connector. It is not officially supported by Camunda. Everybody is invited to contribute!_ +A connector to evaluate scripts (i.e. script tasks) that are not written in FEEL. Scripts are useful for prototyping, to do (simple) calculations, or creating/modifying variables. ## Usage +### Legacy + +The legacy connector provides compatibility with the previous implementation `zeebe-script-worker`. + +>The context does not offer access to `job` or `zeebeClient` anymore. + Example BPMN with service task: ```xml @@ -21,6 +26,7 @@ Example BPMN with service task: + @@ -30,64 +36,67 @@ Example BPMN with service task: * required custom headers: * `language` - the name of the script language * `script` - the script to evaluate -* the result of the evaluation is passed as `result` variable + * `resultVariable` - the result of the evaluation is passed to this variable + +### Connector -Available script languages: +The connector provides an [element template](./connector/element-templates/script-connector.json) that can be used to configure it. + +### Script languages + +Available script languages are by default: * [javascript](https://www.graalvm.org/) (GraalVM JS) * [groovy](http://groovy-lang.org/) * [mustache](http://mustache.github.io/mustache.5.html) * [kotlin](https://kotlinlang.org/) +To register new script languages, you can use the `ScriptEngineFactory` to register any JSR-223 compliant script engine. + +If you want to provide a non-compliant implementation, you can use the [`ScriptEvaluatorExtension`](./connector/src/main/java/io/camunda/community/connector/script/spi/ScriptEvaluatorExtension.java) SPI. + +To register custom file extensions, you can use the [`LanguageProviderExtension`](./connector/src/main/java/io/camunda/community/connector/script/spi/LanguageProviderExtension.java) SPI. + ## Install ### Docker -The docker image for the worker is published on [GitHub Packages](https://github.com/orgs/camunda-community-hub/packages/container/package/zeebe-script-worker). +For a local setup, the repository contains a [docker-compose file](docker/docker-compose.yml). It starts a Zeebe broker and both (standalone and bundled) containers. ``` -docker pull ghcr.io/camunda-community-hub/zeebe-script-worker:1.2.0 +mvn clean package +cd docker +docker-compose up ``` -* configure the connection to the Zeebe broker by setting `zeebe.client.broker.contactPoint` (default: `localhost:26500`) -For a local setup, the repository contains a [docker-compose file](docker/docker-compose.yml). It starts a Zeebe broker and the worker. +#### Standalone Runtime + +The docker image for the connector runtime is published as GitHub package. ``` -cd docker -docker-compose up +docker pull ghcr.io/camunda-community-hub/script-connector/runtime:latest ``` -### Manual +Configure the connection to the Zeebe broker by setting the environment property `ZEEBE_CLIENT_BROKER_GATEWAY-ADDRESS` (default: `localhost:26500`) -1. Download the latest [worker JAR](https://github.com/zeebe-io/zeebe-script-worker/releases) _(zeebe-script-worker-%{VERSION}.jar -)_ +The docker-compose file shows an example how this works. -1. Start the worker - `java -jar zeebe-script-worker-{VERSION}.jar` +#### Bundled Runtime -### Configuration +To run the connector inside the bundle, you can use the shaded jar. -The worker is a Spring Boot application that uses the [Spring Zeebe Starter](https://github.com/zeebe-io/spring-zeebe). The configuration can be changed via environment variables or an `application.yaml` file. See also the following resources: -* [Spring Zeebe Configuration](https://github.com/zeebe-io/spring-zeebe#configuring-zeebe-connection) -* [Spring Boot Configuration](https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-external-config) +The docker-compose file shows an example how this works. -``` -zeebe: - client: - worker: - defaultName: script-worker - defaultType: script - threads: 3 - - job.timeout: 10000 - broker.contactPoint: 127.0.0.1:26500 - security.plaintext: true -``` +### Manual + +#### Standalone Runtime -## Build from Source +1. Download the runtime jar `script-connector-runtime-{VERSION}.jar` +2. Start the connector runtime `java -jar script-connector-runtime-{VERSION}.jar` -Build with Maven +#### Bundled Runtime -`mvn clean install` +1. Download the shaded connector jar `script-connector-{VERSION}-shaded.jar` +2. Copy it to your connector runtime. ## Code of Conduct diff --git a/connector/element-templates/script-connector.json b/connector/element-templates/script-connector.json index 9942b42..099623b 100644 --- a/connector/element-templates/script-connector.json +++ b/connector/element-templates/script-connector.json @@ -69,7 +69,7 @@ }, { "id" : "script.language", "label" : "Script Language", - "description" : "The language the script uses", + "description" : "The language the script uses. By default, the ones available are: javascript, groovy, kotlin, mustache", "optional" : false, "constraints" : { "notEmpty" : true @@ -88,7 +88,7 @@ }, { "id" : "script.resource", "label" : "Script resource", - "description" : "The resource that should be executed", + "description" : "The resource that should be executed. Should be prefixed with 'classpath:' for a classpath resource, 'file:' for a file system resource. If none of these prefixes matches, it will attempt to load the provided resource as URL.", "optional" : false, "constraints" : { "notEmpty" : true diff --git a/connector/pom.xml b/connector/pom.xml index 1212d86..0b6c1cc 100644 --- a/connector/pom.xml +++ b/connector/pom.xml @@ -29,7 +29,7 @@ provided - + com.samskivert jmustache @@ -85,8 +85,7 @@ maven-shade-plugin true - true - ${project.build.directory}/dependency-reduced-pom.xml + false diff --git a/connector/src/main/java/io/camunda/community/connector/script/LanguageProvider.java b/connector/src/main/java/io/camunda/community/connector/script/LanguageProvider.java index ff1a4d6..ae80a83 100644 --- a/connector/src/main/java/io/camunda/community/connector/script/LanguageProvider.java +++ b/connector/src/main/java/io/camunda/community/connector/script/LanguageProvider.java @@ -23,7 +23,7 @@ public String getLanguageForScriptResource(String scriptResource) { if (language == null) { throw new IllegalStateException( String.format( - "Could not determine scriptType language from file suffix '%s'", fileExtension)); + "Could not determine script language from file suffix '%s'", fileExtension)); } return language; } diff --git a/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java index a78a73d..9b6dffd 100644 --- a/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java +++ b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnectorInput.java @@ -33,7 +33,10 @@ sealed interface Type { record Embedded( @TemplateProperty(label = "Script", description = "The script to be executed") @NotNull String embedded, - @TemplateProperty(label = "Script Language", description = "The language the script uses") + @TemplateProperty( + label = "Script Language", + description = + "The language the script uses. By default, the ones available are: javascript, groovy, kotlin, mustache") @NotNull String language) implements Type {} @@ -41,7 +44,8 @@ record Embedded( record Resource( @TemplateProperty( label = "Script resource", - description = "The resource that should be executed") + description = + "The resource that should be executed. Should be prefixed with 'classpath:' for a classpath resource, 'file:' for a file system resource. If none of these prefixes matches, it will attempt to load the provided resource as URL.") @NotNull String resource) implements Type {} diff --git a/connector/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory b/connector/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory deleted file mode 100644 index d8da373..0000000 --- a/connector/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory +++ /dev/null @@ -1,3 +0,0 @@ -com.oracle.truffle.js.scriptengine.GraalJSEngineFactory -kotlin.script.experimental.jsr223.KotlinJsr223DefaultScriptEngineFactory -org.codehaus.groovy.jsr223.GroovyScriptEngineFactory \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 648d0fb..e9a1d21 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -15,19 +15,30 @@ services: - "9600:9600" networks: - zeebe_network - zeebe-script-worker: - container_name: connector-runtime - image: camunda/connectors:8.3.0 + script-connector-runtime: + container_name: script-connector-runtime + image: ghcr.io/camunda-community-hub/script-connector/runtime:latest environment: - ZEEBE_CLIENT_BROKER_GATEWAY-ADDRESS=zeebe:26500 - ZEEBE_CLIENT_SECURITY_PLAINTEXT=true - - CAMUNDA_CONNECTOR_POLLING_ENABLED=false - - CAMUNDA_CONNECTOR_WEBHOOK_ENABLED=false - - SPRING_MAIN_WEB-APPLICATION-TYPE=none - - OPERATE_CLIENT_ENABLED=false depends_on: - zeebe networks: - zeebe_network + script-connector-bundled: + container_name: script-connector-bundled + image: camunda/connectors-bundle:8.3.0 + environment: + - ZEEBE_CLIENT_BROKER_GATEWAY-ADDRESS=zeebe:26500 + - ZEEBE_CLIENT_SECURITY_PLAINTEXT=true + - CAMUNDA_CONNECTOR_POLLING_ENABLED=false + - CAMUNDA_CONNECTOR_WEBHOOK_ENABLED=false + - SPRING_MAIN_WEB-APPLICATION-TYPE=none + - OPERATE_CLIENT_ENABLED=false + depends_on: + - zeebe + networks: + - zeebe_network volumes: - - ./../connector/target/script-connector-1.2.1-SNAPSHOT-with-script-engines.jar:/opt/app/script-connector.jar + - ./../connector/target/script-connector-1.2.1-SNAPSHOT-shaded.jar:/opt/custom/script-connector.jar + diff --git a/runtime/pom.xml b/runtime/pom.xml index da435a3..67604c3 100644 --- a/runtime/pom.xml +++ b/runtime/pom.xml @@ -21,6 +21,11 @@ io.camunda.connector spring-boot-starter-camunda-connectors + + io.camunda.spring + spring-boot-starter-camunda-test + test + @@ -49,4 +54,45 @@ + + + build-image + + + + org.springframework.boot + spring-boot-maven-plugin + + + build-version + + build-image + + package + + + ghcr.io/camunda-community-hub/script-connector/runtime:${project.version} + + + + + + build-latest + + build-image + + package + + + ghcr.io/camunda-community-hub/script-connector/runtime + + + + + + + + + + \ No newline at end of file diff --git a/runtime/src/main/resources/application.yaml b/runtime/src/main/resources/application.yaml new file mode 100644 index 0000000..f3d8fd1 --- /dev/null +++ b/runtime/src/main/resources/application.yaml @@ -0,0 +1,7 @@ +camunda: + connector: + polling: + enabled: false + webhook: + enabled: false + diff --git a/runtime/src/test/java/io/camunda/community/connector/script/AppTest.java b/runtime/src/test/java/io/camunda/community/connector/script/AppTest.java new file mode 100644 index 0000000..8bf4aed --- /dev/null +++ b/runtime/src/test/java/io/camunda/community/connector/script/AppTest.java @@ -0,0 +1,63 @@ +package io.camunda.community.connector.script; + +import static io.camunda.community.connector.script.ScriptConnector.*; +import static org.assertj.core.api.Assertions.*; + +import io.camunda.zeebe.client.ZeebeClient; +import io.camunda.zeebe.client.api.response.ProcessInstanceResult; +import io.camunda.zeebe.model.bpmn.Bpmn; +import io.camunda.zeebe.model.bpmn.BpmnModelInstance; +import io.camunda.zeebe.spring.test.ZeebeSpringTest; +import java.util.Collections; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +@SpringBootTest +@ZeebeSpringTest +public class AppTest { + + @Autowired ZeebeClient zeebeClient; + + @Test + void shouldRun() { + // just to assert it runs + } + + @Test + void shouldExecuteConnector() { + BpmnModelInstance modelInstance = + Bpmn.createExecutableProcess("process") + .startEvent() + .scriptTask( + "task", + t -> + t.zeebeJobType(SCRIPT_CONNECTOR_TYPE) + .zeebeInput("={a:a,b:a}", "context") + .zeebeInput("a+b", "script.embedded") + .zeebeInput("embedded", "script.type") + .zeebeInput("javascript", "script.language") + .zeebeTaskHeader("resultVariable", "result")) + .endEvent() + .done(); + final var workflowInstanceResult = + deployAndCreateInstance(modelInstance, Collections.singletonMap("a", 3)); + + assertThat(workflowInstanceResult.getVariablesAsMap()).containsEntry("result", 6); + } + + private ProcessInstanceResult deployAndCreateInstance( + final BpmnModelInstance workflow, Map variables) { + zeebeClient.newDeployResourceCommand().addProcessModel(workflow, "process.bpmn").send().join(); + + return zeebeClient + .newCreateInstanceCommand() + .bpmnProcessId("process") + .latestVersion() + .variables(variables) + .withResult() + .send() + .join(); + } +} From 9daf8bc3253645cce3693b1a5f1aa39d6f03914d Mon Sep 17 00:00:00 2001 From: Jonathan Lukas Date: Tue, 31 Oct 2023 12:54:20 +0100 Subject: [PATCH 13/13] added constructors to supported beanification --- .../connector/script/ScriptConnector.java | 31 ++++++++++++------- .../connector/script/ScriptEvaluator.java | 12 ++++++- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java index cfdd05f..cd10cfa 100644 --- a/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java +++ b/connector/src/main/java/io/camunda/community/connector/script/ScriptConnector.java @@ -7,7 +7,6 @@ import io.camunda.connector.api.outbound.OutboundConnectorContext; import io.camunda.connector.api.outbound.OutboundConnectorFunction; import io.camunda.connector.generator.annotation.ElementTemplate; -import java.util.Map; @OutboundConnector( type = ScriptConnector.SCRIPT_CONNECTOR_TYPE, @@ -22,12 +21,27 @@ public class ScriptConnector implements OutboundConnectorFunction { public static final String SCRIPT_CONNECTOR_TYPE = "io.camunda.community:script-connector"; - private final ScriptEvaluator scriptEvaluator = new ScriptEvaluator(); - private final ScriptResourceProvider scriptResourceProvider = new ScriptResourceProvider(); - private final LanguageProvider languageProvider = new LanguageProvider(); + private final ScriptEvaluator scriptEvaluator; + private final ScriptResourceProvider scriptResourceProvider; + private final LanguageProvider languageProvider; + + public ScriptConnector() { + scriptEvaluator = new ScriptEvaluator(); + scriptResourceProvider = new ScriptResourceProvider(); + languageProvider = new LanguageProvider(); + } + + public ScriptConnector( + ScriptEvaluator scriptEvaluator, + ScriptResourceProvider scriptResourceProvider, + LanguageProvider languageProvider) { + this.scriptEvaluator = scriptEvaluator; + this.scriptResourceProvider = scriptResourceProvider; + this.languageProvider = languageProvider; + } @Override - public Object execute(OutboundConnectorContext outboundConnectorContext) throws Exception { + public Object execute(OutboundConnectorContext outboundConnectorContext) { ScriptConnectorInput scriptConnectorInput = outboundConnectorContext.bindVariables(ScriptConnectorInput.class); String script = extractScript(scriptConnectorInput); @@ -46,13 +60,6 @@ private String extractLanguage(ScriptConnectorInput scriptConnectorInput) { } } - private Object generateResponse(String resultVariable, Object evaluationResult) { - if (resultVariable != null && !resultVariable.isBlank()) { - return Map.of(resultVariable, evaluationResult); - } - return null; - } - private String extractScript(ScriptConnectorInput scriptConnectorInput) { Type script = scriptConnectorInput.script(); if (script instanceof Embedded e) { diff --git a/connector/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java b/connector/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java index 1571247..962c023 100644 --- a/connector/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java +++ b/connector/src/main/java/io/camunda/community/connector/script/ScriptEvaluator.java @@ -18,6 +18,7 @@ import io.camunda.community.connector.script.spi.ScriptEvaluatorExtension; import java.util.HashMap; import java.util.Map; +import java.util.Set; import javax.script.Bindings; import javax.script.ScriptContext; import javax.script.ScriptEngine; @@ -39,6 +40,14 @@ public ScriptEvaluator() { .forEach(language -> scriptEvaluatorExtensions.put(language, e))); } + public ScriptEvaluator(Set extensions) { + this(); + extensions.forEach( + e -> + e.getEvaluatedLanguage() + .forEach(language -> scriptEvaluatorExtensions.put(language, e))); + } + public Object evaluate(String language, String script, Map variables) { if (scriptEvaluatorExtensions.containsKey(language)) { @@ -65,7 +74,8 @@ private Object evalWithScriptEngine( } } - private Object eval(ScriptEngine scriptEngine, String script, Map variables) + private synchronized Object eval( + ScriptEngine scriptEngine, String script, Map variables) throws ScriptException { final ScriptContext context = scriptEngine.getContext();