Skip to content

Commit f471ace

Browse files
committed
Merge branch 'release/1.3'
2 parents 413fe1a + 5d68b86 commit f471ace

17 files changed

Lines changed: 610 additions & 32 deletions

File tree

.github/workflows/development.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
- name: Set up JDK
4444
uses: actions/setup-java@v4
4545
with:
46-
java-version: 17
46+
java-version-file: .java-version
4747
distribution: 'zulu'
4848
cache: maven
4949

.github/workflows/master.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Produces and releases artifacts
22

33
permissions:
44
contents: read
5-
5+
66
on:
77
push:
88
branches:
@@ -20,10 +20,10 @@ jobs:
2020
- name: Set up JDK
2121
uses: actions/setup-java@v4
2222
with:
23-
java-version: 17
23+
java-version-file: .java-version
2424
distribution: 'zulu'
2525
cache: maven
26-
server-id: ossrh
26+
server-id: central
2727
server-username: OSS_CENTRAL_USERNAME # env variable for Maven Central
2828
server-password: OSS_CENTRAL_PASSWORD # env variable for Maven Central
2929

.github/workflows/release-notes.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Milestone Closure
22

33
permissions:
4-
contents: read
4+
contents: write
55

66
on:
77
milestone:

README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Process Engine API
22

33

