Skip to content

Commit

Permalink
Merge branch 'release/3.11.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
zambrovski committed May 5, 2023
2 parents 2cd93da + 0a00349 commit 4a613b9
Show file tree
Hide file tree
Showing 40 changed files with 302 additions and 104 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.10.0</version>
<version>3.11.0</version>
<relativePath>../parent/pom.xml</relativePath>
</parent>

Expand Down
6 changes: 3 additions & 3 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.10.0</version>
<version>3.11.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

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

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

<axon-bom.version>4.6.6</axon-bom.version>
Expand Down Expand Up @@ -306,7 +306,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.9</version>
<version>0.8.10</version>
<executions>
<execution>
<id>pre-unit-test</id>
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.10.0</version>
<version>3.11.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.10.0</version>
<version>3.11.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.10.0</version>
<version>3.11.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.10.0</version>
<version>3.11.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.10.0</version>
<version>3.11.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.10.0</version>
<version>3.11.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.10.0</version>
<version>3.11.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.10.0</version>
<version>3.11.0</version>
</parent>

<artifactId>polyflow-taskpool-api</artifactId>
Expand Down
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.10.0</version>
<version>3.11.0</version>
</parent>

<artifactId>polyflow-taskpool-core</artifactId>
Expand Down
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.10.0</version>
<version>3.11.0</version>
</parent>

