From 096a5317a0026f5632d8b7521d37eee8d39ce002 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Date: Mon, 2 Oct 2023 18:02:38 -0700 Subject: [PATCH] Accept a list of server in the BPMN list --- pom.xml | 4 +- .../org/camunda/automator/AutomatorAPI.java | 9 +- .../org/camunda/automator/AutomatorCLI.java | 95 ++++++------ .../automator/bpmnengine/BpmnEngine.java | 10 +- .../BpmnEngineConfigurationInstance.java | 48 +++--- .../bpmnengine/BpmnEngineFactory.java | 9 +- .../camunda7/BpmnEngineCamunda7.java | 13 +- .../camunda8/BpmnEngineCamunda8.java | 29 ++-- .../bpmnengine/dummy/BpmnEngineDummy.java | 14 +- ...tionBpmEngine.java => BpmnEngineList.java} | 138 +++++++++++++----- .../ConfigurationServersEngine.java | 44 +++--- .../automator/definition/Scenario.java | 6 +- .../definition/ScenarioDeployment.java | 4 +- .../automator/engine/RunParameters.java | 8 +- .../camunda/automator/engine/RunResult.java | 4 +- .../camunda/automator/engine/RunScenario.java | 12 +- .../automator/engine/SchedulerExecution.java | 4 +- .../flow/RunScenarioFlowServiceTask.java | 6 +- .../flow/RunScenarioFlowStartEvent.java | 4 +- .../engine/flow/RunScenarioWarmingUp.java | 4 +- .../engine/unit/RunScenarioUnit.java | 10 +- .../engine/unit/RunScenarioVerification.java | 2 +- .../automator/services/AutomatorStartup.java | 16 +- src/main/resources/application.yaml | 19 +-- .../java/automatorapi/TestSimpleUserTask.java | 5 +- 25 files changed, 290 insertions(+), 227 deletions(-) rename src/main/java/org/camunda/automator/configuration/{ConfigurationBpmEngine.java => BpmnEngineList.java} (65%) diff --git a/pom.xml b/pom.xml index 81a1cd1..fcb6b90 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.camunda.community.automator process-execution-automator - 1.2.1-SNAPSHOT + 1.2.2 17 @@ -17,7 +17,7 @@ 5.9.1 2.0.3 - 3.1.3 + 3.1.4 diff --git a/src/main/java/org/camunda/automator/AutomatorAPI.java b/src/main/java/org/camunda/automator/AutomatorAPI.java index d02edd0..8f7fbe9 100644 --- a/src/main/java/org/camunda/automator/AutomatorAPI.java +++ b/src/main/java/org/camunda/automator/AutomatorAPI.java @@ -8,7 +8,7 @@ import org.camunda.automator.bpmnengine.BpmnEngine; import org.camunda.automator.bpmnengine.BpmnEngineFactory; -import org.camunda.automator.configuration.ConfigurationBpmEngine; +import org.camunda.automator.configuration.BpmnEngineList; import org.camunda.automator.definition.Scenario; import org.camunda.automator.engine.AutomatorException; import org.camunda.automator.engine.RunParameters; @@ -72,7 +72,7 @@ public Scenario loadFromInputStream(InputStream scenarioInputStream, String orig * @param engineConfiguration different engine configuration * @return the engine, null if no engine exist, an exception if the connection is not possible */ - public BpmnEngine getBpmnEngineFromScenario(Scenario scenario, ConfigurationBpmEngine engineConfiguration) + public BpmnEngine getBpmnEngineFromScenario(Scenario scenario, BpmnEngineList engineConfiguration) throws AutomatorException { try { @@ -124,9 +124,8 @@ public RunResult executeScenario(BpmnEngine bpmnEngine, RunParameters runParamet /* Deploy a process in the server */ /* ******************************************************************** */ - public BpmnEngine getBpmnEngine(ConfigurationBpmEngine engineConfiguration, - ConfigurationBpmEngine.BpmnServerDefinition serverDefinition) - throws AutomatorException { + public BpmnEngine getBpmnEngine(BpmnEngineList engineConfiguration, + BpmnEngineList.BpmnServerDefinition serverDefinition) throws AutomatorException { return BpmnEngineFactory.getInstance().getEngineFromConfiguration(engineConfiguration, serverDefinition); } diff --git a/src/main/java/org/camunda/automator/AutomatorCLI.java b/src/main/java/org/camunda/automator/AutomatorCLI.java index a2859f1..33fccb6 100644 --- a/src/main/java/org/camunda/automator/AutomatorCLI.java +++ b/src/main/java/org/camunda/automator/AutomatorCLI.java @@ -1,8 +1,9 @@ package org.camunda.automator; import org.camunda.automator.bpmnengine.BpmnEngine; -import org.camunda.automator.configuration.ConfigurationBpmEngine; +import org.camunda.automator.configuration.BpmnEngineList; import org.camunda.automator.definition.Scenario; +import org.camunda.automator.engine.AutomatorException; import org.camunda.automator.engine.RunParameters; import org.camunda.automator.engine.RunResult; import org.slf4j.Logger; @@ -27,7 +28,7 @@ public class AutomatorCLI implements CommandLineRunner { @Autowired AutomatorAPI automatorAPI; @Autowired - ConfigurationBpmEngine engineConfiguration; + BpmnEngineList engineConfiguration; public static void main(String[] args) { isRunningCLI = true; @@ -59,37 +60,37 @@ public static void main(String[] args) { /* ******************************************************************** */ private static void printUsage() { - System.out.println("Usage: