Skip to content

Commit ba5ce93

Browse files
committed
Merge branch 'release/0.4.4'
2 parents a32e315 + 4bb3bee commit ba5ce93

File tree

23 files changed

+142
-24
lines changed

23 files changed

+142
-24
lines changed

.github/workflows/development.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ on:
1313
- '*/*' # matches every branch containing a single '/'
1414
- '**' # matches every branch
1515
- '!master'
16+
workflow_dispatch:
17+
inputs:
18+
skip_tests:
19+
description: "Skip tests?"
20+
required: true
21+
default: "false"
22+
type: choice
23+
options:
24+
- "true"
25+
- "false"
1626

1727
jobs:
1828
build:
@@ -34,13 +44,31 @@ jobs:
3444
distribution: 'zulu'
3545
cache: maven
3646

47+
- name: Determine if Tests Should Be Skipped
48+
id: check_skip_tests
49+
run: |
50+
if [[ "${{ github.ref }}" == "refs/heads/skip-tests" ]]; then
51+
echo "SKIP_TESTS=true" >> $GITHUB_ENV
52+
elif [[ "${{ github.event.head_commit.message }}" == *"[skip-tests]"* ]]; then
53+
echo "SKIP_TESTS=true" >> $GITHUB_ENV
54+
elif [[ "${{ github.event.inputs.skip_tests }}" == "true" ]]; then
55+
echo "SKIP_TESTS=true" >> $GITHUB_ENV
56+
else
57+
echo "SKIP_TESTS=false" >> $GITHUB_ENV
58+
fi
59+
3760
# Prepare
3861
- name: Prepare Maven Wrapper
3962
run: chmod +x ./mvnw
4063

4164
# Build
4265
- name: Build with Maven
43-
run: ./mvnw clean verify -U -B -ntp -T4
66+
run: |
67+
if [[ "$SKIP_TESTS" == "true" ]]; then
68+
./mvnw clean verify -U -B -ntp -T4 -DskipTests
69+
else
70+
./mvnw clean verify -U -B -ntp -T4
71+
fi
4472
4573
- name: Upload coverage to Codecov
4674
if: github.event_name == 'push' && github.actor != 'dependabot[bot]'

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>0.4.3</version>
7+
<version>0.4.4</version>
88
</parent>
99

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

bom/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>0.4.3</version>
7+
<version>0.4.4</version>
88
</parent>
99

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

engine-adapter/adapter-commons-spring-boot-starter/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>0.4.3</version>
8+
<version>0.4.4</version>
99
<relativePath>../../pom.xml</relativePath>
1010
</parent>
1111

engine-adapter/adapter-commons/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>0.4.3</version>
8+
<version>0.4.4</version>
99
<relativePath>../../pom.xml</relativePath>
1010
</parent>
1111

engine-adapter/adapter-testing/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>dev.bpm-crafters.process-engine-api</groupId>
88
<artifactId>process-engine-api-root</artifactId>
9-
<version>0.4.3</version>
9+
<version>0.4.4</version>
1010
<relativePath>../../pom.xml</relativePath>
1111
</parent>
1212

engine-adapter/camunda-platform-7-embedded-core/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>0.4.3</version>
8+
<version>0.4.4</version>
99
<relativePath>../../pom.xml</relativePath>
1010
</parent>
1111

engine-adapter/camunda-platform-7-embedded-core/src/main/kotlin/dev/bpmcrafters/processengineapi/adapter/c7/embedded/task/delivery/pull/CachingProcessDefinitionKeyResolver.kt

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@ package dev.bpmcrafters.processengineapi.adapter.c7.embedded.task.delivery.pull
22

33
import org.camunda.bpm.engine.RepositoryService
44

5+
/**
6+
* Simple in-memory caching resolver for process definition for a given process definition id.
7+
*/
58
data class CachingProcessDefinitionKeyResolver(
69
val repositoryService: RepositoryService,
7-
private val keys: MutableMap<String, String> = mutableMapOf()
10+
private val keys: MutableMap<String, String> = mutableMapOf(),
11+
private val versionTags: MutableMap<String, String> = mutableMapOf()
812
) {
913

1014
/**
@@ -25,4 +29,24 @@ data class CachingProcessDefinitionKeyResolver(
2529
}
2630
}
2731
}
32+
33+
/**
34+
* Resolves process definition version tag from repository service and uses an in-mem cache.
35+
* @param processDefinitionId process definition id.
36+
* @return corresponding version tag.
37+
*/
38+
fun getProcessDefinitionVersionTag(processDefinitionId: String?): String? {
39+
return if (processDefinitionId == null) {
40+
null
41+
} else {
42+
return versionTags.getOrPut(processDefinitionId) {
43+
repositoryService
44+
.createProcessDefinitionQuery()
45+
.processDefinitionId(processDefinitionId)
46+
.singleResult()
47+
.versionTag
48+
}
49+
}
50+
}
51+
2852
}

engine-adapter/camunda-platform-7-embedded-core/src/main/kotlin/dev/bpmcrafters/processengineapi/adapter/c7/embedded/task/delivery/pull/EmbeddedPullUserTaskDelivery.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class EmbeddedPullUserTaskDelivery(
3434
* Delivers all tasks found in user task service to corresponding subscriptions.
3535
*/
3636
override fun refresh() {
37-
val subscriptions = subscriptionRepository.getTaskSubscriptions()
37+
val subscriptions = subscriptionRepository.getTaskSubscriptions().filter { s -> s.taskType == TaskType.USER }
3838
if (subscriptions.isNotEmpty()) {
3939
logger.trace { "PROCESS-ENGINE-C7-EMBEDDED-036: pulling user tasks for subscriptions: $subscriptions" }
4040
taskService
@@ -85,6 +85,8 @@ class EmbeddedPullUserTaskDelivery(
8585
CommonRestrictions.TENANT_ID -> it.value == task.tenantId
8686
CommonRestrictions.PROCESS_INSTANCE_ID -> it.value == task.processInstanceId
8787
CommonRestrictions.PROCESS_DEFINITION_ID -> it.value == task.processDefinitionId
88+
CommonRestrictions.PROCESS_DEFINITION_KEY -> it.value == cachingProcessDefinitionKeyResolver.getProcessDefinitionKey(task.processDefinitionId)
89+
CommonRestrictions.PROCESS_DEFINITION_VERSION_TAG -> it.value == cachingProcessDefinitionKeyResolver.getProcessDefinitionVersionTag(task.processDefinitionId)
8890
else -> false
8991
}
9092
}

engine-adapter/camunda-platform-7-embedded-spring-boot-starter/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>0.4.3</version>
8+
<version>0.4.4</version>
99
<relativePath>../../pom.xml</relativePath>
1010
</parent>
1111

0 commit comments

Comments
 (0)