diff --git a/README.md b/README.md
index a13c4467..2d5d3555 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,6 @@
+## Camunda BPM Data
+
+[![stable](https://img.shields.io/badge/lifecycle-STABLE-green.svg)](https://github.com/holisticon#open-source-lifecycle)
[![Build Status](https://github.com/holunda-io/camunda-bpm-data/workflows/default/badge.svg)](https://github.com/holunda-io/camunda-bpm-data/actions)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/io.holunda.data/camunda-bpm-data/badge.svg)](https://maven-badges.herokuapp.com/maven-central/io.holunda.data/camunda-bpm-data)
[![CodeCov](https://codecov.io/gh/holunda-io/camunda-bpm-data/branch/master/graph/badge.svg)](https://codecov.io/gh/holunda-io/camunda-bpm-data)
@@ -5,9 +8,7 @@
[![Changes](https://img.shields.io/badge/CHANGES---yellow)](https://www.holunda.io/camunda-bpm-data/changelog)
[![gitter](https://badges.gitter.im/holunda-io/camunda-bpm-data.svg)](https://gitter.im/holunda-io/camunda-bpm-data?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
-## Camunda BPM Data
-
-> Beautiful process data handling for Camunda BPM.
+> Beautiful process data handling for Camunda Platform 7.
## Why to use this library in every Camunda project
@@ -15,14 +16,14 @@ If you are a software engineer and run process automation projects in your compa
based on Camunda Process Engine, you probably are familiar with process variables. Camunda offers an API to access
them and thereby manipulate the state of the process execution - one of the core features during process automation.
-Unfortunately, as a user of the Camunda API, you have to exactly know the variable type (so the Java class behind it).
+Unfortunately, as a user of the Camunda Platform 7 API, you have to exactly know the variable type (so the Java class behind it).
For example, if you store a String in a variable `"orderId"` you must extract it as a String in every piece of code.
Since there is no code connection between the different code parts, but the BPMN process model orchestrates
these snippets to a single process execution, it makes refactoring and testing of process automation projects
error-prone and challenging.
This library helps you to overcome these difficulties and make access, manipulation and testing process variables really
-easy and convenient. We leverage the Camunda API and offer you not only a better API but also some [additional features](https://www.holunda.io/camunda-bpm-data/wiki/user-guide/features).
+easy and convenient. We leverage the Camunda Platform 7 API and offer you not only a better API but also some [additional features](https://www.holunda.io/camunda-bpm-data/snapshot/user-guide/features.html).
If you want to read more about data in Camunda processes, have a look on those articles:
@@ -40,20 +41,20 @@ If you just want to start using the library, put the following dependency into y
io.holunda.data
camunda-bpm-data
- 1.2.5
+ 1.2.6
```
If you are using Gradle Kotlin DSL add to your `build.gradle.kts`:
``` kotlin
-implementation("io.holunda.data:camunda-bpm-data:1.2.5")
+implementation("io.holunda.data:camunda-bpm-data:1.2.6")
```
For Gradle Groovy DSL add to your `build.gradle`:
``` groovy
-implementation 'io.holunda.data:camunda-bpm-data:1.2.5'
+implementation 'io.holunda.data:camunda-bpm-data:1.2.6'
```
### Variable declaration
Now your setup is completed, and you can declare your variables like this:
@@ -139,7 +140,7 @@ Please put the following dependency into your `pom.xml`:
io.holunda.data
camunda-bpm-data-test
- 1.2.2
+ 1.2.6
test
```
@@ -191,23 +192,23 @@ public class ApproveOrderTaskControllerTest {
### Further documentation
-For further details, please consult our [Quick Start](https://www.holunda.io/camunda-bpm-data/quick-start)
-guide or have a look to our primary documentation - [the User Guide](https://www.holunda.io/camunda-bpm-data/wiki/user-guide)
+For further details, please consult our [Quick Start](https://www.holunda.io/camunda-bpm-data/snapshot/quick-start)
+guide or have a look to our primary documentation: [User Guide](https://www.holunda.io/camunda-bpm-data/snapshot/user-guide/motivation.html)
## Working Example
We prepared some typical usage scenarios and implemented two example projects in Java and Kotlin.
-See our [Examples](https://www.holunda.io/camunda-bpm-data/wiki/user-guide/examples) section for usage and configuration.
+See our [Examples](https://www.holunda.io/camunda-bpm-data/snapshot/user-guide/examples.html) section for usage and configuration.
## License
-[![Apache License 2](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.holunda.io/camunda-bpm-data/license)
+[![Apache License 2](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
This library is developed under Apache 2.0 License.
## Contribution
-If you want to contribute to this project, feel free to do so. Start with [Contributing guide](http://holunda.io/camunda-bpm-data/wiki/developer-guide/contribution).
+If you want to contribute to this project, feel free to do so. Start with [Contributing guide](http://holunda.io/camunda-bpm-data/snapshot/developer-guide/contribution.html).
## Maintainer
diff --git a/example/coverage-report-aggregator/pom.xml b/example/coverage-report-aggregator/pom.xml
index 7f00a86d..308020ca 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.6
+ 1.2.7
camunda-bpm-data-coverage-report
diff --git a/example/example-java/pom.xml b/example/example-java/pom.xml
index 9d745ce2..9d12ab4a 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.6
+ 1.2.7
camunda-bpm-data-example-java
diff --git a/example/example-kotlin/pom.xml b/example/example-kotlin/pom.xml
index fbdf0b1e..9b607838 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.6
+ 1.2.7
camunda-bpm-data-example-kotlin
diff --git a/example/example-no-engine/pom.xml b/example/example-no-engine/pom.xml
index 7f7818f5..5c1cc77b 100644
--- a/example/example-no-engine/pom.xml
+++ b/example/example-no-engine/pom.xml
@@ -6,7 +6,7 @@
io.holunda.data.example
camunda-bpm-data-example-parent
- 1.2.6
+ 1.2.7
camunda-bpm-data-example-no-engine
@@ -32,7 +32,7 @@
io.holunda.camunda-api
camunda-bpm-engine-api
- 7.15.0
+ 7.17.0
diff --git a/example/itest/pom.xml b/example/itest/pom.xml
index 76c54c57..206b9590 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.6
+ 1.2.7
camunda-bpm-data-integration-test
diff --git a/example/pom.xml b/example/pom.xml
index 939ac333..214d07e7 100644
--- a/example/pom.xml
+++ b/example/pom.xml
@@ -6,7 +6,7 @@
io.holunda.data
camunda-bpm-data-parent
- 1.2.6
+ 1.2.7
io.holunda.data.example
@@ -15,7 +15,7 @@
pom
- 1.6.7
+ 1.6.9
true
true
true
diff --git a/example/spin-type-detector/pom.xml b/example/spin-type-detector/pom.xml
index 55342e0e..132f43c2 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.6
+ 1.2.7
camunda-bpm-data-spin-type-detector
diff --git a/extension/core/pom.xml b/extension/core/pom.xml
index 593d3b61..09d9f026 100644
--- a/extension/core/pom.xml
+++ b/extension/core/pom.xml
@@ -6,7 +6,7 @@
io.holunda.data
camunda-bpm-data-parent
- 1.2.6
+ 1.2.7
../../pom.xml
diff --git a/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/basic/ReadAdapterLockedExternalTask.java b/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/basic/ReadAdapterLockedExternalTask.java
index ccab48c2..1455864e 100644
--- a/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/basic/ReadAdapterLockedExternalTask.java
+++ b/extension/core/src/main/java/io/holunda/camunda/bpm/data/adapter/basic/ReadAdapterLockedExternalTask.java
@@ -1,7 +1,6 @@
package io.holunda.camunda.bpm.data.adapter.basic;
import io.holunda.camunda.bpm.data.adapter.ReadAdapter;
-import io.holunda.camunda.bpm.data.adapter.VariableNotFoundException;
import org.camunda.bpm.engine.externaltask.LockedExternalTask;
import java.util.Optional;
@@ -14,24 +13,21 @@
@SuppressWarnings("java:S1192")
public class ReadAdapterLockedExternalTask implements ReadAdapter {
- private final LockedExternalTask lockedExternalTask;
- private final String variableName;
+ private final ReadAdapter readAdapter;
- public ReadAdapterLockedExternalTask(LockedExternalTask lockedExternalTask, String variableName) {
- this.lockedExternalTask = lockedExternalTask;
- this.variableName = variableName;
+ public ReadAdapterLockedExternalTask(LockedExternalTask lockedExternalTask, String variableName, Class clazz) {
+ readAdapter = new ReadWriteAdapterVariableMap<>(lockedExternalTask.getVariables(), variableName, clazz);
}
@Override
public T get() {
- return getOptional().orElseThrow(() -> new VariableNotFoundException("Couldn't find required variable '" + variableName + "'"));
+ return readAdapter.get();
}
@Override
@SuppressWarnings("unchecked")
public Optional getOptional() {
- return (Optional) Optional.ofNullable(lockedExternalTask.getVariables())
- .map(it -> it.get(variableName));
+ return readAdapter.getOptional();
}
@Override
@@ -46,7 +42,7 @@ public Optional getLocalOptional() {
@Override
public T getOrDefault(T defaultValue) {
- return getOptional().orElse(defaultValue);
+ return readAdapter.getOrDefault(defaultValue);
}
@Override
@@ -56,7 +52,7 @@ public T getLocalOrDefault(T defaultValue) {
@Override
public T getOrNull() {
- return getOptional().orElse(null);
+ return readAdapter.getOrNull();
}
@Override
diff --git a/extension/core/src/main/java/io/holunda/camunda/bpm/data/factory/BasicVariableFactory.java b/extension/core/src/main/java/io/holunda/camunda/bpm/data/factory/BasicVariableFactory.java
index 2ba9538d..e5be4858 100644
--- a/extension/core/src/main/java/io/holunda/camunda/bpm/data/factory/BasicVariableFactory.java
+++ b/extension/core/src/main/java/io/holunda/camunda/bpm/data/factory/BasicVariableFactory.java
@@ -94,7 +94,7 @@ public ReadAdapter from(CaseService caseService, String caseExecutionId) {
@Override
public ReadAdapter from(LockedExternalTask lockedExternalTask) {
- return new ReadAdapterLockedExternalTask<>(lockedExternalTask, name);
+ return new ReadAdapterLockedExternalTask<>(lockedExternalTask, name, clazz);
}
/**
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 e9d1b039..46b41472 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
@@ -10,11 +10,13 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.UUID;
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 io.holunda.camunda.bpm.data.CamundaBpmData.uuidVariable;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -24,12 +26,14 @@
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