Skip to content

Commit

Permalink
Merge branch 'release/3.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
zambrovski committed Apr 14, 2023
2 parents dcfbd1e + cc7f478 commit 1d98bcc
Show file tree
Hide file tree
Showing 66 changed files with 863 additions and 170 deletions.
2 changes: 1 addition & 1 deletion bom/datapool-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
12 changes: 6 additions & 6 deletions bom/parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-root</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand All @@ -18,21 +18,21 @@
<url>https://github.com/holunda-io/camunda-bpm-taskpool/</url>

<properties>
<springboot.version>2.7.7</springboot.version>
<springboot.version>2.7.10</springboot.version>
<camunda-commons-typed-values.version>7.18.0</camunda-commons-typed-values.version>

<axon-bom.version>4.6.3</axon-bom.version>
<axon-bom.version>4.6.6</axon-bom.version>

<axon-kotlin.version>4.7.0</axon-kotlin.version>
<axon-gateway-extension.version>1.1.2</axon-gateway-extension.version>

<awaitability.version>4.2.0</awaitability.version>
<mockito-kotlin.version>4.1.0</mockito-kotlin.version>
<jgiven.version>1.2.5</jgiven.version>
<jgiven-kotlin.version>1.2.5.0</jgiven-kotlin.version>

<pattern.class.itest>**/*ITest.*</pattern.class.itest>
<pattern.package.itest>**/itest/**/*.*</pattern.package.itest>
<jgiven-kotlin.version>1.2.5.0</jgiven-kotlin.version>
</properties>

<modules>
Expand Down Expand Up @@ -302,7 +302,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.8</version>
<version>0.8.9</version>
<executions>
<execution>
<id>pre-unit-test</id>
Expand Down Expand Up @@ -652,7 +652,7 @@
<!-- Install -->
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
2 changes: 1 addition & 1 deletion bom/taskpool-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/bus-jackson/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/datapool/datapool-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-datapool-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
</parent>

<artifactId>polyflow-datapool-api</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/datapool/datapool-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-datapool-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
</parent>

<artifactId>polyflow-datapool-core</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/datapool/datapool-event/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-datapool-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
</parent>

<artifactId>polyflow-datapool-event</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion core/datapool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/taskpool/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/taskpool/taskpool-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-taskpool-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
</parent>

<artifactId>polyflow-taskpool-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.camunda.bpm.engine.variable.value.TypedValue
*/
interface ProcessVariableValue {
val type: ProcessVariableValueType
val value: Any
val value: Any?
}

