From e7db26c22ca0d7a7882cc4753c63b3269d44b863 Mon Sep 17 00:00:00 2001 From: Simon Zambrovski Date: Sat, 10 Apr 2021 12:51:37 +0200 Subject: [PATCH 01/18] Update for next development version --- docs/pom.xml | 2 +- example/coverage-report-aggregator/pom.xml | 2 +- example/example-java/pom.xml | 2 +- example/example-kotlin/pom.xml | 2 +- example/itest/pom.xml | 2 +- example/pom.xml | 2 +- example/spin-type-detector/pom.xml | 2 +- extension/core/pom.xml | 2 +- extension/test/pom.xml | 2 +- pom.xml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 8c63eaf3..ba4a659a 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ io.holunda.data camunda-bpm-data-parent - 1.2.2 + 1.2.3-SNAPSHOT camunda-bpm-data-docs diff --git a/example/coverage-report-aggregator/pom.xml b/example/coverage-report-aggregator/pom.xml index 7bfef642..84d4f2c8 100644 --- a/example/coverage-report-aggregator/pom.xml +++ b/example/coverage-report-aggregator/pom.xml @@ -6,7 +6,7 @@ io.holunda.data.example camunda-bpm-data-example-parent - 1.2.2 + 1.2.3-SNAPSHOT camunda-bpm-data-coverage-report diff --git a/example/example-java/pom.xml b/example/example-java/pom.xml index 40462e51..87928d1e 100644 --- a/example/example-java/pom.xml +++ b/example/example-java/pom.xml @@ -6,7 +6,7 @@ io.holunda.data.example camunda-bpm-data-example-parent - 1.2.2 + 1.2.3-SNAPSHOT camunda-bpm-data-example-java diff --git a/example/example-kotlin/pom.xml b/example/example-kotlin/pom.xml index 4d5e0aa1..642481cb 100644 --- a/example/example-kotlin/pom.xml +++ b/example/example-kotlin/pom.xml @@ -6,7 +6,7 @@ io.holunda.data.example camunda-bpm-data-example-parent - 1.2.2 + 1.2.3-SNAPSHOT camunda-bpm-data-example-kotlin diff --git a/example/itest/pom.xml b/example/itest/pom.xml index 8f0602a8..853ab5a3 100644 --- a/example/itest/pom.xml +++ b/example/itest/pom.xml @@ -6,7 +6,7 @@ io.holunda.data.example camunda-bpm-data-example-parent - 1.2.2 + 1.2.3-SNAPSHOT camunda-bpm-data-integration-test diff --git a/example/pom.xml b/example/pom.xml index 269dc38c..84333917 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -6,7 +6,7 @@ io.holunda.data camunda-bpm-data-parent - 1.2.2 + 1.2.3-SNAPSHOT io.holunda.data.example diff --git a/example/spin-type-detector/pom.xml b/example/spin-type-detector/pom.xml index 1f05241b..c25d3815 100644 --- a/example/spin-type-detector/pom.xml +++ b/example/spin-type-detector/pom.xml @@ -6,7 +6,7 @@ io.holunda.data.example camunda-bpm-data-example-parent - 1.2.2 + 1.2.3-SNAPSHOT camunda-bpm-data-spin-type-detector diff --git a/extension/core/pom.xml b/extension/core/pom.xml index ef3980b2..1ed7198d 100644 --- a/extension/core/pom.xml +++ b/extension/core/pom.xml @@ -6,7 +6,7 @@ io.holunda.data camunda-bpm-data-parent - 1.2.2 + 1.2.3-SNAPSHOT ../../pom.xml diff --git a/extension/test/pom.xml b/extension/test/pom.xml index 6a561126..cbe3d142 100644 --- a/extension/test/pom.xml +++ b/extension/test/pom.xml @@ -6,7 +6,7 @@ io.holunda.data camunda-bpm-data-parent - 1.2.2 + 1.2.3-SNAPSHOT ../../pom.xml diff --git a/pom.xml b/pom.xml index 5a18502f..17809cca 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.holunda.data camunda-bpm-data-parent - 1.2.2 + 1.2.3-SNAPSHOT ${project.artifactId} Camunda BPM Data https://github.com/holunda-io/camunda-bpm-data/ From e59d7d7c4011066d3b8a0c640cbf90e446367e0d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 16 Apr 2021 06:33:06 +0000 Subject: [PATCH 02/18] Bump camunda-bpm-mockito from 4.12.0 to 5.14.0 Bumps [camunda-bpm-mockito](https://github.com/camunda/camunda-bpm-mockito) from 4.12.0 to 5.14.0. - [Release notes](https://github.com/camunda/camunda-bpm-mockito/releases) - [Commits](https://github.com/camunda/camunda-bpm-mockito/compare/4.12.0...5.14.0) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 17809cca..a2bf99da 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.0.2 2.2.0 - 4.12.0 + 5.14.0 2.23.4 **/*ITest.* From 5f25790af711790045c771edc01745ef601bd804 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 16 Apr 2021 06:33:58 +0000 Subject: [PATCH 03/18] Bump gitflow-maven-plugin from 1.14.0 to 1.16.0 Bumps [gitflow-maven-plugin](https://github.com/aleksandr-m/gitflow-maven-plugin) from 1.14.0 to 1.16.0. - [Release notes](https://github.com/aleksandr-m/gitflow-maven-plugin/releases) - [Changelog](https://github.com/aleksandr-m/gitflow-maven-plugin/blob/master/CHANGELOG.md) - [Commits](https://github.com/aleksandr-m/gitflow-maven-plugin/compare/v1.14.0...v1.16.0) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 17809cca..40cdea78 100644 --- a/pom.xml +++ b/pom.xml @@ -421,7 +421,7 @@ com.amashchenko.maven.plugin gitflow-maven-plugin - 1.14.0 + 1.16.0 master From 568dc836b92c43f9b6efb02dd04836107b53be54 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 16 Apr 2021 06:34:44 +0000 Subject: [PATCH 04/18] Bump maven-source-plugin from 3.2.0 to 3.2.1 Bumps [maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.2.0 to 3.2.1. - [Release notes](https://github.com/apache/maven-source-plugin/releases) - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.2.0...maven-source-plugin-3.2.1) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 17809cca..e27c3c31 100644 --- a/pom.xml +++ b/pom.xml @@ -401,7 +401,7 @@ org.apache.maven.plugins maven-source-plugin - 3.2.0 + 3.2.1 attach-sources From 261cc90bc3598791c368c70bfe037a4e39b7900b Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 19 Apr 2021 07:52:02 +0000 Subject: [PATCH 05/18] Bump camunda-bpm-mockito from 5.14.0 to 5.15.0 Bumps [camunda-bpm-mockito](https://github.com/camunda/camunda-bpm-mockito) from 5.14.0 to 5.15.0. - [Release notes](https://github.com/camunda/camunda-bpm-mockito/releases) - [Commits](https://github.com/camunda/camunda-bpm-mockito/compare/5.14.0...5.15.0) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa5a26bb..59abd070 100644 --- a/pom.xml +++ b/pom.xml @@ -32,7 +32,7 @@ 2.0.2 2.2.0 - 5.14.0 + 5.15.0 2.23.4 **/*ITest.* From 5c56650ddffda743961f1a299ed40e5b7b4a1e01 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 19 Apr 2021 07:54:22 +0000 Subject: [PATCH 06/18] Bump kotlin-logging-jvm from 2.0.2 to 2.0.6 Bumps [kotlin-logging-jvm](https://github.com/MicroUtils/kotlin-logging) from 2.0.2 to 2.0.6. - [Release notes](https://github.com/MicroUtils/kotlin-logging/releases) - [Changelog](https://github.com/MicroUtils/kotlin-logging/blob/master/ChangeLog.md) - [Commits](https://github.com/MicroUtils/kotlin-logging/commits) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa5a26bb..65c00190 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 1.4.21 true - 2.0.2 + 2.0.6 2.2.0 5.14.0 2.23.4 From ece95e6fb53c87d6a641e1041afdafbaf68c152d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 19 Apr 2021 07:57:50 +0000 Subject: [PATCH 07/18] Bump kotlin.version from 1.4.21 to 1.4.32 Bumps `kotlin.version` from 1.4.21 to 1.4.32. Updates `kotlin-bom` from 1.4.21 to 1.4.32 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/v1.4.32/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v1.4.21...v1.4.32) Updates `kotlin-maven-allopen` from 1.4.21 to 1.4.32 Updates `kotlin-maven-noarg` from 1.4.21 to 1.4.32 Updates `kotlin-maven-plugin` from 1.4.21 to 1.4.32 Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa5a26bb..6fa2acbd 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,7 @@ 10.0.0 0.18.2 - 1.4.21 + 1.4.32 true 2.0.2 From 3bb8b6a1e01ad58e891cbb5871948f3faa857f25 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 20 Apr 2021 07:35:34 +0000 Subject: [PATCH 08/18] Bump maven-resources-plugin from 3.1.0 to 3.2.0 Bumps [maven-resources-plugin](https://github.com/apache/maven-resources-plugin) from 3.1.0 to 3.2.0. - [Release notes](https://github.com/apache/maven-resources-plugin/releases) - [Commits](https://github.com/apache/maven-resources-plugin/compare/maven-resources-plugin-3.1.0...maven-resources-plugin-3.2.0) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa5a26bb..500bb174 100644 --- a/pom.xml +++ b/pom.xml @@ -309,7 +309,7 @@ org.apache.maven.plugins maven-resources-plugin - 3.1.0 + 3.2.0 ${project.build.sourceEncoding} From 39c867f6aeb08999e400fc9b060e1a6103a39df0 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 20 Apr 2021 07:36:16 +0000 Subject: [PATCH 09/18] Bump build-helper-maven-plugin from 3.0.0 to 3.2.0 Bumps [build-helper-maven-plugin](https://github.com/mojohaus/build-helper-maven-plugin) from 3.0.0 to 3.2.0. - [Release notes](https://github.com/mojohaus/build-helper-maven-plugin/releases) - [Commits](https://github.com/mojohaus/build-helper-maven-plugin/compare/build-helper-maven-plugin-3.0.0...build-helper-maven-plugin-3.2.0) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa5a26bb..41d6ef80 100644 --- a/pom.xml +++ b/pom.xml @@ -381,7 +381,7 @@ org.codehaus.mojo build-helper-maven-plugin - 3.0.0 + 3.2.0 generate-sources From 53cb9b1ee912690f054ac141c04effcda6d45480 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 20 Apr 2021 07:36:57 +0000 Subject: [PATCH 10/18] Bump groovy-all from 2.4.5 to 2.4.21 Bumps [groovy-all](https://github.com/apache/groovy) from 2.4.5 to 2.4.21. - [Release notes](https://github.com/apache/groovy/releases) - [Commits](https://github.com/apache/groovy/commits) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aa5a26bb..68d537c9 100644 --- a/pom.xml +++ b/pom.xml @@ -22,7 +22,7 @@ 7.15.0-ee 2.4.4 - 2.4.5 + 2.4.21 1.10.1 10.0.0 From e551275d5991c7041e12cf2483c637b1fdd6262e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 20 Apr 2021 08:09:20 +0000 Subject: [PATCH 11/18] Bump mockito-core from 2.23.4 to 3.9.0 Bumps [mockito-core](https://github.com/mockito/mockito) from 2.23.4 to 3.9.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v2.23.4...v3.9.0) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dd86c897..0afc8b4e 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ 2.0.6 2.2.0 5.15.0 - 2.23.4 + 3.9.0 **/*ITest.* **/itest/**/*.* From 046ab6cc95bd29ec40a1073850e6ff868dd7984e Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 22 Apr 2021 07:12:13 +0000 Subject: [PATCH 12/18] Bump dokka-maven-plugin from 1.4.10.2 to 1.4.30 Bumps [dokka-maven-plugin](https://github.com/Kotlin/dokka) from 1.4.10.2 to 1.4.30. - [Release notes](https://github.com/Kotlin/dokka/releases) - [Commits](https://github.com/Kotlin/dokka/compare/v1.4.10.2...v1.4.30) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5089383c..bc98fa61 100644 --- a/pom.xml +++ b/pom.xml @@ -347,7 +347,7 @@ org.jetbrains.dokka dokka-maven-plugin - 1.4.10.2 + 1.4.30 attach-javadocs From 8ca0f52ef38ab1b01ac9b1c0b5e5a0847e57c462 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 22 Apr 2021 07:14:38 +0000 Subject: [PATCH 13/18] Bump spring-boot.version from 2.4.4 to 2.4.5 Bumps `spring-boot.version` from 2.4.4 to 2.4.5. Updates `spring-boot-dependencies` from 2.4.4 to 2.4.5 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v2.4.4...v2.4.5) Updates `spring-boot-maven-plugin` from 2.4.4 to 2.4.5 - [Release notes](https://github.com/spring-projects/spring-boot/releases) - [Commits](https://github.com/spring-projects/spring-boot/compare/v2.4.4...v2.4.5) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5089383c..612aa0bb 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ 7.15.0 7.15.0-ee - 2.4.4 + 2.4.5 2.4.21 1.10.1 10.0.0 From 30440e1d82c2826fc78b8495a8d21995ce19a92d Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 22 Apr 2021 07:14:55 +0000 Subject: [PATCH 14/18] Bump annotations from 18.0.0 to 20.1.0 Bumps [annotations](https://github.com/JetBrains/java-annotations) from 18.0.0 to 20.1.0. - [Release notes](https://github.com/JetBrains/java-annotations/releases) - [Changelog](https://github.com/JetBrains/java-annotations/blob/master/CHANGELOG.md) - [Commits](https://github.com/JetBrains/java-annotations/compare/18.0.0...20.1.0) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5089383c..0c9966b7 100644 --- a/pom.xml +++ b/pom.xml @@ -125,7 +125,7 @@ org.jetbrains annotations - 18.0.0 + 20.1.0 From 311fbc468116d77f57bcfff19ac336d2d71e6f71 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Thu, 22 Apr 2021 07:15:26 +0000 Subject: [PATCH 15/18] Bump camunda-bpm-jgiven from 0.0.5 to 0.0.7 Bumps [camunda-bpm-jgiven](https://github.com/holunda-io/camunda-bpm-jgiven) from 0.0.5 to 0.0.7. - [Release notes](https://github.com/holunda-io/camunda-bpm-jgiven/releases) - [Commits](https://github.com/holunda-io/camunda-bpm-jgiven/compare/0.0.5...0.0.7) Signed-off-by: dependabot-preview[bot] --- example/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example/pom.xml b/example/pom.xml index 84333917..7ced994d 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -59,7 +59,7 @@ io.holunda.testing camunda-bpm-jgiven - 0.0.5 + 0.0.7 test From 3f141f7e794f4e596ee4d9e18818030842203f26 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 23 Apr 2021 06:43:31 +0000 Subject: [PATCH 16/18] Bump dokka-maven-plugin from 1.4.30 to 1.4.32 Bumps [dokka-maven-plugin](https://github.com/Kotlin/dokka) from 1.4.30 to 1.4.32. - [Release notes](https://github.com/Kotlin/dokka/releases) - [Commits](https://github.com/Kotlin/dokka/compare/v1.4.30...v1.4.32) Signed-off-by: dependabot-preview[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ade967fa..268b815a 100644 --- a/pom.xml +++ b/pom.xml @@ -347,7 +347,7 @@ org.jetbrains.dokka dokka-maven-plugin - 1.4.30 + 1.4.32 attach-javadocs From 34ba3498dbd9c83890b8e5a9dcdeb70cd040d7b2 Mon Sep 17 00:00:00 2001 From: Stefan Zilske Date: Fri, 23 Apr 2021 12:32:21 +0200 Subject: [PATCH 17/18] Fix LockedExternalTaskReadAdapter, fixes #109 (#110) * Fix LockedExternalTaskReadAdapter, fixes #109 * Remove unused imports --- .../ListReadAdapterLockedExternalTask.java | 7 ++- .../map/MapReadAdapterLockedExternalTask.java | 23 ++++---- .../set/SetReadAdapterLockedExternalTask.java | 12 +++-- .../reader/LockedExternalTaskReaderTest.java | 52 ++++++++++++++++--- 4 files changed, 69 insertions(+), 25 deletions(-) diff --git a/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/list/ListReadAdapterLockedExternalTask.java b/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/list/ListReadAdapterLockedExternalTask.java index d47412eb..efee4f18 100644 --- a/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/list/ListReadAdapterLockedExternalTask.java +++ b/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/list/ListReadAdapterLockedExternalTask.java @@ -3,6 +3,7 @@ import io.holunda.camunda.bpm.data.adapter.ReadAdapter; import io.holunda.camunda.bpm.data.adapter.WrongVariableTypeException; import org.camunda.bpm.engine.externaltask.LockedExternalTask; +import org.camunda.bpm.engine.variable.Variables; import java.util.Collections; import java.util.List; @@ -28,7 +29,7 @@ public ListReadAdapterLockedExternalTask(LockedExternalTask lockedExternalTask, @Override public List get() { - return null; + return getOptional().get(); } @Override @@ -90,6 +91,8 @@ private List getOrNull(T value) { } private T getValue() { - return (T) Optional.ofNullable(lockedExternalTask.getVariables()).map(it -> it.get(variableName)).get(); + return (T) Optional.ofNullable(lockedExternalTask.getVariables()) + .orElse(Variables.createVariables()) + .get(variableName); } } diff --git a/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/map/MapReadAdapterLockedExternalTask.java b/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/map/MapReadAdapterLockedExternalTask.java index f1011ae2..8bca8fd3 100644 --- a/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/map/MapReadAdapterLockedExternalTask.java +++ b/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/map/MapReadAdapterLockedExternalTask.java @@ -3,6 +3,7 @@ import io.holunda.camunda.bpm.data.adapter.ReadAdapter; import io.holunda.camunda.bpm.data.adapter.WrongVariableTypeException; import org.camunda.bpm.engine.externaltask.LockedExternalTask; +import org.camunda.bpm.engine.variable.Variables; import java.util.Collections; import java.util.Map; @@ -31,47 +32,47 @@ public MapReadAdapterLockedExternalTask(LockedExternalTask lockedExternalTask, S @Override public Map get() { - return null; + return getOptional().get(); } @Override @SuppressWarnings("java:S3655") - public Optional> getOptional() { + public Optional> getOptional() { return Optional.ofNullable(getOrNull(getValue())); } @Override - public Map getLocal() { + public Map getLocal() { throw new UnsupportedOperationException("Can't get a local variable on an external task"); } @Override - public Optional> getLocalOptional() { + public Optional> getLocalOptional() { throw new UnsupportedOperationException("Can't get a local variable on an external task"); } @Override - public Map getOrDefault(Map defaultValue) { + public Map getOrDefault(Map defaultValue) { return getOptional().orElse(defaultValue); } @Override - public Map getLocalOrDefault(Map defaultValue) { + public Map getLocalOrDefault(Map defaultValue) { throw new UnsupportedOperationException("Can't get a local variable on an external task"); } @Override - public Map getOrNull() { + public Map getOrNull() { return getOrNull(getValue()); } @Override - public Map getLocalOrNull() { + public Map getLocalOrNull() { throw new UnsupportedOperationException("Can't get a local variable on an external task"); } @SuppressWarnings("Duplicates") - private Map getOrNull(Object value) { + private Map getOrNull(Object value) { if (value == null) { return null; } @@ -96,6 +97,8 @@ private Map getOrNull(Object value) { } private Object getValue() { - return Optional.ofNullable(lockedExternalTask.getVariables()).map(it -> it.get(variableName)).get(); + return Optional.ofNullable(lockedExternalTask.getVariables()) + .orElse(Variables.createVariables()) + .get(variableName); } } diff --git a/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/set/SetReadAdapterLockedExternalTask.java b/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/set/SetReadAdapterLockedExternalTask.java index 21b25a63..574b9ae8 100644 --- a/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/set/SetReadAdapterLockedExternalTask.java +++ b/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/set/SetReadAdapterLockedExternalTask.java @@ -3,9 +3,9 @@ import io.holunda.camunda.bpm.data.adapter.ReadAdapter; import io.holunda.camunda.bpm.data.adapter.WrongVariableTypeException; import org.camunda.bpm.engine.externaltask.LockedExternalTask; +import org.camunda.bpm.engine.variable.Variables; import java.util.Collections; -import java.util.List; import java.util.Optional; import java.util.Set; @@ -29,7 +29,7 @@ public SetReadAdapterLockedExternalTask(LockedExternalTask lockedExternalTask, S @Override public Set get() { - return null; + return getOptional().get(); } @Override @@ -74,8 +74,8 @@ private Set getOrNull(T value) { return null; } - if (List.class.isAssignableFrom(value.getClass())) { - List valueAsSet = (List) value; + if (Set.class.isAssignableFrom(value.getClass())) { + Set valueAsSet = (Set) value; if (valueAsSet.isEmpty()) { return Collections.emptySet(); } else { @@ -91,6 +91,8 @@ private Set getOrNull(T value) { } private T getValue() { - return (T) Optional.ofNullable(lockedExternalTask.getVariables()).map(it -> it.get(variableName)).get(); + return (T) Optional.ofNullable(lockedExternalTask.getVariables()) + .orElse(Variables.createVariables()) + .get(variableName); } } diff --git a/extension/core/src/test/java/io/holunda/camunda/bpm/data/reader/LockedExternalTaskReaderTest.java b/extension/core/src/test/java/io/holunda/camunda/bpm/data/reader/LockedExternalTaskReaderTest.java index 94b512bb..e9d1b039 100644 --- a/extension/core/src/test/java/io/holunda/camunda/bpm/data/reader/LockedExternalTaskReaderTest.java +++ b/extension/core/src/test/java/io/holunda/camunda/bpm/data/reader/LockedExternalTaskReaderTest.java @@ -7,17 +7,32 @@ import org.junit.Before; import org.junit.Test; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static io.holunda.camunda.bpm.data.CamundaBpmData.listVariable; +import static io.holunda.camunda.bpm.data.CamundaBpmData.mapVariable; +import static io.holunda.camunda.bpm.data.CamundaBpmData.setVariable; import static io.holunda.camunda.bpm.data.CamundaBpmData.stringVariable; +import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; +import static org.camunda.bpm.engine.impl.util.CollectionUtil.asHashSet; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; public class LockedExternalTaskReaderTest { private static final VariableFactory STRING = stringVariable("myString"); + private static final VariableFactory> LIST = listVariable("myList", String.class); + private static final VariableFactory> SET = setVariable("mySet", String.class); + private static final VariableFactory> MAP = mapVariable("myMap", String.class, String.class); - private final String value = "value"; + private final String stringValue = "value"; + private final List listValue = asList("foo", "bar"); + private final Set setValue = asHashSet("foo", "bar"); + private final Map mapValue = Map.of("a", "b", "c", "d"); LockedExternalTask externalTask = mock(LockedExternalTask.class); private VariableReader reader = CamundaBpmData.reader(externalTask); @@ -25,17 +40,29 @@ public class LockedExternalTaskReaderTest { @Before public void setUp() { - when(externalTask.getVariables()).thenReturn(Variables.putValue(STRING.getName(), value)); + when(externalTask.getVariables()).thenReturn( + Variables + .putValue(STRING.getName(), stringValue) + .putValue(LIST.getName(), listValue) + .putValue(SET.getName(), setValue) + .putValue(MAP.getName(), mapValue) + ); } @Test public void shouldDelegateGet() { - assertThat(reader.get(STRING)).isEqualTo(value); + assertThat(reader.get(STRING)).isEqualTo(stringValue); + assertThat(reader.get(LIST)).isEqualTo(listValue); + assertThat(reader.get(SET)).isEqualTo(setValue); + assertThat(reader.get(MAP)).isEqualTo(mapValue); } @Test public void shouldDelegateGetOptional() { - assertThat(reader.getOptional(STRING)).hasValue(value); + assertThat(reader.getOptional(STRING)).hasValue(stringValue); + assertThat(reader.getOptional(LIST)).hasValue(listValue); + assertThat(reader.getOptional(SET)).hasValue(setValue); + assertThat(reader.getOptional(MAP)).hasValue(mapValue); assertThat(reader.getOptional(stringVariable("xxx"))).isEmpty(); } @@ -55,7 +82,10 @@ public void shouldDelegateGetLocal() { @Test public void shouldDelegateGetOrNull() { - assertThat(reader.getOrNull(STRING)).isEqualTo(value); + assertThat(reader.getOrNull(STRING)).isEqualTo(stringValue); + assertThat(reader.getOrNull(LIST)).isEqualTo(listValue); + assertThat(reader.getOrNull(SET)).isEqualTo(setValue); + assertThat(reader.getOrNull(MAP)).isEqualTo(mapValue); assertThat(reader.getOrNull(stringVariable("xxx"))).isNull(); } @@ -68,14 +98,20 @@ public void shouldDelegateGetLocalOrNull() { @Test public void shouldDelegateGetOrDefault() { - assertThat(reader.getOrDefault(STRING, "default")).isEqualTo(value); - assertThat(reader.getOrDefault(stringVariable("xxx"), "default")).isEqualTo("default"); + assertThat(reader.getOrDefault(STRING, "default")).isEqualTo(stringValue); + assertThat(reader.getOrDefault(LIST, asList("a", "b"))).isEqualTo(listValue); + assertThat(reader.getOrDefault(SET, asHashSet("a", "b"))).isEqualTo(setValue); + assertThat(reader.getOrDefault(MAP, Map.of("a", "b", "c", "d"))).isEqualTo(mapValue); + assertThat(reader.getOrDefault(stringVariable("xxx"), "default")).isEqualTo("default"); + assertThat(reader.getOrDefault(listVariable("xxx", String.class), asList("a", "b"))).isEqualTo(asList("a", "b")); + assertThat(reader.getOrDefault(setVariable("xxx", String.class), asHashSet("a", "b"))).isEqualTo(asHashSet("a", "b")); + assertThat(reader.getOrDefault(mapVariable("xxx", String.class, String.class), Map.of("a", "b", "c", "d"))).isEqualTo(Map.of("a", "b", "c", "d")); } @Test public void shouldDelegateGetLocalOrDefault() { - assertThatThrownBy(() -> reader.getLocalOrDefault(STRING, value)) + assertThatThrownBy(() -> reader.getLocalOrDefault(STRING, stringValue)) .isInstanceOf(UnsupportedOperationException.class) .hasMessage("Can't get a local variable on an external task"); } From 36d92cffaab6eee70f50db716ea8ce41d3624477 Mon Sep 17 00:00:00 2001 From: Simon Zambrovski Date: Tue, 27 Apr 2021 11:30:49 +0200 Subject: [PATCH 18/18] Update for next development version --- docs/pom.xml | 2 +- example/coverage-report-aggregator/pom.xml | 2 +- example/example-java/pom.xml | 2 +- example/example-kotlin/pom.xml | 2 +- example/itest/pom.xml | 2 +- example/pom.xml | 2 +- example/spin-type-detector/pom.xml | 2 +- extension/core/pom.xml | 2 +- extension/test/pom.xml | 2 +- pom.xml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index ba4a659a..88ed4288 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ io.holunda.data camunda-bpm-data-parent - 1.2.3-SNAPSHOT + 1.2.3 camunda-bpm-data-docs diff --git a/example/coverage-report-aggregator/pom.xml b/example/coverage-report-aggregator/pom.xml index 84d4f2c8..008a6baa 100644 --- a/example/coverage-report-aggregator/pom.xml +++ b/example/coverage-report-aggregator/pom.xml @@ -6,7 +6,7 @@ io.holunda.data.example camunda-bpm-data-example-parent - 1.2.3-SNAPSHOT + 1.2.3 camunda-bpm-data-coverage-report diff --git a/example/example-java/pom.xml b/example/example-java/pom.xml index 87928d1e..fe91facd 100644 --- a/example/example-java/pom.xml +++ b/example/example-java/pom.xml @@ -6,7 +6,7 @@ io.holunda.data.example camunda-bpm-data-example-parent - 1.2.3-SNAPSHOT + 1.2.3 camunda-bpm-data-example-java diff --git a/example/example-kotlin/pom.xml b/example/example-kotlin/pom.xml index 642481cb..8067539b 100644 --- a/example/example-kotlin/pom.xml +++ b/example/example-kotlin/pom.xml @@ -6,7 +6,7 @@ io.holunda.data.example camunda-bpm-data-example-parent - 1.2.3-SNAPSHOT + 1.2.3 camunda-bpm-data-example-kotlin diff --git a/example/itest/pom.xml b/example/itest/pom.xml index 853ab5a3..1d5c646a 100644 --- a/example/itest/pom.xml +++ b/example/itest/pom.xml @@ -6,7 +6,7 @@ io.holunda.data.example camunda-bpm-data-example-parent - 1.2.3-SNAPSHOT + 1.2.3 camunda-bpm-data-integration-test diff --git a/example/pom.xml b/example/pom.xml index 7ced994d..54459a57 100644 --- a/example/pom.xml +++ b/example/pom.xml @@ -6,7 +6,7 @@ io.holunda.data camunda-bpm-data-parent - 1.2.3-SNAPSHOT + 1.2.3 io.holunda.data.example diff --git a/example/spin-type-detector/pom.xml b/example/spin-type-detector/pom.xml index c25d3815..cde809ba 100644 --- a/example/spin-type-detector/pom.xml +++ b/example/spin-type-detector/pom.xml @@ -6,7 +6,7 @@ io.holunda.data.example camunda-bpm-data-example-parent - 1.2.3-SNAPSHOT + 1.2.3 camunda-bpm-data-spin-type-detector diff --git a/extension/core/pom.xml b/extension/core/pom.xml index 1ed7198d..018a029e 100644 --- a/extension/core/pom.xml +++ b/extension/core/pom.xml @@ -6,7 +6,7 @@ io.holunda.data camunda-bpm-data-parent - 1.2.3-SNAPSHOT + 1.2.3 ../../pom.xml diff --git a/extension/test/pom.xml b/extension/test/pom.xml index cbe3d142..6525f180 100644 --- a/extension/test/pom.xml +++ b/extension/test/pom.xml @@ -6,7 +6,7 @@ io.holunda.data camunda-bpm-data-parent - 1.2.3-SNAPSHOT + 1.2.3 ../../pom.xml diff --git a/pom.xml b/pom.xml index b741f25e..f8d31737 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.holunda.data camunda-bpm-data-parent - 1.2.3-SNAPSHOT + 1.2.3 ${project.artifactId} Camunda BPM Data https://github.com/holunda-io/camunda-bpm-data/