<artifactId>polyflow-taskpool-event</artifactId>
Expand Down
35 changes: 29 additions & 6 deletions docs/reference-guide/components/camunda-taskpool-collector.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ received from Camunda BPM Engine (from delegate event listener or from history e
which is passed over to the Taskpool Collector using internal **Spring eventing** mechanism. The Taskpool
Collector converts the series of such events into a Taskpool Command - an entity carrying an intent
of change inside the Taskpool core. Please note that _event_ has another meaning in CQRS/ES systems
and other components of the Taskpool, but in the context of Taskpool collector an event always originates from
and other components of the Taskpool, but in the context of Taskpool Collector an event always originates from
Spring eventing.

### Features
Expand All @@ -25,6 +25,7 @@ Spring eventing.
- Collection of process variable change events
- Collection of task events and history events
- Creation of task engine commands
- Collection of tasks assignment information
- Enrichment of task engine commands with process variables
- Attachment of correlation information to task engine commands
- Transmission of commands to Axon command bus
Expand Down Expand Up @@ -55,7 +56,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 All @@ -68,7 +69,7 @@ class MyProcessApplicationConfiguration {

### Event collection

Taskpool Collector registers Spring Event Listener to the following events, fired by Camunda Eventing Engine Plugin:
By default, Taskpool Collector registers Spring Event Listener to the following events, fired by Camunda Eventing Engine Plugin:

* `DelegateTask` events:
** create
Expand All @@ -86,6 +87,22 @@ The events are transformed into corresponding commands and passed over to the pr
is fired using custom listeners only and polyflow components don't rely on that but rather on own implementation of built-in (unskippable) listeners.
For this purpose, it is important to disable Camunda Platform custom listeners by setting `camunda.bpm.eventing.task` property to `false`.

During collection of task information, you can control which listeners are registered. By default, all listeners are considered but you can change
this behaviour by setting values of two properties:

```yaml

polyflow:
integration:
collector:
camunda:
task:
excludedTaskEventNames: assignment, delete
excludedHistoryEventNames: add-identity-link, delete-identity-link
```
This particular setting is helpful, if you want to disable assignment in the engine entirely and want to provide you own custom task assignment algorithm or
use assignment based on process variables (see below for more details).
### Task commands enrichment
Alongside with attributes received from the Camunda BPM engine, the engine task commands
Expand Down Expand Up @@ -126,7 +143,7 @@ A `VariableFilter` can be of the following type:
Here is an example, how the process variable filter can configure the enrichment:

```java
@Configuration
@Configuration
public class MyTaskCollectorConfiguration {
@Bean
Expand Down Expand Up @@ -168,6 +185,12 @@ public class MyTaskCollectorConfiguration {
If you want to implement a custom enrichment, please provide your own implementation of the interface `VariablesEnricher`
(register a Spring Component of the type) and set the property `polyflow.integration.collector.camunda.task.enricher.type` to `custom`.

!!! warning
Avoid using a classic Camunda `TaskListener` which modifies process variables on task creation, since changes of those
listeners can't be used during task enrichment. A proper way to modify instance or task variables is to implement an ordered Spring
`EventListener` listening on `DelegateTask`, put it before the enricher by providing `@Order(TaskEventCollectorService.ORDER - 80)` and scope the event listener to
the task of your interest using condition: `@EventListener(condition = "#delegateTask.taskDefinitionKey.equals('my-task-key') && #delegateTask.eventName.equals('create')")`

### Data Correlation

Apart from task payload attached by the enricher, the so-called _Correlation_ with data entries can
Expand Down Expand Up @@ -251,11 +274,11 @@ and the process reaches the task `task_approve_request`, the task will get the f

### Task Assignment

User task assignment is a core functionality for every process application fostering task oriented work. By default, Taskpool Collector uses
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
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)
Expand Down
2 changes: 1 addition & 1 deletion 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.10.0</version>
<version>3.11.0</version>
</parent>

<artifactId>polyflow-camunda-bpm-engine-client</artifactId>
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.10.0</version>
<version>3.11.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.10.0</version>
<version>3.11.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.10.0</version>
<version>3.11.0</version>
</parent>

<artifactId>polyflow-camunda-bpm-springboot-starter</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion integration/camunda-bpm/taskpool-collector/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.10.0</version>
<version>3.11.0</version>
</parent>

<artifactId>polyflow-camunda-bpm-taskpool-collector</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.holunda.polyflow.taskpool.collector

import io.holunda.polyflow.taskpool.collector.task.assigner.ProcessVariableTaskAssignerMapping
import org.camunda.bpm.engine.delegate.TaskListener
import org.springframework.beans.factory.annotation.Value
import org.springframework.boot.context.properties.ConfigurationProperties
import org.springframework.boot.context.properties.ConstructorBinding
Expand Down Expand Up @@ -69,9 +70,33 @@ data class CamundaTaskCollectorProperties(
* Properties of task importer.
*/
@NestedConfigurationProperty
val importer: TaskImporterProperties = TaskImporterProperties()
val importer: TaskImporterProperties = TaskImporterProperties(),

)
/**
* List of task events to be excluded from collector. Defaults to empty list, so all events are collected.
* Possible values are constants defined in [TaskListener].
*/
val excludedTaskEventNames: List<String> = listOf(),

/**
* List of history events to restrict (HistoricTaskInstanceEventEntity, HistoricIdentityLinkLogEventEntity). Defaults to empty list, so all events are collected.
* Possible values are constants defined in [HistoryEventTypes] + "update".
*/
val excludedHistoryEventNames: List<String> = listOf()
) {
/**
* Determines if the provided event name should be collected.
* @param eventName event name to check.
* @return true if not excluded.
*/
fun collectTaskEvent(eventName: String): Boolean = !excludedTaskEventNames.contains(eventName)
/**
* Determines if the provided event name should be collected.
* @param eventName event name to check.
* @return true if not excluded.
*/
fun collectHistoryEvent(eventName: String): Boolean = !excludedHistoryEventNames.contains(eventName)
}

/**
* Process variable properties.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class TaskCollectorConfiguration(
/**
* Constructs the task collector service responsible for collecting Camunda Spring events and building commands out of them.
*/
@Bean
@Bean(TaskEventCollectorService.NAME)
fun taskEventCollectorService(repositoryService: RepositoryService) = TaskEventCollectorService(
camundaTaskpoolCollectorProperties = camundaTaskpoolCollectorProperties,
repositoryService = repositoryService
Expand Down
Loading

0 comments on commit 4a613b9

Please sign in to comment.