Skip to content

Commit

Permalink
Merge branch 'release/1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
zambrovski committed Jun 25, 2020
2 parents 51c56f5 + ac2fe4b commit 1496869
Show file tree
Hide file tree
Showing 45 changed files with 780 additions and 345 deletions.
2 changes: 1 addition & 1 deletion docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.data</groupId>
<artifactId>camunda-bpm-data-parent</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<artifactId>camunda-bpm-data-docs</artifactId>
Expand Down
9 changes: 9 additions & 0 deletions docs/src/orchid/resources/changelog/1.0/1.0.1.ad
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
version: 1.0.0
---

== Bugfixes

* Completed JavaDoc and Sources for the `càmunda-bpm-data` parts written in Kotlin (ACL, Guards).
* Improved test coverage for factories
* Separated `LocalVariableWriter` from `GlobalVariableWriter` interface.
6 changes: 3 additions & 3 deletions docs/src/orchid/resources/pages/quick-start.ad
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@ In Apache Maven add to your `pom.xml`:
<dependency>
<groupId>io.holunda.data</groupId>
<artifactId>camunda-bpm-data</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</dependency>
----

For Gradle Kotlin DSL add to your `build.gradle`:
[source,kotlin]
----
implementation("io.holunda.data:camunda-bpm-data:1.0.0")
implementation("io.holunda.data:camunda-bpm-data:1.0.1")
----

For Gradle Groovy DSL add to your `build.gradle`:
[source,groovy]
----
implementation 'io.holunda.data:camunda-bpm-data:1.0.0'
implementation 'io.holunda.data:camunda-bpm-data:1.0.1'
----