4-
[![incubating](https://img.shields.io/badge/lifecycle-INCUBATING-orange.svg)](https://github.com/holisticon#open-source-lifecycle)
4+
[![stable](https://img.shields.io/badge/lifecycle-STABLE-green.svg)](https://github.com/holisticon#open-source-lifecycle)
55
[![Development branches](https://github.com/bpm-crafters/process-engine-api/actions/workflows/development.yml/badge.svg)](https://github.com/bpm-crafters/process-engine-api/actions/workflows/development.yml)
6-
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.bpm-crafters.process-engine-api/process-engine-api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.bpm-crafters.process-engine-api/process-engine-api)
6+
[![Maven Central Version](https://img.shields.io/maven-central/v/dev.bpm-crafters.process-engine-api/process-engine-api)](https://central.sonatype.com/namespace/dev.bpm-crafters.process-engine-api)
77

88
## Purpose of the library
99

@@ -22,6 +22,7 @@ The API consists of different parts independent of each other.
2222
- Signal API
2323
- Task Subscription API
2424
- User Task Completion API
25+
- User Task Modification API
2526
- Service Task Completion API
2627

2728
## Helpful Components
@@ -33,12 +34,8 @@ The API consists of different parts independent of each other.
3334
If you want to try the API, please refer to one of the adapter implementations matching your infrastructure. For example:
3435

3536
- [Camunda Platform 7 Adapter](https://github.com/bpm-crafters/process-engine-adapters-camunda-7) [![Maven Central Version](https://img.shields.io/maven-central/v/dev.bpm-crafters.process-engine-adapters/process-engine-adapter-camunda-platform-c7-bom?color=#2cc657)](https://maven-badges.herokuapp.com/maven-central/dev.bpm-crafters.process-engine-adapters/process-engine-adapter-camunda-platform-c7-bom)
36-
37-
3837
- [Camunda Platform 8 Adapter](https://github.com/bpm-crafters/process-engine-adapters-camunda-8) [![Maven Central Version](https://img.shields.io/maven-central/v/dev.bpm-crafters.process-engine-adapters/process-engine-adapter-camunda-platform-c8-bom?color=#2cc657)](https://maven-badges.herokuapp.com/maven-central/dev.bpm-crafters.process-engine-adapters/process-engine-adapter-camunda-platform-c8-bom)
3938

40-
41-
4239
## Process Engine Worker
4340

4441
If you are using the Process Engine API to provide workers using Spring Boot, there is a library with improved support for it:
@@ -58,4 +55,3 @@ The library contains of the following Maven modules:
5855
If you are missing a feature or found a bug, please [open an issue](https://github.com/bpm-crafters/process-engine-api/issues)
5956
on this project and provide a pull request. If you have general questions, make sure to stop by our [discussions](https://github.com/orgs/bpm-crafters/discussions).
6057

61-

api-impl/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>dev.bpm-crafters.process-engine-api</groupId>
77
<artifactId>process-engine-api-root</artifactId>
8-
<version>1.2</version>
8+
<version>1.3</version>
99
<relativePath>../pom.xml</relativePath>
1010
</parent>
1111

api/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<parent>
55
<groupId>dev.bpm-crafters.process-engine-api</groupId>
66
<artifactId>process-engine-api-root</artifactId>
7-
<version>1.2</version>
7+
<version>1.3</version>
88
</parent>
99

1010
<artifactId>process-engine-api</artifactId>

api/src/main/kotlin/dev/bpmcrafters/processengineapi/correlation/Correlation.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ package dev.bpmcrafters.processengineapi.correlation
66
*/
77
data class Correlation private constructor(
88
/**
9-
* Correlation key.
9+
* Correlation key. The value provided during correlation needs to match the value hold by the instance.
1010
*/
1111
val correlationKey: String,
1212
/**
13-
* If the engine is not supporting the correlation by key, defines the name of the local variable used to access correlation.
13+
* If the engine is not supporting the correlation by key, defines the name of the local (to the receive task or event) variable holding the value of the key.
1414
*/
1515
val correlationVariable: String = "correlationKey"
1616
) {
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
package dev.bpmcrafters.processengineapi.task
2+
3+
/**
4+
* Change assignment of the task command.
5+
* @since 1.3
6+
*/
7+
abstract class ChangeAssignmentModifyTaskCmd(
8+
/**
9+
* Unique task id.
10+
*/
11+
override val taskId: String,
12+
) : ModifyTaskCmd {
13+
14+
/**
15+
* Set a new assignee.
16+
* @since 1.3
17+
*/
18+
class AssignTaskCmd(
19+
override val taskId: String,
20+
val assignee: String,
21+
): ChangeAssignmentModifyTaskCmd(taskId)
22+
23+
/**
24+
* Set new assignee to none.
25+
* @since 1.3
26+
*/
27+
class UnassignTaskCmd(
28+
override val taskId: String
29+
): ChangeAssignmentModifyTaskCmd(taskId)
30+
31+
/**
32+
* Add candidate group to the list.
33+
* @since 1.3
34+
*/
35+
class AddCandidateGroupTaskCmd(
36+
override val taskId: String,
37+
val candidateGroup: String,
38+
): ChangeAssignmentModifyTaskCmd(taskId)
39+
40+
/**
41+
* Add candidate user to the list.
42+
* @since 1.3
43+
*/
44+
class AddCandidateUserTaskCmd(
45+
override val taskId: String,
46+
val candidateUser: String,
47+
): ChangeAssignmentModifyTaskCmd(taskId)
48+
49+
/**
50+
* Remove candidate group from the list.
51+
* @since 1.3
52+
*/
53+
class RemoveCandidateGroupTaskCmd(
54+
override val taskId: String,
55+
val candidateGroup: String,
56+
): ChangeAssignmentModifyTaskCmd(taskId)
57+
58+
/**
59+
* Remove candidate user from the list.
60+
* @since 1.3
61+
*/
62+
class RemoveCandidateUserTaskCmd(
63+
override val taskId: String,
64+
val candidateUser: String,
65+
): ChangeAssignmentModifyTaskCmd(taskId)
66+
67+
/**
68+
* Set (=replace) the list of candidate groups.
69+
* @since 1.3
70+
*/
71+
class SetCandidateGroupsTaskCmd(
72+
override val taskId: String,
73+
val candidateGroups: List<String>,
74+
): ChangeAssignmentModifyTaskCmd(taskId)
75+
76+
/**
77+
* Set (=replace) the list of candidate users.
78+
* @since 1.3
79+
*/
80+
class SetCandidateUsersTaskCmd(
81+
override val taskId: String,
82+
val candidateUsers: List<String>,
83+
): ChangeAssignmentModifyTaskCmd(taskId)
84+
85+
/**
86+
* Clear the list of candidate users.
87+
* @since 1.3
88+
*/
89+
class ClearCandidateUsersTaskCmd(
90+
override val taskId: String,
91+
): ChangeAssignmentModifyTaskCmd(taskId)
92+
93+
/**
94+
* Clear the list of candidate groups.
95+
* @since 1.3
96+
*/
97+
class ClearCandidateGroupsTaskCmd(
98+
override val taskId: String,
99+
): ChangeAssignmentModifyTaskCmd(taskId)
100+
101+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
package dev.bpmcrafters.processengineapi.task
2+
3+
import dev.bpmcrafters.processengineapi.PayloadSupplier
4+
import java.util.function.Supplier
5+
6+
/**
7+
* Change payload of the task command.
8+
* @since 1.3
9+
*/
10+
abstract class ChangePayloadModifyTaskCmd(
11+
/**
12+
* Unique task id.
13+
*/
14+
override val taskId: String,
15+
) : ModifyTaskCmd {
16+
17+
/**
18+
* Sets payload for the task.
19+
* @since 1.3
20+
*/
21+
class UpdatePayloadTaskCmd(
22+
override val taskId: String,
23+
/**
24+
* Payload supplier.
25+
*/
26+
private val payloadSupplier: PayloadSupplier
27+
) : ChangePayloadModifyTaskCmd(
28+
taskId = taskId,
29+
), PayloadSupplier by payloadSupplier {
30+
/**
31+
* Constructs a change payload command by task id and payload.
32+
* @param taskId id of the task to modify.
33+
* @param payload payload to use.
34+
*/
35+
constructor(taskId: String, payload: Map<String, Any>) : this(
36+
taskId = taskId,
37+
payloadSupplier = PayloadSupplier { payload },
38+
)
39+
}
40+
41+
/**
42+
* Deletes parts of the payload of the task.
43+
* @since 1.3
44+
*/
45+
class DeletePayloadTaskCmd(
46+
override val taskId: String,
47+
/**
48+
* List of keys to delete.
49+
*/
50+
val payloadKeysSupplier: Supplier<List<String>>
51+
) : ChangePayloadModifyTaskCmd(
52+
taskId = taskId
53+
), Supplier<List<String>> by payloadKeysSupplier {
54+
/**
55+
* Constructs a delete payload command by task id and payload keys.
56+
* @param taskId id of the task to modify.
57+
* @param payloadKeys payload keys to delete.
58+
*/
59+
constructor(taskId: String, payloadKeys: List<String>) : this(
60+
taskId = taskId,
61+
payloadKeysSupplier = Supplier { payloadKeys }
62+
)
63+
}
64+
65+
/**
66+
* Clears the payload of the task.
67+
* @since 1.3
68+
*/
69+
class ClearPayloadTaskCmd(
70+
override val taskId: String,
71+
) : ChangePayloadModifyTaskCmd(
72+
taskId = taskId
73+
)
74+
75+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package dev.bpmcrafters.processengineapi.task
2+
3+
/**
4+
* Composite modification command to perform multiple modifications on a single task.
5+
* @since 1.3
6+
*/
7+
class CompositeModifyTaskCmd(
8+
override val taskId: String,
9+
val commands: List<ModifyTaskCmd>
10+
) : ModifyTaskCmd {
11+
12+
init {
13+
require(commands.all { it.taskId == this.taskId }) { "All nested commands must have the same taskId." }
14+
}
15+
}

0 commit comments

Comments
 (0)