/**
Expand All @@ -23,7 +23,7 @@ data class TypedValueProcessVariableValue(override val value: TypedValue)
* Implementation of the process variable value, where the value itself is represented by a 'primitive' class.
*/
data class PrimitiveProcessVariableValue(
override val value: Any
override val value: Any?
) : ProcessVariableValue {
override val type: ProcessVariableValueType = ProcessVariableValueType.PRIMITIVE
}
Expand All @@ -46,7 +46,7 @@ enum class ProcessVariableValueType {
*/
TYPE_VALUE,
/**
* Some of the types are native to serialize. These are:
* Some types are native to serialize. These are:
* - Numbers (Integer, Float, Double)
* - Boolean
* - String
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package io.holunda.camunda.taskpool.api.task

import java.util.function.Predicate

/**
* Filter for task commands.
*/
interface EngineTaskCommandFilter : Predicate<EngineTaskCommand> {
/**
* Tests if the task command should be sent.
* @param engineTaskCommand commend to test.
* @return true, if command should be emitted. Defaults to false.
*/
override fun test(engineTaskCommand: EngineTaskCommand): Boolean = false
}
2 changes: 1 addition & 1 deletion core/taskpool/taskpool-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-taskpool-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
</parent>

<artifactId>polyflow-taskpool-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class TaskAggregate() {
private lateinit var id: String
internal lateinit var task: Task

private var deleted = false
private var completed = false
internal var deleted = false
internal var completed = false

/**
* This a non-static handler for create command.
Expand Down Expand Up @@ -277,5 +277,4 @@ class TaskAggregate() {
fun on(event: TaskDeletedEngineEvent) {
this.deleted = true
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package io.holunda.polyflow.taskpool.core.task

import io.holunda.camunda.taskpool.api.task.CreateTaskCommand
import io.holunda.camunda.taskpool.api.task.EngineTaskCommand
import io.holunda.camunda.taskpool.api.task.EngineTaskCommandFilter
import io.holunda.polyflow.taskpool.core.loadOptional
import org.axonframework.eventsourcing.EventSourcingRepository
import org.axonframework.messaging.GenericMessage
import org.axonframework.messaging.unitofwork.DefaultUnitOfWork
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
import org.springframework.stereotype.Component

/**
* Filter checking the tasks in the event store.
*/
@Component
@ConditionalOnProperty(
prefix = "polyflow.integration.collector.camunda.task.importer",
name = ["task-filter-type"],
havingValue = "eventstore",
matchIfMissing = false
)
class TaskAggregateEngineTaskCommandFilter(
private val eventSourcingRepository: EventSourcingRepository<TaskAggregate>
) : EngineTaskCommandFilter {

override fun test(engineTaskCommand: EngineTaskCommand): Boolean {
return when (engineTaskCommand) {

is CreateTaskCommand -> {

DefaultUnitOfWork.startAndGet(GenericMessage.asMessage(engineTaskCommand)).executeWithResult {
eventSourcingRepository.loadOptional(engineTaskCommand.id)
.map { false } // if the task exists, the CreateCommand should not be emitted
.orElse(true) // if the task doesn't exist, emit the CreateTaskCommand
}.payload

}

else -> false // reject all others
}
}
}
2 changes: 1 addition & 1 deletion core/taskpool/taskpool-event/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-taskpool-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
</parent>

<artifactId>polyflow-taskpool-event</artifactId>
Expand Down
79 changes: 65 additions & 14 deletions docs/reference-guide/components/camunda-taskpool-collector.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Taskpool Collector is a component deployed as a part of the process application
(aside with Camunda BPM Engine) that is responsible for collecting information from
the Camunda BPM Engine. It detects the _intent_ of the operations executed inside the engine
and creates the corresponding commands for the Taskpool. The commands are enriched with data and transmitted to
other taskpool components (via Command Bus).
other Taskpool components (via Command Bus).

In the following description, we use the terms _event_ and _command_. Event denotes an entity
received from Camunda BPM Engine (from delegate event listener or from history event listener)
Expand Down Expand Up @@ -55,7 +55,7 @@ In order to enable collector component, include the Maven dependency to your pro

```

Then activate the taskpool collector by providing the annotation on any Spring Configuration:
Then activate the Taskpool collector by providing the annotation on any Spring Configuration:

```java
@Configuration
Expand Down Expand Up @@ -236,16 +236,67 @@ and the process reaches the task `task_approve_request`, the task will get the f

> Please note that the logger root hierarchy is `io.holunda.polyflow.taskpool.collector`
| Message Code | Severity | Logger* | Description | Meaning |
|------------------|----------|:----------------------|:----------------------------------------------------------------------------------------------------------------------------|:--------|
| `COLLECTOR-001` | `INFO` | | Task commands will be collected. | |
| `COLLECTOR-002` | `INFO` | | Task commands not be collected. | |
| `COLLECTOR-005` | `TRACE` | `.process.definition` | Sending process definition command: $command | |
| `COLLECTOR-006` | `TRACE` | `.process.instance` | Sending process instance command: $command | |
| `COLLECTOR-007` | `TRACE` | `.process.variable` | Sending process variable command: $command | |
| `COLLECTOR-008` | `TRACE` | `.task` | Sending engine task command: $command. | |
| `ENRICHER-001` | `INFO` | | Task commands will be enriched with process variables. | |
| `ENRICHER-002` | `INFO` | | Task commands will not be enriched. | |
| `ENRICHER-003` | `INFO` | | Task commands will be enriched by a custom enricher. | |
| `ENRICHER-004` | `DEBUG` | `.task.enricher` | Could not enrich variables from running execution ${command.sourceReference.executionId}, since it doesn't exist (anymore). | |
| Message Code | Severity | Logger* | Description | Meaning |
|------------------|----------|:----------------------|:----------------------------------------------------------------------------------------------------------------------------|:---------|
| `COLLECTOR-001` | `INFO` | | Task commands will be collected. | |
| `COLLECTOR-002` | `INFO` | | Task commands not be collected. | |
| `COLLECTOR-005` | `TRACE` | `.process.definition` | Sending process definition command: $command | |
| `COLLECTOR-006` | `TRACE` | `.process.instance` | Sending process instance command: $command | |
| `COLLECTOR-007` | `TRACE` | `.process.variable` | Sending process variable command: $command | |
| `COLLECTOR-008` | `TRACE` | `.task` | Sending engine task command: $command. | |
| `ENRICHER-001` | `INFO` | | Task commands will be enriched with process variables. | |
| `ENRICHER-002` | `INFO` | | Task commands will not be enriched. | |
| `ENRICHER-003` | `INFO` | | Task commands will be enriched by a custom enricher. | |
| `ENRICHER-004` | `DEBUG` | `.task.enricher` | Could not enrich variables from running execution ${command.sourceReference.executionId}, since it doesn't exist (anymore). | |

### Task Assignment

User task assignment is a core functionality for every process application fostering task oriented work. By default, Taskpool Collector uses
information from Camunda User Task and maps that one-to-one to properties of the user task commands. The task attribute
`assignee`, `candidateUsers` and `candidateGroups` are mapped to the corresponding attributes automatically.

To control the task assignment mode you can configure taskpool collector using application properties. The property
`polyflow.integration.collector.camunda.task.assigner.type` has the following values:

* `no`: No additional assignment takes place, the Camunda task attributes are used (default)
* `process-variables`: Use process variables for assignment information, see below
* `custom`: User provides own implementation implementing a bean implementing `TaskAssigner` interface.

If the value is set to `process-variables`, you can set up a constant mapping defining the process variables carrying the assignment
information. The corresponding properties are:

```yaml
polyflow:
integration:
collector:
camunda:
task:
assigner:
type: process-variables
assignee: my-assignee-var
candidateUsers: my-candidate-users-var
candidateGroup: my-candidate-group-var
```
### Task Importer
Alongside with the event-based Task Collector based on Camunda Eventing, there exists a dedicated service which can query Camunda database for existing
user tasks and publish the results. In order to avoid duplications in tasks, the collected tasks are filtered by a special filter. Currently, you may choose
between the supplied `eventstore` filter or supply your own `custom` filter by providing your own implementation of a `EngineTaskCommandFilter` interface as
a Spring Bean. If you want to use this task importer facility, you need to activate it first in your application configuration.

The following property block is used for configuration:

```yaml
polyflow:
integration:
collector:
camunda:
task:
importer:
enabled: true
task-filter-type: eventstore
```

By doing so, the `TaskServiceCollectorService` Bean is made available and can be used to trigger the import. The `eventstore` filter is useful in scenarios,
in which the [Taskpool Core](./core-taskpool) is deployed on together with Taskpool Collector as part of the Process Application.
4 changes: 2 additions & 2 deletions integration/camunda-bpm/engine-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-integration-camunda-bpm-engine-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
</parent>

<artifactId>polyflow-camunda-bpm-engine-client</artifactId>
Expand All @@ -22,7 +22,7 @@
<exclusions>
<exclusion>
<groupId>org.axonframework</groupId>
<artifactId>axon-server-conector</artifactId>
<artifactId>axon-server-connector</artifactId>
</exclusion>
</exclusions>
</dependency>
Expand Down
2 changes: 1 addition & 1 deletion integration/camunda-bpm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
<relativePath>../../bom/parent/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion integration/camunda-bpm/springboot-autoconfigure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-integration-camunda-bpm-engine-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
</parent>

<artifactId>polyflow-camunda-bpm-springboot-autoconfigure</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion integration/camunda-bpm/springboot-starter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.holunda.polyflow</groupId>
<artifactId>polyflow-integration-camunda-bpm-engine-parent</artifactId>
<version>3.8.2</version>
<version>3.9.0</version>
</parent>

<artifactId>polyflow-camunda-bpm-springboot-starter</artifactId>
Expand Down
Loading

0 comments on commit 1d98bcc

Please sign in to comment.