=== Declare process variable factories
Expand Down
2 changes: 1 addition & 1 deletion docs/src/orchid/resources/wiki/user-guide/features.ad
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ title: Features
- The adapter works for all types supported by Camunda BPM. This includes primitive types, object and container types ( `List<T>`, `Set<T>`, `Map<K , V>` ).
- The adapter supports global / local variables.
- The adapter support transient variables.
- Fluent API helper are available in order to set, remove or update multiple variables in the same context (`VariableMapBuilder`, `VariableReader` and `VariableWriter`).
- Fluent API helper are available in order to set, remove or update multiple variables in the same context (`VariableMapBuilder`, `VariableReader` and `GlobalVariableWriter`).
* Process Variable Guards
- Generic support for `VariableGuard` for evaluation of a list of `VariableCondition`s
- Condition to check if variable exists.
Expand Down
4 changes: 2 additions & 2 deletions example/example-java/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.data.example</groupId>
<artifactId>camunda-bpm-data-example-parent</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<artifactId>camunda-bpm-data-example-java</artifactId>
Expand All @@ -24,7 +24,7 @@
<dependency>
<groupId>io.holunda.data.example</groupId>
<artifactId>camunda-bpm-data-spin-type-detector</artifactId>
<version>${project.version}</version>
<version>${project.parent.version}</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public void register() {
@Test
public void shouldDeploy() {
// empty method body checks deployment
assertTrue(true);
}

@Test
Expand Down
8 changes: 2 additions & 6 deletions example/example-kotlin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.data.example</groupId>
<artifactId>camunda-bpm-data-example-parent</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<artifactId>camunda-bpm-data-example-kotlin</artifactId>
Expand All @@ -24,6 +24,7 @@
<dependency>
<groupId>io.holunda.data.example</groupId>
<artifactId>camunda-bpm-data-spin-type-detector</artifactId>
<version>${project.parent.version}</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -132,7 +133,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

</dependencies>

<build>
Expand All @@ -149,10 +149,6 @@
<groupId>com.tngtech.jgiven</groupId>
<artifactId>jgiven-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

Expand Down
7 changes: 1 addition & 6 deletions example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.data</groupId>
<artifactId>camunda-bpm-data-parent</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<groupId>io.holunda.data.example</groupId>
Expand Down Expand Up @@ -42,11 +42,6 @@
<scope>test</scope>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.holunda.data.example</groupId>
<artifactId>camunda-bpm-data-spin-type-detector</artifactId>
<version>${project.version}</version>
</dependency>

<!-- CAMUNDA SPRING BOOT -->
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion example/spin-type-detector/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.data.example</groupId>
<artifactId>camunda-bpm-data-example-parent</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
</parent>

<artifactId>camunda-bpm-data-spin-type-detector</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion extension/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.data</groupId>
<artifactId>camunda-bpm-data-parent</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<relativePath>../..</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@
import io.holunda.camunda.bpm.data.reader.VariableMapReader;
import io.holunda.camunda.bpm.data.reader.VariableReader;
import io.holunda.camunda.bpm.data.reader.VariableScopeReader;
import io.holunda.camunda.bpm.data.writer.RuntimeServiceVariableWriter;
import io.holunda.camunda.bpm.data.writer.TaskServiceVariableWriter;
import io.holunda.camunda.bpm.data.writer.VariableMapWriter;
import io.holunda.camunda.bpm.data.writer.VariableScopeWriter;
import io.holunda.camunda.bpm.data.writer.*;

import java.util.Date;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -184,7 +182,7 @@ public static VariableMapBuilder builder() {
* @return new writer
*/
@NotNull
public static VariableMapWriter writer(VariableMap variables) {
public static GlobalVariableWriter<?> writer(VariableMap variables) {
return new VariableMapWriter(variables);
}

Expand All @@ -195,7 +193,7 @@ public static VariableMapWriter writer(VariableMap variables) {
* @return new writer working on provided variable scope.
*/
@NotNull
public static VariableScopeWriter writer(VariableScope variableScope) {
public static VariableWriter<?> writer(VariableScope variableScope) {
return new VariableScopeWriter(variableScope);
}

Expand All @@ -207,7 +205,7 @@ public static VariableScopeWriter writer(VariableScope variableScope) {
* @return new writer working on provided process execution.
*/
@NotNull
public static RuntimeServiceVariableWriter writer(RuntimeService runtimeService, String executionId) {
public static VariableWriter<?> writer(RuntimeService runtimeService, String executionId) {
return new RuntimeServiceVariableWriter(runtimeService, executionId);
}

Expand All @@ -219,7 +217,7 @@ public static RuntimeServiceVariableWriter writer(RuntimeService runtimeService,
* @return new writer working on provided user task.
*/
@NotNull
public static TaskServiceVariableWriter writer(TaskService taskService, String taskId) {
public static VariableWriter<?> writer(TaskService taskService, String taskId) {
return new TaskServiceVariableWriter(taskService, taskId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import io.holunda.camunda.bpm.data.factory.VariableFactory;
import io.holunda.camunda.bpm.data.writer.VariableMapWriter;
import java.util.Collections;
import java.util.Objects;

import org.camunda.bpm.engine.variable.VariableMap;
import org.camunda.bpm.engine.variable.Variables;
import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -51,10 +53,26 @@ public <T> VariableMapBuilder set(VariableFactory<T> variableFactory, T value, b
}

/**
* Creates the variable map.
* @return instance of {@link VariableMap} containing set values
*/
@NotNull
public VariableMap build() {
return Variables.fromMap(Collections.unmodifiableMap(writer.variables()));
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

VariableMapBuilder that = (VariableMapBuilder) o;

return Objects.equals(writer, that.writer);
}

@Override
public int hashCode() {
return writer != null ? writer.hashCode() : 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public ReadAdapter<T> from(TaskService taskService, String taskId) {
*
* @return adapter builder.
*/
public RuntimeServiceAdapterBuilder<T> using(RuntimeService runtimeService) {
return new RuntimeServiceAdapterBuilder<>(this, runtimeService);
public BasicRuntimeServiceAdapterBuilder<T> using(RuntimeService runtimeService) {
return new BasicRuntimeServiceAdapterBuilder<>(this, runtimeService);
}

/**
Expand All @@ -96,8 +96,8 @@ public RuntimeServiceAdapterBuilder<T> using(RuntimeService runtimeService) {
*
* @return adapter builder.
*/
public TaskServiceAdapterBuilder<T> using(TaskService taskService) {
return new TaskServiceAdapterBuilder<>(this, taskService);
public BasicTaskServiceAdapterBuilder<T> using(TaskService taskService) {
return new BasicTaskServiceAdapterBuilder<>(this, taskService);
}

@Override
Expand Down Expand Up @@ -138,4 +138,95 @@ public String toString() {
", clazz=" + clazz +
'}';
}

/**
* Creates a builder to encapsulate the runtime service access.
*
* @param <T> type of builder.
*/
public static class BasicRuntimeServiceAdapterBuilder<T> {

private final RuntimeService runtimeService;
private final BasicVariableFactory<T> basicVariableFactory;

/**
* Constructs the builder.
*
* @param basicVariableFactory variable factory to use.
* @param runtimeService task service to build adapter with.
*/
public BasicRuntimeServiceAdapterBuilder(BasicVariableFactory<T> basicVariableFactory, RuntimeService runtimeService) {
this.runtimeService = runtimeService;
this.basicVariableFactory = basicVariableFactory;
}

/**
* Creates a write adapter on execution.
*
* @param executionId id identifying execution.
*
* @return write adapter
*/
public WriteAdapter<T> on(String executionId) {
return new ReadWriteAdapterRuntimeService<>(runtimeService, executionId, basicVariableFactory.getName(), basicVariableFactory.getVariableClass());
}

/**
* Creates a read adapter on execution.
*
* @param executionId id identifying execution.
*
* @return read adapter.
*/
public ReadAdapter<T> from(String executionId) {
return new ReadWriteAdapterRuntimeService<>(runtimeService, executionId, basicVariableFactory.getName(), basicVariableFactory.getVariableClass());
}
}

/**
* Creates a builder to encapsulate the task service access.
*
* @param <T> type of builder.
*/
public static class BasicTaskServiceAdapterBuilder<T> {

private final TaskService taskService;
private final BasicVariableFactory<T> basicVariableFactory;

/**
* Constructs the builder.
*
* @param basicVariableFactory variable factory to use.
* @param taskService task service to build adapter with.
*/
public BasicTaskServiceAdapterBuilder(BasicVariableFactory<T> basicVariableFactory, TaskService taskService) {
this.taskService = taskService;
this.basicVariableFactory = basicVariableFactory;
}

/**
* Creates a write adapter on task.
*
* @param taskId id identifying task.
*
* @return write adapter
*/
public WriteAdapter<T> on(String taskId) {
return new ReadWriteAdapterTaskService<>(taskService, taskId, basicVariableFactory.getName(), basicVariableFactory.getVariableClass());
}

/**
* Creates a read adapter on task.
*
* @param taskId id identifying task.
*
* @return read adapter.
*/
public ReadAdapter<T> from(String taskId) {
return new ReadWriteAdapterTaskService<>(taskService, taskId, basicVariableFactory.getName(), basicVariableFactory.getVariableClass());
}

}


}
Loading

0 comments on commit 1496869

Please sign in to comment.