From 0cb21101b920eb42b47626f3320a7870debce45a Mon Sep 17 00:00:00 2001 From: Simon Zambrovski Date: Mon, 1 Jul 2024 14:08:06 +0200 Subject: [PATCH 01/19] Update for next development version --- bom/datapool-dependencies/pom.xml | 2 +- bom/parent/pom.xml | 2 +- bom/taskpool-dependencies/pom.xml | 2 +- core/bus-jackson/pom.xml | 2 +- core/datapool/datapool-api/pom.xml | 2 +- core/datapool/datapool-core/pom.xml | 2 +- core/datapool/datapool-event/pom.xml | 2 +- core/datapool/pom.xml | 2 +- core/spring-utils/pom.xml | 2 +- core/taskpool/pom.xml | 2 +- core/taskpool/taskpool-api/pom.xml | 2 +- core/taskpool/taskpool-core/pom.xml | 2 +- core/taskpool/taskpool-event/pom.xml | 2 +- integration/camunda-bpm/engine-client/pom.xml | 2 +- integration/camunda-bpm/pom.xml | 2 +- integration/camunda-bpm/springboot-autoconfigure/pom.xml | 2 +- integration/camunda-bpm/springboot-starter/pom.xml | 2 +- integration/camunda-bpm/taskpool-collector/pom.xml | 2 +- integration/camunda-bpm/taskpool-job-sender/pom.xml | 2 +- integration/common/datapool-sender/pom.xml | 2 +- integration/common/pom.xml | 2 +- integration/common/tasklist-url-resolver/pom.xml | 2 +- integration/common/taskpool-sender/pom.xml | 2 +- integration/common/variable-serializer/pom.xml | 2 +- pom.xml | 2 +- view/form-url-resolver/pom.xml | 2 +- view/jpa/pom.xml | 2 +- view/mongo/pom.xml | 2 +- view/pom.xml | 2 +- view/simple/pom.xml | 2 +- view/view-api-client/pom.xml | 2 +- view/view-api/pom.xml | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/bom/datapool-dependencies/pom.xml b/bom/datapool-dependencies/pom.xml index 752228684..3e71177c7 100644 --- a/bom/datapool-dependencies/pom.xml +++ b/bom/datapool-dependencies/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.0 + 4.2.1-SNAPSHOT ../parent/pom.xml diff --git a/bom/parent/pom.xml b/bom/parent/pom.xml index 372fda354..bc1ec2644 100644 --- a/bom/parent/pom.xml +++ b/bom/parent/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-root - 4.2.0 + 4.2.1-SNAPSHOT ../../pom.xml diff --git a/bom/taskpool-dependencies/pom.xml b/bom/taskpool-dependencies/pom.xml index a8899a999..cdda7b16b 100644 --- a/bom/taskpool-dependencies/pom.xml +++ b/bom/taskpool-dependencies/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.0 + 4.2.1-SNAPSHOT ../parent/pom.xml diff --git a/core/bus-jackson/pom.xml b/core/bus-jackson/pom.xml index 5df9566c5..ea094fdb7 100755 --- a/core/bus-jackson/pom.xml +++ b/core/bus-jackson/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.0 + 4.2.1-SNAPSHOT ../../bom/parent/pom.xml diff --git a/core/datapool/datapool-api/pom.xml b/core/datapool/datapool-api/pom.xml index 1a82d5ece..634a7cfa6 100755 --- a/core/datapool/datapool-api/pom.xml +++ b/core/datapool/datapool-api/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-datapool-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-datapool-api diff --git a/core/datapool/datapool-core/pom.xml b/core/datapool/datapool-core/pom.xml index 253dede0f..57054fdab 100644 --- a/core/datapool/datapool-core/pom.xml +++ b/core/datapool/datapool-core/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-datapool-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-datapool-core diff --git a/core/datapool/datapool-event/pom.xml b/core/datapool/datapool-event/pom.xml index 2d01870c6..9432e1a3c 100755 --- a/core/datapool/datapool-event/pom.xml +++ b/core/datapool/datapool-event/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-datapool-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-datapool-event diff --git a/core/datapool/pom.xml b/core/datapool/pom.xml index 593e93d5d..5f5a676b7 100755 --- a/core/datapool/pom.xml +++ b/core/datapool/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.0 + 4.2.1-SNAPSHOT ../../bom/parent/pom.xml diff --git a/core/spring-utils/pom.xml b/core/spring-utils/pom.xml index d92185d16..cadef8d12 100755 --- a/core/spring-utils/pom.xml +++ b/core/spring-utils/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.0 + 4.2.1-SNAPSHOT ../../bom/parent/pom.xml diff --git a/core/taskpool/pom.xml b/core/taskpool/pom.xml index 0137c4866..5d150288a 100755 --- a/core/taskpool/pom.xml +++ b/core/taskpool/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.0 + 4.2.1-SNAPSHOT ../../bom/parent/pom.xml diff --git a/core/taskpool/taskpool-api/pom.xml b/core/taskpool/taskpool-api/pom.xml index dfee6e55c..2534e400c 100755 --- a/core/taskpool/taskpool-api/pom.xml +++ b/core/taskpool/taskpool-api/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-taskpool-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-taskpool-api diff --git a/core/taskpool/taskpool-core/pom.xml b/core/taskpool/taskpool-core/pom.xml index ad4bc2753..7dedb3f7b 100755 --- a/core/taskpool/taskpool-core/pom.xml +++ b/core/taskpool/taskpool-core/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-taskpool-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-taskpool-core diff --git a/core/taskpool/taskpool-event/pom.xml b/core/taskpool/taskpool-event/pom.xml index 5052dd443..f61d24f6b 100644 --- a/core/taskpool/taskpool-event/pom.xml +++ b/core/taskpool/taskpool-event/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-taskpool-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-taskpool-event diff --git a/integration/camunda-bpm/engine-client/pom.xml b/integration/camunda-bpm/engine-client/pom.xml index 15b304011..078f2a4f5 100644 --- a/integration/camunda-bpm/engine-client/pom.xml +++ b/integration/camunda-bpm/engine-client/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-integration-camunda-bpm-engine-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-camunda-bpm-engine-client diff --git a/integration/camunda-bpm/pom.xml b/integration/camunda-bpm/pom.xml index e5b430dbe..61b9f657e 100644 --- a/integration/camunda-bpm/pom.xml +++ b/integration/camunda-bpm/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.0 + 4.2.1-SNAPSHOT ../../bom/parent/pom.xml diff --git a/integration/camunda-bpm/springboot-autoconfigure/pom.xml b/integration/camunda-bpm/springboot-autoconfigure/pom.xml index 30646e3fa..1579f0707 100755 --- a/integration/camunda-bpm/springboot-autoconfigure/pom.xml +++ b/integration/camunda-bpm/springboot-autoconfigure/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-camunda-bpm-engine-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-camunda-bpm-springboot-autoconfigure diff --git a/integration/camunda-bpm/springboot-starter/pom.xml b/integration/camunda-bpm/springboot-starter/pom.xml index 0fd4fd802..e7bd8c498 100755 --- a/integration/camunda-bpm/springboot-starter/pom.xml +++ b/integration/camunda-bpm/springboot-starter/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-camunda-bpm-engine-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-camunda-bpm-springboot-starter diff --git a/integration/camunda-bpm/taskpool-collector/pom.xml b/integration/camunda-bpm/taskpool-collector/pom.xml index 9fe3ce864..ec53d4d24 100755 --- a/integration/camunda-bpm/taskpool-collector/pom.xml +++ b/integration/camunda-bpm/taskpool-collector/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-camunda-bpm-engine-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-camunda-bpm-taskpool-collector diff --git a/integration/camunda-bpm/taskpool-job-sender/pom.xml b/integration/camunda-bpm/taskpool-job-sender/pom.xml index 46f9776f3..793cb990d 100755 --- a/integration/camunda-bpm/taskpool-job-sender/pom.xml +++ b/integration/camunda-bpm/taskpool-job-sender/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-camunda-bpm-engine-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-camunda-bpm-taskpool-job-sender diff --git a/integration/common/datapool-sender/pom.xml b/integration/common/datapool-sender/pom.xml index 8c3818fc3..921eb4e8d 100755 --- a/integration/common/datapool-sender/pom.xml +++ b/integration/common/datapool-sender/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-common-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-datapool-sender diff --git a/integration/common/pom.xml b/integration/common/pom.xml index d9482f078..bc958fdda 100755 --- a/integration/common/pom.xml +++ b/integration/common/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.0 + 4.2.1-SNAPSHOT ../../bom/parent/pom.xml diff --git a/integration/common/tasklist-url-resolver/pom.xml b/integration/common/tasklist-url-resolver/pom.xml index ddb15eb10..658121e2f 100644 --- a/integration/common/tasklist-url-resolver/pom.xml +++ b/integration/common/tasklist-url-resolver/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-common-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-tasklist-url-resolver diff --git a/integration/common/taskpool-sender/pom.xml b/integration/common/taskpool-sender/pom.xml index bb6e1f963..be46e9579 100755 --- a/integration/common/taskpool-sender/pom.xml +++ b/integration/common/taskpool-sender/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-common-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-taskpool-sender diff --git a/integration/common/variable-serializer/pom.xml b/integration/common/variable-serializer/pom.xml index e4e3f334e..c2ecdd4c7 100755 --- a/integration/common/variable-serializer/pom.xml +++ b/integration/common/variable-serializer/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-common-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-variable-serializer diff --git a/pom.xml b/pom.xml index e16749dac..026b5fde8 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-root - 4.2.0 + 4.2.1-SNAPSHOT pom POM: ${project.artifactId} diff --git a/view/form-url-resolver/pom.xml b/view/form-url-resolver/pom.xml index 6ea885d88..a827624bf 100644 --- a/view/form-url-resolver/pom.xml +++ b/view/form-url-resolver/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-form-url-resolver diff --git a/view/jpa/pom.xml b/view/jpa/pom.xml index d1ef4e0b5..76fc14443 100644 --- a/view/jpa/pom.xml +++ b/view/jpa/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-view-jpa diff --git a/view/mongo/pom.xml b/view/mongo/pom.xml index 6307ea853..d9b471e43 100644 --- a/view/mongo/pom.xml +++ b/view/mongo/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-view-mongo diff --git a/view/pom.xml b/view/pom.xml index 2b08ec2c0..096193568 100644 --- a/view/pom.xml +++ b/view/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.0 + 4.2.1-SNAPSHOT ../bom/parent/pom.xml diff --git a/view/simple/pom.xml b/view/simple/pom.xml index f714e5ff2..5bf75367a 100755 --- a/view/simple/pom.xml +++ b/view/simple/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-view-simple diff --git a/view/view-api-client/pom.xml b/view/view-api-client/pom.xml index 54eaef85a..f153ac496 100755 --- a/view/view-api-client/pom.xml +++ b/view/view-api-client/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-view-api-client diff --git a/view/view-api/pom.xml b/view/view-api/pom.xml index 023c9c34e..113f82476 100755 --- a/view/view-api/pom.xml +++ b/view/view-api/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.2.0 + 4.2.1-SNAPSHOT polyflow-view-api From a6c8bb43418502443a2fb1cd170b6fdae8f86d6d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Jul 2024 16:54:34 +0000 Subject: [PATCH 02/19] Bump org.codehaus.mojo:versions-maven-plugin from 2.16.2 to 2.17.0 Bumps [org.codehaus.mojo:versions-maven-plugin](https://github.com/mojohaus/versions) from 2.16.2 to 2.17.0. - [Release notes](https://github.com/mojohaus/versions/releases) - [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions/compare/2.16.2...2.17.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 026b5fde8..aeffa110e 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ org.codehaus.mojo versions-maven-plugin - 2.16.2 + 2.17.0 false From 781cb01edc6e77bb483f1baf7f27039e8516469c Mon Sep 17 00:00:00 2001 From: Michael von Bargen <37417767+MichaelVonB@users.noreply.github.com> Date: Tue, 9 Jul 2024 09:52:53 +0200 Subject: [PATCH 03/19] fix(#1017): add mapping for correlations to DataEntryUpdatedEvent (#1018) Co-authored-by: Michael von Bargen --- .../polyflow/view/jpa/data/ConverterExt.kt | 2 + .../view/jpa/data/ConverterExtKtTest.kt | 155 +++++++++++++++++- 2 files changed, 154 insertions(+), 3 deletions(-) diff --git a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/data/ConverterExt.kt b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/data/ConverterExt.kt index 94225e34c..ea54a9ec7 100644 --- a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/data/ConverterExt.kt +++ b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/data/ConverterExt.kt @@ -117,6 +117,7 @@ fun DataEntryUpdatedEvent.toEntity( formKey = this.formKey, authorizedPrincipals = AuthorizationChange.applyUserAuthorization(setOf(), this.authorizations).map { user(it).toString() } .plus(AuthorizationChange.applyGroupAuthorization(setOf(), this.authorizations).map { group(it).toString() }).toMutableSet(), + correlations = this.correlations.toMutableMap().map { entry -> DataEntryId(entryType = entry.key, entryId = entry.value.toString()) }.toMutableSet(), revision = if (revisionValue != RevisionValue.NO_REVISION) { revisionValue.revision } else { @@ -144,6 +145,7 @@ fun DataEntryUpdatedEvent.toEntity( this.authorizations ).map { group -> group(group).toString() }) .toMutableSet() + it.correlations = this.correlations.toMutableMap().map { entry -> DataEntryId(entryType = entry.key, entryId = entry.value.toString()) }.toMutableSet() it.revision = if (revisionValue != RevisionValue.NO_REVISION) { revisionValue.revision } else { diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/data/ConverterExtKtTest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/data/ConverterExtKtTest.kt index 6a680a83a..42daa8cc4 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/data/ConverterExtKtTest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/data/ConverterExtKtTest.kt @@ -1,13 +1,17 @@ package io.holunda.polyflow.view.jpa.data +import com.fasterxml.jackson.databind.ObjectMapper import io.holixon.axon.gateway.query.RevisionValue -import io.holunda.camunda.taskpool.api.business.DataEntryAnonymizedEvent -import io.holunda.camunda.taskpool.api.business.Modification +import io.holunda.camunda.taskpool.api.business.* +import io.holunda.polyflow.view.jpa.payload.PayloadAttribute import org.assertj.core.api.Assertions.assertThat import org.assertj.core.groups.Tuple.tuple +import org.camunda.bpm.engine.variable.Variables import org.junit.jupiter.api.Test +import java.time.Instant import java.time.OffsetDateTime +import java.time.temporal.ChronoUnit class ConverterExtKtTest { @Test @@ -42,4 +46,149 @@ class ConverterExtKtTest { assertThat(anonymized.protocol).extracting(ProtocolElement::username) .containsExactly(tuple("ANONYMIZED"), tuple("ANONYMIZED"), tuple("SYSTEM"), tuple("SYSTEM")) } -} \ No newline at end of file + + @Test + fun shouldCreateEntity() { + val objectMapper = ObjectMapper() + val event = DataEntryCreatedEvent( + entryType = "io.holunda.test", + entryId = "id", + type = "type", + applicationName = "applicationName", + name = "name", + correlations = Variables.putValue("io.holunda.test", "id-1"), + payload = Variables.putValue("key", "value"), + description = "description", + state = ProcessingType.IN_PROGRESS.of("IN_CREATION"), + createModification = Modification(time = OffsetDateTime.now(), "Test-User", "Created Event"), + authorizations = listOf(AuthorizationChange.addUser("Test-User")), + formKey = "test-entry-form" + ) + + val entity = event.toEntity(objectMapper, RevisionValue.NO_REVISION, 2, listOf()) + + assertThat(entity.dataEntryId.entryId).isEqualTo("id") + assertThat(entity.dataEntryId.entryType).isEqualTo("io.holunda.test") + assertThat(entity.type).isEqualTo("type") + assertThat(entity.applicationName).isEqualTo("applicationName") + assertThat(entity.name).isEqualTo("name") + assertThat(entity.correlations).containsExactly(DataEntryId("id-1", "io.holunda.test")) + assertThat(entity.payload).isEqualTo("""{"key":"value"}""") + assertThat(entity.payloadAttributes).containsExactly(PayloadAttribute("key", "value")) + assertThat(entity.description).isEqualTo("description") + assertThat(entity.revision).isEqualTo(0L) + assertThat(entity.protocol).hasSize(1) + assertThat(entity.formKey).isEqualTo("test-entry-form") + assertThat(entity.authorizedPrincipals).containsExactly("USER:Test-User") + assertThat(entity.state.processingType).isEqualTo("IN_PROGRESS") + assertThat(entity.state.state).isEqualTo("IN_CREATION") + } + + @Test + fun shouldCreateEntityIfNotPresent() { + val objectMapper = ObjectMapper() + val event = DataEntryUpdatedEvent( + entryType = "io.holunda.test", + entryId = "id", + type = "type", + applicationName = "applicationName", + name = "name", + correlations = Variables.putValue("io.holunda.test", "id-1"), + payload = Variables.putValue("key", "value"), + description = "description", + state = ProcessingType.IN_PROGRESS.of("IN_CREATION"), + updateModification = Modification(time = OffsetDateTime.now(), "Test-User", "Created Event"), + authorizations = listOf(AuthorizationChange.addUser("Test-User")), + formKey = "test-entry-form" + ) + + val entity = event.toEntity( + objectMapper, + RevisionValue.NO_REVISION, + null, + 2, + listOf() + ) + + assertThat(entity.dataEntryId.entryId).isEqualTo("id") + assertThat(entity.dataEntryId.entryType).isEqualTo("io.holunda.test") + assertThat(entity.type).isEqualTo("type") + assertThat(entity.applicationName).isEqualTo("applicationName") + assertThat(entity.name).isEqualTo("name") + assertThat(entity.correlations).containsExactly(DataEntryId("id-1", "io.holunda.test")) + assertThat(entity.payload).isEqualTo("""{"key":"value"}""") + assertThat(entity.payloadAttributes).containsExactly(PayloadAttribute("key", "value")) + assertThat(entity.description).isEqualTo("description") + assertThat(entity.revision).isEqualTo(0L) + assertThat(entity.protocol).hasSize(1) + assertThat(entity.formKey).isEqualTo("test-entry-form") + assertThat(entity.authorizedPrincipals).containsExactly("USER:Test-User") + assertThat(entity.state.processingType).isEqualTo("IN_PROGRESS") + assertThat(entity.state.state).isEqualTo("IN_CREATION") + } + + @Test + fun shouldUpdateEntity() { + val objectMapper = ObjectMapper() + val createdAt = Instant.now().minus(1, ChronoUnit.DAYS) + val existingEntity = DataEntryEntity( + dataEntryId = DataEntryId("id", "io.holunda.test"), + type = "type", + name = "name", + applicationName = "applicationName", + formKey = "test-entry-form", + revision = 0L, + state = DataEntryStateEmbeddable("IN_PROGRESS", "IN_CREATION"), + description = "description", + createdDate = createdAt, + lastModifiedDate = createdAt, + deletedDate = null, + authorizedPrincipals = mutableSetOf("USER:Test-User"), + payloadAttributes = mutableSetOf(PayloadAttribute("key", "value")), + protocol = mutableListOf(), + payload = """{"key":"value"}""", + correlations = mutableSetOf(DataEntryId("id-1","io.holunda.test", )), + ) + + existingEntity.protocol.add(ProtocolElement(state = DataEntryStateEmbeddable("IN_PROGRESS", "IN_CREATION"), logMessage = "Created Event", dataEntry = existingEntity, username = "Test-User")) + + val event = DataEntryUpdatedEvent( + entryType = "io.holunda.test", + entryId = "id", + type = "type", + applicationName = "applicationName", + name = "name", + correlations = Variables.putValue("io.holunda.test", "id-2"), + payload = Variables.putValue("key", "value").putValue("key-1", "value-1"), + description = "description", + state = ProcessingType.IN_PROGRESS.of("IN_CREATION"), + updateModification = Modification(time = OffsetDateTime.now(), "Test-User", "Created Event"), + authorizations = listOf(AuthorizationChange.addGroup("Test-Group"), AuthorizationChange.addUser("Test-User-1"), AuthorizationChange.removeUser("Test-User")), + formKey = "test-entry-form" + ) + + val entity = event.toEntity( + objectMapper, + RevisionValue.NO_REVISION, + null, + 2, + listOf() + ) + + assertThat(entity.dataEntryId.entryId).isEqualTo("id") + assertThat(entity.dataEntryId.entryType).isEqualTo("io.holunda.test") + assertThat(entity.type).isEqualTo("type") + assertThat(entity.applicationName).isEqualTo("applicationName") + assertThat(entity.name).isEqualTo("name") + assertThat(entity.correlations).containsExactlyInAnyOrder(DataEntryId("id-2", "io.holunda.test")) + assertThat(entity.payload).isEqualTo("""{"key-1":"value-1","key":"value"}""") + assertThat(entity.payloadAttributes).containsExactlyInAnyOrder(PayloadAttribute("key-1", "value-1"), PayloadAttribute("key", "value")) + assertThat(entity.description).isEqualTo("description") + assertThat(entity.revision).isEqualTo(0L) + assertThat(entity.protocol).hasSize(1) + assertThat(entity.formKey).isEqualTo("test-entry-form") + assertThat(entity.authorizedPrincipals).containsExactlyInAnyOrder("GROUP:Test-Group", "USER:Test-User-1") + assertThat(entity.state.processingType).isEqualTo("IN_PROGRESS") + assertThat(entity.state.state).isEqualTo("IN_CREATION") + } +} From de1b07af50c95bbb197b7dcc48e2081a018de901 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jul 2024 16:34:24 +0000 Subject: [PATCH 04/19] Bump org.mockito.kotlin:mockito-kotlin from 5.3.1 to 5.4.0 Bumps [org.mockito.kotlin:mockito-kotlin](https://github.com/mockito/mockito-kotlin) from 5.3.1 to 5.4.0. - [Release notes](https://github.com/mockito/mockito-kotlin/releases) - [Commits](https://github.com/mockito/mockito-kotlin/compare/5.3.1...5.4.0) --- updated-dependencies: - dependency-name: org.mockito.kotlin:mockito-kotlin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- bom/parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/parent/pom.xml b/bom/parent/pom.xml index bc1ec2644..c5ded1c25 100644 --- a/bom/parent/pom.xml +++ b/bom/parent/pom.xml @@ -26,7 +26,7 @@ 2.1.0 4.2.1 - 5.3.1 + 5.4.0 1.3.1 1.3.1.0 From f6793b429bca68276b23a7faec3638d0812432a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 Jul 2024 16:47:54 +0000 Subject: [PATCH 05/19] Bump com.microsoft.sqlserver:mssql-jdbc Bumps [com.microsoft.sqlserver:mssql-jdbc](https://github.com/Microsoft/mssql-jdbc) from 12.7.0.jre11-preview to 12.7.1.jre11-preview. - [Release notes](https://github.com/Microsoft/mssql-jdbc/releases) - [Changelog](https://github.com/microsoft/mssql-jdbc/blob/main/CHANGELOG.md) - [Commits](https://github.com/Microsoft/mssql-jdbc/commits) --- updated-dependencies: - dependency-name: com.microsoft.sqlserver:mssql-jdbc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- view/jpa/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/jpa/pom.xml b/view/jpa/pom.xml index 76fc14443..1b57bc9a3 100644 --- a/view/jpa/pom.xml +++ b/view/jpa/pom.xml @@ -238,7 +238,7 @@ com.microsoft.sqlserver mssql-jdbc - 12.7.0.jre11-preview + 12.7.1.jre11-preview org.postgresql From 05792e3fef51cc1a78ccd9ba45114ba526f2e293 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:26:22 +0000 Subject: [PATCH 06/19] Bump org.apache.maven.plugins:maven-failsafe-plugin from 3.3.0 to 3.3.1 Bumps [org.apache.maven.plugins:maven-failsafe-plugin](https://github.com/apache/maven-surefire) from 3.3.0 to 3.3.1. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.3.0...surefire-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-failsafe-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- bom/parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/parent/pom.xml b/bom/parent/pom.xml index bc1ec2644..ea4c6e324 100644 --- a/bom/parent/pom.xml +++ b/bom/parent/pom.xml @@ -540,7 +540,7 @@ org.apache.maven.plugins maven-failsafe-plugin - 3.3.0 + 3.3.1 From 5a51250f1f2dd29f150233b739db314439d7d335 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 Jul 2024 16:26:28 +0000 Subject: [PATCH 07/19] Bump org.apache.maven.plugins:maven-surefire-plugin from 3.3.0 to 3.3.1 Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.3.0 to 3.3.1. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.3.0...surefire-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- bom/parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/parent/pom.xml b/bom/parent/pom.xml index bc1ec2644..821a6ac05 100644 --- a/bom/parent/pom.xml +++ b/bom/parent/pom.xml @@ -519,7 +519,7 @@ maven-surefire-plugin - 3.3.0 + 3.3.1 false random From ab161dac3579047f48daef131c5604884edf1494 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:50:40 +0000 Subject: [PATCH 08/19] chore(deps): bump org.codehaus.mojo:versions-maven-plugin Bumps [org.codehaus.mojo:versions-maven-plugin](https://github.com/mojohaus/versions) from 2.17.0 to 2.17.1. - [Release notes](https://github.com/mojohaus/versions/releases) - [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions/compare/2.17.0...2.17.1) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index aeffa110e..52545e4a1 100644 --- a/pom.xml +++ b/pom.xml @@ -66,7 +66,7 @@ org.codehaus.mojo versions-maven-plugin - 2.17.0 + 2.17.1 false From c69e53cf9446efc743e1672911300475c2215023 Mon Sep 17 00:00:00 2001 From: Michael von Bargen <37417767+MichaelVonB@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:58:07 +0200 Subject: [PATCH 09/19] fix(#1031): Don't delete task correlations on task update events (#1032) * fix(#1031): update existing entity instead of creating new one - Prevent hibernate from merging entities - closes #1031 * chore(#1031): add documentation to public function * chore(#1031): adjust import style, update payloadAttributes instead of overwrite --------- Co-authored-by: Michael von Bargen --- .../view/jpa/JpaPolyflowViewTaskService.kt | 19 ++---- .../polyflow/view/jpa/task/ConverterExt.kt | 65 ++++++++----------- .../jpa/JpaPolyflowViewServiceTaskITest.kt | 24 ++++++- .../view/jpa/task/ConverterExtKtTest.kt | 57 ++++++++++++++++ 4 files changed, 112 insertions(+), 53 deletions(-) create mode 100644 view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/task/ConverterExtKtTest.kt diff --git a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewTaskService.kt b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewTaskService.kt index daba37c4c..2ed36ab46 100644 --- a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewTaskService.kt +++ b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewTaskService.kt @@ -12,14 +12,15 @@ import io.holunda.polyflow.view.jpa.auth.AuthorizationPrincipal.Companion.group import io.holunda.polyflow.view.jpa.auth.AuthorizationPrincipal.Companion.user import io.holunda.polyflow.view.jpa.data.DataEntryRepository import io.holunda.polyflow.view.jpa.data.toDataEntry -import io.holunda.polyflow.view.jpa.task.TaskEntity import io.holunda.polyflow.view.jpa.task.TaskRepository +import io.holunda.polyflow.view.jpa.task.TaskEntity +import io.holunda.polyflow.view.jpa.task.toTask +import io.holunda.polyflow.view.jpa.task.update +import io.holunda.polyflow.view.jpa.task.toEntity import io.holunda.polyflow.view.jpa.task.TaskRepository.Companion.hasApplication import io.holunda.polyflow.view.jpa.task.TaskRepository.Companion.isAssignedTo import io.holunda.polyflow.view.jpa.task.TaskRepository.Companion.isAssigneeSet import io.holunda.polyflow.view.jpa.task.TaskRepository.Companion.isAuthorizedFor -import io.holunda.polyflow.view.jpa.task.toEntity -import io.holunda.polyflow.view.jpa.task.toTask import io.holunda.polyflow.view.jpa.update.updateTaskQuery import io.holunda.polyflow.view.query.PageableSortableQuery import io.holunda.polyflow.view.query.task.* @@ -387,22 +388,14 @@ class JpaPolyflowViewTaskService( if (isDisabledByProperty()) { return } - taskRepository .findById(event.id) .ifEmpty { logger.warn { "Cannot update task '${event.id}' because it does not exist in the database" } } .ifPresent { entity -> - - val updated = taskRepository.save( - event.toEntity( - objectMapper, - entity, - polyflowJpaViewProperties.payloadAttributeLevelLimit, - polyflowJpaViewProperties.taskJsonPathFilters() - ) - ) + entity.update(event, objectMapper, polyflowJpaViewProperties.payloadAttributeLevelLimit, polyflowJpaViewProperties.taskJsonPathFilters()) + val updated = taskRepository.save(entity) emitTaskUpdate(updated) } } diff --git a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/task/ConverterExt.kt b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/task/ConverterExt.kt index 118aba02c..6a60ef5b5 100644 --- a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/task/ConverterExt.kt +++ b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/task/ConverterExt.kt @@ -13,7 +13,7 @@ import io.holunda.polyflow.view.jpa.payload.PayloadAttribute import io.holunda.polyflow.view.jpa.process.toSourceReference import io.holunda.polyflow.view.jpa.process.toSourceReferenceEmbeddable import org.camunda.bpm.engine.variable.VariableMap -import org.camunda.bpm.engine.variable.Variables.createVariables +import org.camunda.bpm.engine.variable.Variables import java.time.Instant @@ -47,44 +47,31 @@ fun TaskCreatedEngineEvent.toEntity( ) /** - * Update event to entity. + * Applies a TaskAttributeUpdatedEngineEvent update to an existing TaskEntity */ -fun TaskAttributeUpdatedEngineEvent.toEntity( - objectMapper: ObjectMapper, - oldEntity: TaskEntity, - limit: Int, - filters: List> -) = TaskEntity( - taskId = this.id, - taskDefinitionKey = this.taskDefinitionKey, - sourceReference = this.sourceReference.toSourceReferenceEmbeddable(), - authorizedPrincipals = oldEntity.authorizedPrincipals, - assignee = oldEntity.assignee, - name = this.name ?: oldEntity.name, - priority = this.priority ?: oldEntity.priority, - correlations = if (this.correlations.isNotEmpty()) { - this.correlations.map { entry -> DataEntryId(entryType = entry.key, entryId = "${entry.value}") }.toMutableSet() - } else { - oldEntity.correlations - }, - payload = if (this.payload.isNotEmpty()) { - this.payload.toPayloadJson(objectMapper) - } else { - oldEntity.payload - }, - payloadAttributes = if (this.payload.isNotEmpty()) { - this.payload.toJsonPathsWithValues(limit, filters).map { attr -> PayloadAttribute(attr) }.toMutableSet() - } else { - oldEntity.payloadAttributes - }, - businessKey = this.businessKey ?: oldEntity.businessKey, - description = this.description ?: oldEntity.description, - formKey = oldEntity.formKey, - createdDate = oldEntity.createdDate, - followUpDate = this.followUpDate?.toInstant() ?: oldEntity.followUpDate, - dueDate = this.dueDate?.toInstant() ?: oldEntity.dueDate, - owner = this.owner ?: oldEntity.owner -) +fun TaskEntity.update(event: TaskAttributeUpdatedEngineEvent, + objectMapper: ObjectMapper, + limit: Int, + filters: List>) { + this.taskDefinitionKey = event.taskDefinitionKey + this.sourceReference = event.sourceReference.toSourceReferenceEmbeddable() + this.name = event.name ?: this.name + this.priority = event.priority ?: this.priority + if (event.correlations.isNotEmpty()) { + this.correlations.clear() + this.correlations.addAll(event.correlations.map { entry -> DataEntryId(entryType = entry.key, entryId = "${entry.value}") }) + } + if (event.payload.isNotEmpty()) { + this.payload = event.payload.toPayloadJson(objectMapper) + this.payloadAttributes.clear() + this.payloadAttributes.addAll(event.payload.toJsonPathsWithValues(limit, filters).map { attr -> PayloadAttribute(attr) }.toMutableSet()) + } + businessKey = event.businessKey ?: this.businessKey + description = event.description ?: this.description + followUpDate = event.followUpDate?.toInstant() ?: this.followUpDate + dueDate = event.dueDate?.toInstant() ?: this.dueDate + owner = event.owner ?: this.owner +} /** * Entity to API DTO. @@ -116,4 +103,4 @@ fun TaskEntity.toTask( /** * Create a variable map from stored data entries list. */ -fun MutableSet.toCorrelations(): VariableMap = createVariables().apply { this@toCorrelations.associate { it.entryType to it.entryId } } +fun MutableSet.toCorrelations(): VariableMap = Variables.fromMap(this.associate { it.entryType to it.entryId }) diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceTaskITest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceTaskITest.kt index 6da80a10f..e5b6e82ff 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceTaskITest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceTaskITest.kt @@ -4,6 +4,7 @@ import com.fasterxml.jackson.databind.ObjectMapper import io.holixon.axon.gateway.query.RevisionValue import io.holunda.camunda.taskpool.api.business.* import io.holunda.camunda.taskpool.api.task.TaskAssignedEngineEvent +import io.holunda.camunda.taskpool.api.task.TaskAttributeUpdatedEngineEvent import io.holunda.camunda.taskpool.api.task.TaskCompletedEngineEvent import io.holunda.camunda.taskpool.api.task.TaskCreatedEngineEvent import io.holunda.camunda.variable.serializer.serialize @@ -15,6 +16,7 @@ import io.holunda.polyflow.view.jpa.process.toSourceReference import io.holunda.polyflow.view.query.data.DataEntriesForUserQuery import io.holunda.polyflow.view.query.task.* import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.data.MapEntry import org.axonframework.messaging.MetaData import org.axonframework.queryhandling.GenericSubscriptionQueryUpdateMessage import org.axonframework.queryhandling.QueryUpdateEmitter @@ -221,6 +223,22 @@ internal class JpaPolyflowViewServiceTaskITest { ), metaData = RevisionValue(revision = 1).toMetaData() ) + + jpaPolyflowViewService.on( + event = TaskAttributeUpdatedEngineEvent( + id = id4, + taskDefinitionKey = "task.def.0815", + name = "task name 4", + priority = 10, + sourceReference = processReference().toSourceReference(), + payload = createVariables().apply { putAll(createPayload("otherValue")) }, + correlations = newCorrelations().apply { + put(dataType1, dataId1) + put(dataType2, dataId2) + }, + businessKey = "business-4", + ), metaData = MetaData.emptyInstance() + ) } @AfterEach @@ -255,6 +273,10 @@ internal class JpaPolyflowViewServiceTaskITest { assertThat(zoro.elements[0].task.name).isEqualTo("task name 4") assertThat(zoro.elements[0].dataEntries).isNotEmpty.hasSize(1) assertThat(zoro.elements[0].dataEntries[0].entryId).isEqualTo(dataId2) + assertThat(zoro.elements[0].task.correlations).containsOnly( + MapEntry.entry("io.polyflow.test1", dataId1), + MapEntry.entry("io.polyflow.test2", dataId2) + ) val strawhats = jpaPolyflowViewService.query(TasksWithDataEntriesForUserQuery(user = User("other", setOf("strawhats")), assignedToMeOnly = false)) assertThat(strawhats.elements).isNotEmpty.hasSize(2) @@ -479,7 +501,7 @@ internal class JpaPolyflowViewServiceTaskITest { @Test fun `query updates are sent`() { captureEmittedQueryUpdates() - assertThat(emittedQueryUpdates).hasSize(36) + assertThat(emittedQueryUpdates).hasSize(41) assertThat(emittedQueryUpdates.filter { it.queryType == TaskForIdQuery::class.java && it.asTask().id == id }).hasSize(2) assertThat(emittedQueryUpdates.filter { it.queryType == TaskForIdQuery::class.java && it.asTask().id == id2 }).hasSize(2) diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/task/ConverterExtKtTest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/task/ConverterExtKtTest.kt new file mode 100644 index 000000000..45e3b8a7a --- /dev/null +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/task/ConverterExtKtTest.kt @@ -0,0 +1,57 @@ +package io.holunda.polyflow.view.jpa.task + +import com.fasterxml.jackson.databind.ObjectMapper +import io.holunda.camunda.taskpool.api.task.ProcessReference +import io.holunda.polyflow.view.jpa.data.DataEntryId +import io.holunda.polyflow.view.jpa.payload.PayloadAttribute +import io.holunda.polyflow.view.jpa.process.toSourceReferenceEmbeddable +import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.data.MapEntry +import org.junit.jupiter.api.Test + +class ConverterExtKtTest { + + @Test + fun `should convert to task`() { + val objectMapper = ObjectMapper() + val entity = TaskEntity( + taskId = "taskId", + taskDefinitionKey = "taskDefinitionKey", + name = "name", + priority = 50, + sourceReference = ProcessReference( + instanceId = "instanceId", + executionId = "executionId", + definitionId = "definitionId", + definitionKey = "definitionKey", + name = "name", + applicationName = "applicationName", + ).toSourceReferenceEmbeddable(), + authorizedPrincipals = mutableSetOf("GROUP:FOO", "GROUP:BAR"), + correlations = mutableSetOf(DataEntryId("1", "foo"), DataEntryId("2", "bar")), + payloadAttributes = mutableSetOf(PayloadAttribute("foo", "bar")), + payload = """ + {"foo": "bar" } + """.trimIndent(), + formKey = "formKey", + ) + + val task = entity.toTask(objectMapper) + + assertThat(task.id).isEqualTo("taskId") + assertThat(task.taskDefinitionKey).isEqualTo("taskDefinitionKey") + assertThat(task.name).isEqualTo("name") + assertThat(task.priority).isEqualTo(50) + assertThat(task.sourceReference.instanceId).isEqualTo("instanceId") + assertThat(task.sourceReference.executionId).isEqualTo("executionId") + assertThat(task.sourceReference.definitionId).isEqualTo("definitionId") + assertThat(task.sourceReference.definitionKey).isEqualTo("definitionKey") + assertThat(task.sourceReference.name).isEqualTo("name") + assertThat(task.sourceReference.applicationName).isEqualTo("applicationName") + assertThat(task.candidateGroups).containsExactlyInAnyOrder("FOO", "BAR") + assertThat(task.correlations).containsOnly(MapEntry.entry("bar", "2"), MapEntry.entry("foo", "1")) + assertThat(task.payload).containsOnly(MapEntry.entry("foo", "bar")) + assertThat(task.formKey).isEqualTo("formKey") + + } +} From ada31e522f85b90ba7015696a6a204c5d5e3281b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:58:39 +0200 Subject: [PATCH 10/19] chore(deps): bump io.projectreactor.kotlin:reactor-kotlin-extensions (#1035) Bumps [io.projectreactor.kotlin:reactor-kotlin-extensions](https://github.com/reactor/reactor-kotlin-extensions) from 1.2.2 to 1.2.3. - [Release notes](https://github.com/reactor/reactor-kotlin-extensions/releases) - [Commits](https://github.com/reactor/reactor-kotlin-extensions/compare/v1.2.2...v1.2.3) --- updated-dependencies: - dependency-name: io.projectreactor.kotlin:reactor-kotlin-extensions dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- view/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/pom.xml b/view/pom.xml index 096193568..1763bfb73 100644 --- a/view/pom.xml +++ b/view/pom.xml @@ -17,7 +17,7 @@ 4.5 - 1.2.2 + 1.2.3 From cb521a520c8944eb03978a30f55d989095a1f791 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:58:55 +0200 Subject: [PATCH 11/19] chore(deps): bump kotlin.version from 2.0.0 to 2.0.10 (#1029) Bumps `kotlin.version` from 2.0.0 to 2.0.10. Updates `org.jetbrains.kotlin:kotlin-bom` from 2.0.0 to 2.0.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.0...v2.0.10) Updates `org.jetbrains.kotlin:kotlin-test-junit` from 2.0.0 to 2.0.10 - [Release notes](https://github.com/JetBrains/kotlin/releases) - [Changelog](https://github.com/JetBrains/kotlin/blob/master/ChangeLog.md) - [Commits](https://github.com/JetBrains/kotlin/compare/v2.0.0...v2.0.10) Updates `org.jetbrains.kotlin:kotlin-maven-allopen` from 2.0.0 to 2.0.10 Updates `org.jetbrains.kotlin:kotlin-maven-noarg` from 2.0.0 to 2.0.10 Updates `org.jetbrains.kotlin:kotlin-maven-plugin` from 2.0.0 to 2.0.10 --- updated-dependencies: - dependency-name: org.jetbrains.kotlin:kotlin-bom dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-test-junit dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-maven-allopen dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-maven-noarg dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.jetbrains.kotlin:kotlin-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 52545e4a1..2aa5bcb11 100644 --- a/pom.xml +++ b/pom.xml @@ -19,7 +19,7 @@ 17 ${java.version} - 2.0.0 + 2.0.10 ${java.version} true 3.0.5 From 4faa666049958f343ff56f0b806759880c38eebf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:59:14 +0200 Subject: [PATCH 12/19] chore(deps): bump org.awaitility:awaitility from 4.2.1 to 4.2.2 (#1030) Bumps [org.awaitility:awaitility](https://github.com/awaitility/awaitility) from 4.2.1 to 4.2.2. - [Changelog](https://github.com/awaitility/awaitility/blob/master/changelog.txt) - [Commits](https://github.com/awaitility/awaitility/compare/awaitility-4.2.1...awaitility-4.2.2) --- updated-dependencies: - dependency-name: org.awaitility:awaitility dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- bom/parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/parent/pom.xml b/bom/parent/pom.xml index 202a109a5..f9c0d1252 100644 --- a/bom/parent/pom.xml +++ b/bom/parent/pom.xml @@ -25,7 +25,7 @@ 4.9.0 2.1.0 - 4.2.1 + 4.2.2 5.4.0 1.3.1 1.3.1.0 From d5538e32100a303fbde4f54e8f439e780f4dd855 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 09:59:53 +0200 Subject: [PATCH 13/19] chore(deps): bump org.apache.maven.plugins:maven-gpg-plugin (#1034) Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.4 to 3.2.5. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.4...maven-gpg-plugin-3.2.5) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2aa5bcb11..d94b5937c 100644 --- a/pom.xml +++ b/pom.xml @@ -158,7 +158,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.4 + 3.2.5 From 7bb966f0492001af5c105ef1bc76c3803d271f5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:00:11 +0200 Subject: [PATCH 14/19] chore(deps): bump com.microsoft.sqlserver:mssql-jdbc (#1028) Bumps [com.microsoft.sqlserver:mssql-jdbc](https://github.com/Microsoft/mssql-jdbc) from 12.7.1.jre11-preview to 12.8.0.jre11. - [Release notes](https://github.com/Microsoft/mssql-jdbc/releases) - [Changelog](https://github.com/microsoft/mssql-jdbc/blob/main/CHANGELOG.md) - [Commits](https://github.com/Microsoft/mssql-jdbc/commits) --- updated-dependencies: - dependency-name: com.microsoft.sqlserver:mssql-jdbc dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- view/jpa/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/jpa/pom.xml b/view/jpa/pom.xml index 1b57bc9a3..8a7c1e108 100644 --- a/view/jpa/pom.xml +++ b/view/jpa/pom.xml @@ -238,7 +238,7 @@ com.microsoft.sqlserver mssql-jdbc - 12.7.1.jre11-preview + 12.8.0.jre11 org.postgresql From 3a76f6fa9174d6260ab4c7d9b2fe15e981625b01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:00:30 +0200 Subject: [PATCH 15/19] chore(deps): bump org.axonframework:axon-bom from 4.9.4 to 4.10.0 (#1027) Bumps [org.axonframework:axon-bom](https://github.com/AxonFramework/axon-bom) from 4.9.4 to 4.10.0. - [Release notes](https://github.com/AxonFramework/axon-bom/releases) - [Commits](https://github.com/AxonFramework/axon-bom/compare/axon-4.9.4...axon-4.10.0) --- updated-dependencies: - dependency-name: org.axonframework:axon-bom dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- bom/parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/parent/pom.xml b/bom/parent/pom.xml index f9c0d1252..1b3092a34 100644 --- a/bom/parent/pom.xml +++ b/bom/parent/pom.xml @@ -21,7 +21,7 @@ 3.2.6 7.21.0 - 4.9.4 + 4.10.0 4.9.0 2.1.0 From 8284744b5a2777e9bc72fd9987f9ba088c8d89bd Mon Sep 17 00:00:00 2001 From: Patrick Wunderlich Date: Mon, 19 Aug 2024 10:04:41 +0200 Subject: [PATCH 16/19] Feature/1005 tc tests (#1025) * Add test container support for postgres #1005 * Cleanup and add test flyway scripts for mariadb #1005 * Use name instead of type since for type the value is two times the same. Because of this, id depends on the db how those are sorted. #1005 * Fixed test #1005 * Use mongo with textcontainers in ITests #1005 --- view/jpa/pom.xml | 26 + ...lowViewServiceDataEntryCorrelationITest.kt | 2 +- .../JpaPolyflowViewServiceDataEntryITest.kt | 6 +- ...iewServiceDataEntryRevisionSupportITest.kt | 2 +- ...lyflowViewServiceProcessDefinitionITest.kt | 2 +- ...PolyflowViewServiceProcessInstanceITest.kt | 2 +- .../jpa/JpaPolyflowViewServiceTaskITest.kt | 29 +- .../view/jpa/data/DataEntryRepositoryITest.kt | 2 +- .../jpa/itest/NoToastPostgresSQLDialect.kt | 43 + .../ProcessDefinitionRepositoryITest.kt | 2 +- .../process/ProcessInstanceRepositoryITest.kt | 2 +- .../view/jpa/task/TaskRepositoryITest.kt | 2 +- .../application-itest-tc-mariadb.yaml | 38 + ... => V0_0_10__axon_sequences_per_table.sql} | 0 ...V0_0_11__jpa_view_correlation_payload.sql} | 0 .../V0_0_11__postgres_engine_7.16_to_7.17.sql | 29 - ...0_12__jpa_plf_data_entry_correlations.sql} | 0 .../V0_0_12__postgres_engine_7.17_to_7.18.sql | 34 - ...sql => V0_0_1__postgres_engine_7.21.0.sql} | 39 +- ...l => V0_0_2__postgres_identity_7.21.0.sql} | 0 .../migrations/h2-postgresql/V0_0_5__axon.sql | 4 +- ...0_8__jpa_view.sql => V0_0_7__jpa_view.sql} | 0 .../V0_0_7__postgres_engine_7.14_to_7.15.sql | 37 - ..._10__axon_dlq.sql => V0_0_8__axon_dlq.sql} | 0 ...leted.sql => V0_0_9__polyflow_deleted.sql} | 0 .../V0_0_9__postgres_engine_7.15_to_7.16.sql | 30 - .../V0_0_10__jpa_view_correlation_payload.sql | 6 + ..._0_11__jpa_plf_data_entry_correlations.sql | 23 + .../mariadb/V0_0_1__mariadb_engine_7.21.0.sql | 1393 +++++++++++++++++ .../V0_0_2__mariadb_identity_7.21.0.sql | 104 ++ .../db/migrations/mariadb/V0_0_3__admin.sql | 46 + .../mariadb/V0_0_4__tasklist_filters.sql | 7 + .../db/migrations/mariadb/V0_0_5__axon.sql | 75 + .../db/migrations/mariadb/V0_0_6__request.sql | 9 + .../migrations/mariadb/V0_0_7__jpa_view.sql | 176 +++ .../migrations/mariadb/V0_0_8__axon_dlq.sql | 26 + .../V0_0_9__axon_sequences_per_table.sql | 5 + view/mongo/pom.xml | 11 +- .../mongo/PolyflowMongoTestApplication.kt | 7 - ...oServiceChangeStreamChangeTrackingITest.kt | 32 +- ...oServiceEventHandlerChangeTrackingITest.kt | 39 +- .../service/PolyflowMongoServiceTestBase.kt | 15 +- .../task/TaskRepositoryExtensionImplITest.kt | 44 +- .../view/mongo/utils/MongoLauncher.kt | 176 --- 44 files changed, 2122 insertions(+), 403 deletions(-) create mode 100644 view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/itest/NoToastPostgresSQLDialect.kt create mode 100644 view/jpa/src/test/resources/application-itest-tc-mariadb.yaml rename view/jpa/src/test/resources/db/migrations/h2-postgresql/{V0_0_14__axon_sequences_per_table.sql => V0_0_10__axon_sequences_per_table.sql} (100%) rename view/jpa/src/test/resources/db/migrations/h2-postgresql/{V0_0_15__jpa_view_correlation_payload.sql => V0_0_11__jpa_view_correlation_payload.sql} (100%) delete mode 100644 view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_11__postgres_engine_7.16_to_7.17.sql rename view/jpa/src/test/resources/db/migrations/h2-postgresql/{V0_0_16__jpa_plf_data_entry_correlations.sql => V0_0_12__jpa_plf_data_entry_correlations.sql} (100%) delete mode 100644 view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_12__postgres_engine_7.17_to_7.18.sql rename view/jpa/src/test/resources/db/migrations/h2-postgresql/{V0_0_1__postgres_engine_7.14.0.sql => V0_0_1__postgres_engine_7.21.0.sql} (97%) rename view/jpa/src/test/resources/db/migrations/h2-postgresql/{V0_0_2__postgres_identity_7.14.0.sql => V0_0_2__postgres_identity_7.21.0.sql} (100%) rename view/jpa/src/test/resources/db/migrations/h2-postgresql/{V0_0_8__jpa_view.sql => V0_0_7__jpa_view.sql} (100%) delete mode 100644 view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_7__postgres_engine_7.14_to_7.15.sql rename view/jpa/src/test/resources/db/migrations/h2-postgresql/{V0_0_10__axon_dlq.sql => V0_0_8__axon_dlq.sql} (100%) rename view/jpa/src/test/resources/db/migrations/h2-postgresql/{V0_0_13__polyflow_deleted.sql => V0_0_9__polyflow_deleted.sql} (100%) delete mode 100644 view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_9__postgres_engine_7.15_to_7.16.sql create mode 100644 view/jpa/src/test/resources/db/migrations/mariadb/V0_0_10__jpa_view_correlation_payload.sql create mode 100644 view/jpa/src/test/resources/db/migrations/mariadb/V0_0_11__jpa_plf_data_entry_correlations.sql create mode 100644 view/jpa/src/test/resources/db/migrations/mariadb/V0_0_1__mariadb_engine_7.21.0.sql create mode 100644 view/jpa/src/test/resources/db/migrations/mariadb/V0_0_2__mariadb_identity_7.21.0.sql create mode 100644 view/jpa/src/test/resources/db/migrations/mariadb/V0_0_3__admin.sql create mode 100644 view/jpa/src/test/resources/db/migrations/mariadb/V0_0_4__tasklist_filters.sql create mode 100644 view/jpa/src/test/resources/db/migrations/mariadb/V0_0_5__axon.sql create mode 100644 view/jpa/src/test/resources/db/migrations/mariadb/V0_0_6__request.sql create mode 100644 view/jpa/src/test/resources/db/migrations/mariadb/V0_0_7__jpa_view.sql create mode 100644 view/jpa/src/test/resources/db/migrations/mariadb/V0_0_8__axon_dlq.sql create mode 100644 view/jpa/src/test/resources/db/migrations/mariadb/V0_0_9__axon_sequences_per_table.sql delete mode 100644 view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/PolyflowMongoTestApplication.kt delete mode 100644 view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/utils/MongoLauncher.kt diff --git a/view/jpa/pom.xml b/view/jpa/pom.xml index 8a7c1e108..8d6ca0f2c 100644 --- a/view/jpa/pom.xml +++ b/view/jpa/pom.xml @@ -48,16 +48,42 @@ spring-boot-starter-test test + + org.testcontainers + junit-jupiter + + + org.testcontainers + mariadb + test + org.flywaydb flyway-core test + + org.flywaydb + flyway-mysql + test + + com.h2database h2 test + + org.postgresql + postgresql + test + + + org.mariadb.jdbc + mariadb-java-client + test + + com.tngtech.jgiven jgiven-junit5 diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceDataEntryCorrelationITest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceDataEntryCorrelationITest.kt index 3318dd1f2..08251ff55 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceDataEntryCorrelationITest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceDataEntryCorrelationITest.kt @@ -34,7 +34,7 @@ import java.util.function.Predicate "polyflow.view.jpa.include-correlated-data-entries-in-data-entry-queries=true" ] ) -@ActiveProfiles("itest", "mock-query-emitter") +@ActiveProfiles("itest-tc-mariadb", "mock-query-emitter") @Transactional @DirtiesContext internal class JpaPolyflowViewServiceDataEntryCorrelationITest { diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceDataEntryITest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceDataEntryITest.kt index 5fa87df06..e04449ac7 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceDataEntryITest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceDataEntryITest.kt @@ -46,7 +46,7 @@ import java.util.function.Predicate "polyflow.view.jpa.include-correlated-data-entries-in-data-entry-queries=false" ] ) -@ActiveProfiles("itest", "mock-query-emitter") +@ActiveProfiles("itest-tc-mariadb", "mock-query-emitter") @Transactional @DirtiesContext internal class JpaPolyflowViewServiceDataEntryITest { @@ -342,7 +342,7 @@ internal class JpaPolyflowViewServiceDataEntryITest { fun `sort should be backwards compatible`() { val result = jpaPolyflowViewService.query( - DataEntriesQuery(sort = "+type") + DataEntriesQuery(sort = "+name") ) assertThat(result.payload.elements.map { it.entryId }).containsExactly(id, id2, id4) } @@ -381,7 +381,7 @@ internal class JpaPolyflowViewServiceDataEntryITest { assertThat(result.payload).matches { entry -> entry.protocol.all { it.username in listOf("SYSTEM", "ANONYMOUS") } } assertThat(result.payload).matches { entry -> entry.authorizedUsers.isEmpty() } } - + @Test fun `should find data entry by involvements`() { val result = jpaPolyflowViewService.query( diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceDataEntryRevisionSupportITest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceDataEntryRevisionSupportITest.kt index e7c1b0d74..27bcc5d48 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceDataEntryRevisionSupportITest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceDataEntryRevisionSupportITest.kt @@ -46,7 +46,7 @@ import java.util.concurrent.Executors ] ) @Transactional -@ActiveProfiles("itest") +@ActiveProfiles("itest-tc-mariadb") internal class JpaPolyflowViewServiceDataEntryRevisionSupportITest { companion object : KLogging() diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceProcessDefinitionITest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceProcessDefinitionITest.kt index a87f1c811..bfea3f74d 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceProcessDefinitionITest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceProcessDefinitionITest.kt @@ -20,7 +20,7 @@ import java.util.* "polyflow.view.jpa.stored-items=process-definition" ] ) -@ActiveProfiles("itest", "mock-query-emitter") +@ActiveProfiles("itest-tc-mariadb", "mock-query-emitter") @Transactional internal class JpaPolyflowViewServiceProcessDefinitionITest { diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceProcessInstanceITest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceProcessInstanceITest.kt index 83eaeef45..07dbd6206 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceProcessInstanceITest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceProcessInstanceITest.kt @@ -23,7 +23,7 @@ import java.util.* "polyflow.view.jpa.stored-items=process-instance" ] ) -@ActiveProfiles("itest", "mock-query-emitter") +@ActiveProfiles("itest-tc-mariadb", "mock-query-emitter") @Transactional internal class JpaPolyflowViewServiceProcessInstanceITest { diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceTaskITest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceTaskITest.kt index e5b6e82ff..6084ecbce 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceTaskITest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceTaskITest.kt @@ -34,19 +34,21 @@ import org.springframework.beans.factory.annotation.Autowired import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.context.ActiveProfiles import org.springframework.transaction.annotation.Transactional +import org.testcontainers.junit.jupiter.Testcontainers import java.time.Instant import java.time.OffsetDateTime import java.time.ZoneOffset import java.util.* import java.util.function.Predicate + @SpringBootTest( classes = [TestApplication::class], properties = [ "polyflow.view.jpa.stored-items=task,data-entry" ] ) -@ActiveProfiles("itest", "mock-query-emitter") +@ActiveProfiles("itest-tc-mariadb", "mock-query-emitter") @Transactional internal class JpaPolyflowViewServiceTaskITest { @@ -88,7 +90,7 @@ internal class JpaPolyflowViewServiceTaskITest { sourceReference = processReference().toSourceReference(), payload = createVariables().apply { putAll(createPayload()) }, businessKey = "business-1", - createTime = Date.from(now), + createTime = Date.from(Instant.now()), candidateUsers = setOf("kermit"), candidateGroups = setOf("muppets") ), metaData = MetaData.emptyInstance() @@ -103,7 +105,7 @@ internal class JpaPolyflowViewServiceTaskITest { sourceReference = processReference().toSourceReference(), payload = createVariables().apply { putAll(createPayload()) }, businessKey = "business-1", - createTime = Date.from(now), + createTime = Date.from(Instant.now()), candidateUsers = setOf("kermit"), candidateGroups = setOf("muppets"), assignee = "kermit" @@ -119,7 +121,7 @@ internal class JpaPolyflowViewServiceTaskITest { sourceReference = processReference().toSourceReference(), payload = createVariables().apply { putAll(createPayload()) }, businessKey = "business-2", - createTime = Date.from(now), + createTime = Date.from(Instant.now()), candidateUsers = setOf("piggy"), candidateGroups = setOf("muppets") ), metaData = MetaData.emptyInstance() @@ -134,7 +136,7 @@ internal class JpaPolyflowViewServiceTaskITest { sourceReference = processReference().toSourceReference(), payload = createVariables().apply { putAll(createPayload()) }, businessKey = "business-2", - createTime = Date.from(now), + createTime = Date.from(Instant.now()), assignee = "piggy", candidateUsers = setOf("piggy"), candidateGroups = setOf("muppets") @@ -152,7 +154,7 @@ internal class JpaPolyflowViewServiceTaskITest { payload = createVariables().apply { putAll(createPayload()) }, correlations = newCorrelations().apply { put(dataType1, dataId1) }, businessKey = "business-3", - createTime = Date.from(now), + createTime = Date.from(Instant.now()), candidateUsers = setOf("luffy"), candidateGroups = setOf("strawhats") ), metaData = MetaData.emptyInstance() @@ -172,7 +174,7 @@ internal class JpaPolyflowViewServiceTaskITest { AuthorizationChange.addGroup("strawhats") ), createModification = Modification( - time = OffsetDateTime.ofInstant(now, ZoneOffset.UTC), + time = OffsetDateTime.ofInstant(Instant.now(), ZoneOffset.UTC), username = "luffy", log = "strawhats", logNotes = "Created the entry" @@ -196,7 +198,7 @@ internal class JpaPolyflowViewServiceTaskITest { }, assignee = "zoro", businessKey = "business-4", - createTime = Date.from(now), + createTime = Date.from(Instant.now()), candidateUsers = setOf("zoro"), candidateGroups = setOf("strawhats") ), metaData = MetaData.emptyInstance() @@ -215,7 +217,7 @@ internal class JpaPolyflowViewServiceTaskITest { AuthorizationChange.addUser("zoro") ), createModification = Modification( - time = OffsetDateTime.ofInstant(now, ZoneOffset.UTC), + time = OffsetDateTime.ofInstant(Instant.now(), ZoneOffset.UTC), username = "zoro", log = "Created", logNotes = "Created the entry" @@ -486,10 +488,10 @@ internal class JpaPolyflowViewServiceTaskITest { val assigned = jpaPolyflowViewService.query(TasksForCandidateUserAndGroupQuery(user = User("zoro", setOf("muppets")), includeAssigned = true)) assertThat(assigned.elements).hasSize(2) - assertThat(assigned.elements[0].id).isEqualTo(id) - assertThat(assigned.elements[0].name).isEqualTo("task name 1") - assertThat(assigned.elements[1].id).isEqualTo(id4) - assertThat(assigned.elements[1].name).isEqualTo("task name 4") + assertThat(assigned.elements[0].id).isEqualTo(id4) + assertThat(assigned.elements[0].name).isEqualTo("task name 4") + assertThat(assigned.elements[1].id).isEqualTo(id) + assertThat(assigned.elements[1].name).isEqualTo("task name 1") val assignedToZoro = jpaPolyflowViewService.query(TasksForCandidateUserAndGroupQuery(user = User("zoro", setOf("muppets")), includeAssigned = true, filters = listOf("task.assignee=zoro"))) assertThat(assignedToZoro.elements).hasSize(1) @@ -589,4 +591,5 @@ internal class JpaPolyflowViewServiceTaskITest { ) ) } + } diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/data/DataEntryRepositoryITest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/data/DataEntryRepositoryITest.kt index 30001d323..95c94de1c 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/data/DataEntryRepositoryITest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/data/DataEntryRepositoryITest.kt @@ -34,7 +34,7 @@ import java.util.* @DirtiesContext @ContextConfiguration(classes = [TestApplication::class]) @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) -@ActiveProfiles("itest", "mock-query-emitter") +@ActiveProfiles("itest-tc-mariadb", "mock-query-emitter") internal class DataEntryRepositoryITest { @Autowired lateinit var entityManager: EntityManager diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/itest/NoToastPostgresSQLDialect.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/itest/NoToastPostgresSQLDialect.kt new file mode 100644 index 000000000..abab7735c --- /dev/null +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/itest/NoToastPostgresSQLDialect.kt @@ -0,0 +1,43 @@ +package io.holunda.polyflow.view.jpa.itest + +import org.hibernate.boot.model.TypeContributions +import org.hibernate.dialect.PostgreSQLDialect +import org.hibernate.engine.jdbc.dialect.spi.DialectResolutionInfo +import org.hibernate.service.ServiceRegistry +import org.hibernate.type.SqlTypes +import org.hibernate.type.descriptor.jdbc.BinaryJdbcType +import org.hibernate.type.descriptor.sql.internal.DdlTypeImpl +import java.sql.Types + +@Suppress("unused") // used in application.yaml +class NoToastPostgresSQLDialect(info: DialectResolutionInfo) : PostgreSQLDialect(info) { + + override fun registerColumnTypes(typeContributions: TypeContributions, serviceRegistry: ServiceRegistry) { + super.registerColumnTypes(typeContributions, serviceRegistry) + val ddlTypeRegistry = typeContributions.typeConfiguration.ddlTypeRegistry + ddlTypeRegistry.addDescriptor(DdlTypeImpl(Types.BLOB, "bytea", this)) + ddlTypeRegistry.addDescriptor(DdlTypeImpl(Types.CLOB, "bytea", this)) + ddlTypeRegistry.addDescriptor(DdlTypeImpl(Types.NCLOB, "bytea", this)) + } + + override fun columnType(sqlTypeCode: Int): String { + return when (sqlTypeCode) { + SqlTypes.BLOB -> "bytea" + else -> super.columnType(sqlTypeCode) + } + } + + override fun castType(sqlTypeCode: Int): String { + return when (sqlTypeCode) { + SqlTypes.BLOB -> "bytea" + else -> super.castType(sqlTypeCode) + } + } + + override fun contributeTypes(typeContributions: TypeContributions, serviceRegistry: ServiceRegistry) { + super.contributeTypes(typeContributions, serviceRegistry) + val jdbcTypeRegistry = typeContributions.typeConfiguration + .jdbcTypeRegistry + jdbcTypeRegistry.addDescriptor(Types.BLOB, BinaryJdbcType.INSTANCE) + } +} diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/process/ProcessDefinitionRepositoryITest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/process/ProcessDefinitionRepositoryITest.kt index 16eeae590..0aec60ef4 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/process/ProcessDefinitionRepositoryITest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/process/ProcessDefinitionRepositoryITest.kt @@ -18,7 +18,7 @@ import java.util.* @DataJpaTest(showSql = false) @ContextConfiguration(classes = [TestApplicationDataJpa::class]) @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) -@ActiveProfiles("itest", "mock-query-emitter") +@ActiveProfiles("itest-tc-mariadb", "mock-query-emitter") class ProcessDefinitionRepositoryITest { @Autowired lateinit var entityManager: EntityManager diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/process/ProcessInstanceRepositoryITest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/process/ProcessInstanceRepositoryITest.kt index b6d31954a..a9e502579 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/process/ProcessInstanceRepositoryITest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/process/ProcessInstanceRepositoryITest.kt @@ -18,7 +18,7 @@ import java.util.* @DataJpaTest(showSql = false) @ContextConfiguration(classes = [TestApplicationDataJpa::class]) @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) -@ActiveProfiles("itest", "mock-query-emitter") +@ActiveProfiles("itest-tc-mariadb", "mock-query-emitter") class ProcessInstanceRepositoryITest { @Autowired lateinit var entityManager: EntityManager diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/task/TaskRepositoryITest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/task/TaskRepositoryITest.kt index 00f167cc8..4348e8853 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/task/TaskRepositoryITest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/task/TaskRepositoryITest.kt @@ -55,7 +55,7 @@ import java.util.* @DataJpaTest(showSql = false) @ContextConfiguration(classes = [TestApplicationDataJpa::class]) @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) -@ActiveProfiles("itest", "mock-query-emitter") +@ActiveProfiles("itest-tc-mariadb", "mock-query-emitter") class TaskRepositoryITest { @Autowired lateinit var entityManager: EntityManager diff --git a/view/jpa/src/test/resources/application-itest-tc-mariadb.yaml b/view/jpa/src/test/resources/application-itest-tc-mariadb.yaml new file mode 100644 index 000000000..a71117c74 --- /dev/null +++ b/view/jpa/src/test/resources/application-itest-tc-mariadb.yaml @@ -0,0 +1,38 @@ +spring: + jpa: + open-in-view: true # disable JPA warning + show-sql: false + database-platform: org.hibernate.dialect.MariaDBDialect + generate-ddl: false + hibernate.ddl-auto: none + datasource: + url: jdbc:tc:mariadb:10.11:///testDb + username: sa + password: sa + flyway: + enabled: true + locations: "classpath:db/migrations/mariadb" + +polyflow: + view: + jpa: + stored-items: TASK, DATA_ENTRY, PROCESS_INSTANCE, PROCESS_DEFINITION + +logging: + level: + root: INFO + org.springframework: INFO + org.axonframework: INFO + org.hibernate.type: INFO # activate this and generic ROOT logger to see SQL and binding + io.holixon.axon.gateway.query: INFO + io.holunda.polyflow.view.jpa: INFO + +axon: + axonserver: + enabled: false + eventhandling: + processors: + [io.holunda.polyflow.view.jpa.service.data]: + mode: subscribing + source: eventBus + diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_14__axon_sequences_per_table.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_10__axon_sequences_per_table.sql similarity index 100% rename from view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_14__axon_sequences_per_table.sql rename to view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_10__axon_sequences_per_table.sql diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_15__jpa_view_correlation_payload.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_11__jpa_view_correlation_payload.sql similarity index 100% rename from view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_15__jpa_view_correlation_payload.sql rename to view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_11__jpa_view_correlation_payload.sql diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_11__postgres_engine_7.16_to_7.17.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_11__postgres_engine_7.16_to_7.17.sql deleted file mode 100644 index dfdc0c9a7..000000000 --- a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_11__postgres_engine_7.16_to_7.17.sql +++ /dev/null @@ -1,29 +0,0 @@ --- --- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH --- under one or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information regarding copyright --- ownership. Camunda licenses this file to you under the Apache License, --- Version 2.0; you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- - -insert into ACT_GE_SCHEMA_LOG -values ('600', CURRENT_TIMESTAMP, '7.17.0'); - --- https://jira.camunda.com/browse/CAM-14006 -- -ALTER TABLE ACT_RU_JOB - ADD COLUMN LAST_FAILURE_LOG_ID_ varchar(64); - -ALTER TABLE ACT_RU_EXT_TASK - ADD COLUMN LAST_FAILURE_LOG_ID_ varchar(64); - -create index ACT_IDX_HI_VARINST_NAME on ACT_HI_VARINST(NAME_); -create index ACT_IDX_HI_VARINST_ACT_INST_ID on ACT_HI_VARINST(ACT_INST_ID_); diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_16__jpa_plf_data_entry_correlations.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_12__jpa_plf_data_entry_correlations.sql similarity index 100% rename from view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_16__jpa_plf_data_entry_correlations.sql rename to view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_12__jpa_plf_data_entry_correlations.sql diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_12__postgres_engine_7.17_to_7.18.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_12__postgres_engine_7.17_to_7.18.sql deleted file mode 100644 index 4fa868407..000000000 --- a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_12__postgres_engine_7.17_to_7.18.sql +++ /dev/null @@ -1,34 +0,0 @@ --- --- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH --- under one or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information regarding copyright --- ownership. Camunda licenses this file to you under the Apache License, --- Version 2.0; you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- - -insert into ACT_GE_SCHEMA_LOG -values ('700', CURRENT_TIMESTAMP, '7.18.0'); - --- https://jira.camunda.com/browse/CAM-14303 -- -ALTER TABLE ACT_RU_TASK - ADD COLUMN LAST_UPDATED_ timestamp; -create index ACT_IDX_TASK_LAST_UPDATED on ACT_RU_TASK(LAST_UPDATED_); - --- https://jira.camunda.com/browse/CAM-14721 -ALTER TABLE ACT_RU_BATCH - ADD COLUMN START_TIME_ timestamp; - --- https://jira.camunda.com/browse/CAM-14722 -ALTER TABLE ACT_RU_BATCH - ADD COLUMN EXEC_START_TIME_ timestamp; -ALTER TABLE ACT_HI_BATCH - ADD COLUMN EXEC_START_TIME_ timestamp; \ No newline at end of file diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_1__postgres_engine_7.14.0.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_1__postgres_engine_7.21.0.sql similarity index 97% rename from view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_1__postgres_engine_7.14.0.sql rename to view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_1__postgres_engine_7.21.0.sql index c21c0b3ab..bed33d64e 100644 --- a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_1__postgres_engine_7.14.0.sql +++ b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_1__postgres_engine_7.21.0.sql @@ -69,7 +69,7 @@ create table ACT_GE_SCHEMA_LOG ( ); insert into ACT_GE_SCHEMA_LOG -values ('0', CURRENT_TIMESTAMP, '7.14.0'); +values ('0', CURRENT_TIMESTAMP, '7.21.0'); create table ACT_RE_DEPLOYMENT ( ID_ varchar(64), @@ -106,12 +106,13 @@ create table ACT_RU_EXECUTION ( create table ACT_RU_JOB ( ID_ varchar(64) NOT NULL, - REV_ integer, + REV_ integer, TYPE_ varchar(255) NOT NULL, LOCK_EXP_TIME_ timestamp, LOCK_OWNER_ varchar(255), EXCLUSIVE_ boolean, EXECUTION_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), PROCESS_INSTANCE_ID_ varchar(64), PROCESS_DEF_ID_ varchar(64), PROCESS_DEF_KEY_ varchar(255), @@ -131,6 +132,7 @@ create table ACT_RU_JOB ( SEQUENCE_COUNTER_ bigint, TENANT_ID_ varchar(64), CREATE_TIME_ timestamp, + LAST_FAILURE_LOG_ID_ varchar(64), primary key (ID_) ); @@ -168,6 +170,17 @@ create table ACT_RE_PROCDEF ( primary key (ID_) ); +create table ACT_RE_CAMFORMDEF ( + ID_ varchar(64) NOT NULL, + REV_ integer, + KEY_ varchar(255) NOT NULL, + VERSION_ integer NOT NULL, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + TENANT_ID_ varchar(64), + primary key (ID_) +); + create table ACT_RU_TASK ( ID_ varchar(64), REV_ integer, @@ -186,6 +199,7 @@ create table ACT_RU_TASK ( DELEGATION_ varchar(64), PRIORITY_ integer, CREATE_TIME_ timestamp, + LAST_UPDATED_ timestamp, DUE_DATE_ timestamp, FOLLOW_UP_DATE_ timestamp, SUSPENSION_STATE_ integer, @@ -259,6 +273,7 @@ create table ACT_RU_INCIDENT ( CONFIGURATION_ varchar(255), TENANT_ID_ varchar(64), JOB_DEF_ID_ varchar(64), + ANNOTATION_ varchar(4000), primary key (ID_) ); @@ -297,6 +312,13 @@ create table ACT_RU_METER_LOG ( primary key (ID_) ); +create table ACT_RU_TASK_METER_LOG ( + ID_ varchar(64) not null, + ASSIGNEE_HASH_ bigint, + TIMESTAMP_ timestamp, + primary key (ID_) +); + create table ACT_RU_EXT_TASK ( ID_ varchar(64) not null, REV_ integer not null, @@ -306,6 +328,7 @@ create table ACT_RU_EXT_TASK ( ERROR_MSG_ varchar(4000), ERROR_DETAILS_ID_ varchar(64), LOCK_EXP_TIME_ timestamp, + CREATE_TIME_ timestamp, SUSPENSION_STATE_ integer, EXECUTION_ID_ varchar(64), PROC_INST_ID_ varchar(64), @@ -315,6 +338,7 @@ create table ACT_RU_EXT_TASK ( ACT_INST_ID_ varchar(64), TENANT_ID_ varchar(64), PRIORITY_ bigint NOT NULL DEFAULT 0, + LAST_FAILURE_LOG_ID_ varchar(64), primary key (ID_) ); @@ -333,6 +357,8 @@ create table ACT_RU_BATCH ( CONFIGURATION_ varchar(255), TENANT_ID_ varchar(64), CREATE_USER_ID_ varchar(255), + START_TIME_ timestamp, + EXEC_START_TIME_ timestamp, primary key (ID_) ); @@ -340,6 +366,7 @@ create index ACT_IDX_EXE_ROOT_PI on ACT_RU_EXECUTION(ROOT_PROC_INST_ID_); create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_); create index ACT_IDX_EXEC_TENANT_ID on ACT_RU_EXECUTION(TENANT_ID_); create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); +create index ACT_IDX_TASK_LAST_UPDATED on ACT_RU_TASK(LAST_UPDATED_); create index ACT_IDX_TASK_ASSIGNEE on ACT_RU_TASK(ASSIGNEE_); create index ACT_IDX_TASK_OWNER on ACT_RU_TASK(OWNER_); create index ACT_IDX_TASK_TENANT_ID on ACT_RU_TASK(TENANT_ID_); @@ -358,6 +385,7 @@ create index ACT_IDX_INC_TENANT_ID on ACT_RU_INCIDENT(TENANT_ID_); create index ACT_IDX_JOB_EXECUTION_ID on ACT_RU_JOB(EXECUTION_ID_); create index ACT_IDX_JOB_HANDLER on ACT_RU_JOB(HANDLER_TYPE_,HANDLER_CFG_); create index ACT_IDX_JOB_PROCINST on ACT_RU_JOB(PROCESS_INSTANCE_ID_); +create index ACT_IDX_JOB_ROOT_PROCINST on ACT_RU_JOB(ROOT_PROC_INST_ID_); create index ACT_IDX_JOB_TENANT_ID on ACT_RU_JOB(TENANT_ID_); create index ACT_IDX_JOBDEF_TENANT_ID on ACT_RU_JOBDEF(TENANT_ID_); @@ -370,6 +398,9 @@ CREATE INDEX ACT_IDX_METER_LOG_REPORT ON ACT_RU_METER_LOG(NAME_, REPORTER_, MILL CREATE INDEX ACT_IDX_METER_LOG_TIME ON ACT_RU_METER_LOG(TIMESTAMP_); CREATE INDEX ACT_IDX_METER_LOG ON ACT_RU_METER_LOG(NAME_, TIMESTAMP_); +-- task metric timestamp column +CREATE INDEX ACT_IDX_TASK_METER_LOG_TIME ON ACT_RU_TASK_METER_LOG(TIMESTAMP_); + create index ACT_IDX_EXT_TASK_TOPIC on ACT_RU_EXT_TASK(TOPIC_NAME_); create index ACT_IDX_EXT_TASK_TENANT_ID on ACT_RU_EXT_TASK(TENANT_ID_); create index ACT_IDX_EXT_TASK_PRIORITY ON ACT_RU_EXT_TASK(PRIORITY_); @@ -1024,6 +1055,7 @@ create table ACT_HI_INCIDENT ( INCIDENT_STATE_ integer, TENANT_ID_ varchar(64), JOB_DEF_ID_ varchar(64), + ANNOTATION_ varchar(4000), REMOVAL_TIME_ timestamp, primary key (ID_) ); @@ -1070,6 +1102,7 @@ create table ACT_HI_BATCH ( START_TIME_ timestamp not null, END_TIME_ timestamp, REMOVAL_TIME_ timestamp, + EXEC_START_TIME_ timestamp, primary key (ID_) ); @@ -1158,6 +1191,8 @@ create index ACT_IDX_HI_VAR_INST_PROC_DEF_KEY on ACT_HI_VARINST(PROC_DEF_KEY_); create index ACT_IDX_HI_VARINST_BYTEAR on ACT_HI_VARINST(BYTEARRAY_ID_); create index ACT_IDX_HI_VARINST_RM_TIME on ACT_HI_VARINST(REMOVAL_TIME_); create index ACT_IDX_HI_VAR_PI_NAME_TYPE on ACT_HI_VARINST(PROC_INST_ID_, NAME_, VAR_TYPE_); +create index ACT_IDX_HI_VARINST_NAME on ACT_HI_VARINST(NAME_); +create index ACT_IDX_HI_VARINST_ACT_INST_ID on ACT_HI_VARINST(ACT_INST_ID_); create index ACT_IDX_HI_INCIDENT_TENANT_ID on ACT_HI_INCIDENT(TENANT_ID_); create index ACT_IDX_HI_INCIDENT_PROC_DEF_KEY on ACT_HI_INCIDENT(PROC_DEF_KEY_); diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_2__postgres_identity_7.14.0.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_2__postgres_identity_7.21.0.sql similarity index 100% rename from view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_2__postgres_identity_7.14.0.sql rename to view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_2__postgres_identity_7.21.0.sql diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_5__axon.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_5__axon.sql index 57a412ce7..60f87ed94 100644 --- a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_5__axon.sql +++ b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_5__axon.sql @@ -14,8 +14,8 @@ CREATE TABLE domain_event_entry ( global_index BIGINT NOT NULL, event_identifier VARCHAR(255) NOT NULL, - meta_data BYTEA, - payload BYTEA NOT NULL, + meta_data LONGBLOB, + payload LONGBLOB NOT NULL, payload_revision VARCHAR(255), payload_type VARCHAR(255) NOT NULL, time_stamp VARCHAR(255) NOT NULL, diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_8__jpa_view.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_7__jpa_view.sql similarity index 100% rename from view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_8__jpa_view.sql rename to view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_7__jpa_view.sql diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_7__postgres_engine_7.14_to_7.15.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_7__postgres_engine_7.14_to_7.15.sql deleted file mode 100644 index 259227b68..000000000 --- a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_7__postgres_engine_7.14_to_7.15.sql +++ /dev/null @@ -1,37 +0,0 @@ --- --- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH --- under one or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information regarding copyright --- ownership. Camunda licenses this file to you under the Apache License, --- Version 2.0; you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- - -insert into ACT_GE_SCHEMA_LOG -values ('400', CURRENT_TIMESTAMP, '7.15.0'); - --- https://jira.camunda.com/browse/CAM-13013 - -create table ACT_RU_TASK_METER_LOG ( - ID_ varchar(64) not null, - ASSIGNEE_HASH_ bigint, - TIMESTAMP_ timestamp, - primary key (ID_) -); - -create index ACT_IDX_TASK_METER_LOG_TIME on ACT_RU_TASK_METER_LOG(TIMESTAMP_); - --- https://jira.camunda.com/browse/CAM-13060 -ALTER TABLE ACT_RU_INCIDENT - ADD ANNOTATION_ varchar(4000); - -ALTER TABLE ACT_HI_INCIDENT - ADD ANNOTATION_ varchar(4000); diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_10__axon_dlq.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_8__axon_dlq.sql similarity index 100% rename from view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_10__axon_dlq.sql rename to view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_8__axon_dlq.sql diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_13__polyflow_deleted.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_9__polyflow_deleted.sql similarity index 100% rename from view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_13__polyflow_deleted.sql rename to view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_9__polyflow_deleted.sql diff --git a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_9__postgres_engine_7.15_to_7.16.sql b/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_9__postgres_engine_7.15_to_7.16.sql deleted file mode 100644 index ec0c9e801..000000000 --- a/view/jpa/src/test/resources/db/migrations/h2-postgresql/V0_0_9__postgres_engine_7.15_to_7.16.sql +++ /dev/null @@ -1,30 +0,0 @@ --- --- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH --- under one or more contributor license agreements. See the NOTICE file --- distributed with this work for additional information regarding copyright --- ownership. Camunda licenses this file to you under the Apache License, --- Version 2.0; you may not use this file except in compliance with the License. --- You may obtain a copy of the License at --- --- http://www.apache.org/licenses/LICENSE-2.0 --- --- Unless required by applicable law or agreed to in writing, software --- distributed under the License is distributed on an "AS IS" BASIS, --- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. --- See the License for the specific language governing permissions and --- limitations under the License. --- - -insert into ACT_GE_SCHEMA_LOG -values ('500', CURRENT_TIMESTAMP, '7.16.0'); - -create table ACT_RE_CAMFORMDEF ( - ID_ varchar(64) NOT NULL, - REV_ integer, - KEY_ varchar(255) NOT NULL, - VERSION_ integer NOT NULL, - DEPLOYMENT_ID_ varchar(64), - RESOURCE_NAME_ varchar(4000), - TENANT_ID_ varchar(64), - primary key (ID_) -); \ No newline at end of file diff --git a/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_10__jpa_view_correlation_payload.sql b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_10__jpa_view_correlation_payload.sql new file mode 100644 index 000000000..6e25b0231 --- /dev/null +++ b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_10__jpa_view_correlation_payload.sql @@ -0,0 +1,6 @@ +create view plf_view_task_and_data_entry_payload as +((select pc.task_id, dea.path, dea.value + from plf_task_correlations pc + join plf_data_entry_payload_attributes dea on pc.entry_id = dea.entry_id and pc.entry_type = dea.entry_type) +union +select * from plf_task_payload_attributes); diff --git a/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_11__jpa_plf_data_entry_correlations.sql b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_11__jpa_plf_data_entry_correlations.sql new file mode 100644 index 000000000..0dfef37f6 --- /dev/null +++ b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_11__jpa_plf_data_entry_correlations.sql @@ -0,0 +1,23 @@ +create table plf_data_entry_correlations +( + owning_entry_type varchar(255) not null, + owning_entry_id varchar(64) not null, + entry_type varchar(255) not null, + entry_id varchar(64) not null, + primary key (owning_entry_type, owning_entry_id, entry_type, entry_id) +); + +create view plf_view_data_entry_payload as +( +select * +from plf_data_entry_payload_attributes +union +(select ec.owning_entry_id as ENTRY_ID, + ec.owning_entry_type as ENTRY_TYPE, + ep.path as PATH, + ep.value as VALUE + from plf_data_entry_correlations ec + join plf_data_entry_payload_attributes ep + on + ec.entry_id = ep.entry_id and ec.entry_type = ep.entry_type) +); diff --git a/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_1__mariadb_engine_7.21.0.sql b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_1__mariadb_engine_7.21.0.sql new file mode 100644 index 000000000..3a76e8e36 --- /dev/null +++ b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_1__mariadb_engine_7.21.0.sql @@ -0,0 +1,1393 @@ +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +create table ACT_GE_PROPERTY ( + NAME_ varchar(64), + VALUE_ varchar(300), + REV_ integer, + primary key (NAME_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +insert into ACT_GE_PROPERTY +values ('schema.version', 'fox', 1); + +insert into ACT_GE_PROPERTY +values ('schema.history', 'create(fox)', 1); + +insert into ACT_GE_PROPERTY +values ('next.dbid', '1', 1); + +insert into ACT_GE_PROPERTY +values ('deployment.lock', '0', 1); + +insert into ACT_GE_PROPERTY +values ('history.cleanup.job.lock', '0', 1); + +insert into ACT_GE_PROPERTY +values ('startup.lock', '0', 1); + +insert into ACT_GE_PROPERTY +values ('telemetry.lock', '0', 1); + +insert into ACT_GE_PROPERTY +values ('installationId.lock', '0', 1); + +create table ACT_GE_BYTEARRAY ( + ID_ varchar(64), + REV_ integer, + NAME_ varchar(255), + DEPLOYMENT_ID_ varchar(64), + BYTES_ LONGBLOB, + GENERATED_ TINYINT, + TENANT_ID_ varchar(64), + TYPE_ integer, + CREATE_TIME_ datetime(3), + ROOT_PROC_INST_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_GE_SCHEMA_LOG ( + ID_ varchar(64), + TIMESTAMP_ datetime(3), + VERSION_ varchar(255), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +insert into ACT_GE_SCHEMA_LOG +values ('0', CURRENT_TIMESTAMP, '7.21.0'); + +create table ACT_RE_DEPLOYMENT ( + ID_ varchar(64), + NAME_ varchar(255), + DEPLOY_TIME_ datetime(3), + SOURCE_ varchar(255), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_EXECUTION ( + ID_ varchar(64), + REV_ integer, + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + BUSINESS_KEY_ varchar(255), + PARENT_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + SUPER_EXEC_ varchar(64), + SUPER_CASE_EXEC_ varchar(64), + CASE_INST_ID_ varchar(64), + ACT_ID_ varchar(255), + ACT_INST_ID_ varchar(64), + IS_ACTIVE_ TINYINT, + IS_CONCURRENT_ TINYINT, + IS_SCOPE_ TINYINT, + IS_EVENT_SCOPE_ TINYINT, + SUSPENSION_STATE_ integer, + CACHED_ENT_STATE_ integer, + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_JOB ( + ID_ varchar(64) NOT NULL, + REV_ integer, + TYPE_ varchar(255) NOT NULL, + LOCK_EXP_TIME_ datetime(3) NULL, + LOCK_OWNER_ varchar(255), + EXCLUSIVE_ boolean, + EXECUTION_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROCESS_DEF_ID_ varchar(64), + PROCESS_DEF_KEY_ varchar(255), + RETRIES_ integer, + EXCEPTION_STACK_ID_ varchar(64), + EXCEPTION_MSG_ varchar(4000), + FAILED_ACT_ID_ varchar(255), + DUEDATE_ datetime(3) NULL, + REPEAT_ varchar(255), + REPEAT_OFFSET_ bigint DEFAULT 0, + HANDLER_TYPE_ varchar(255), + HANDLER_CFG_ varchar(4000), + DEPLOYMENT_ID_ varchar(64), + SUSPENSION_STATE_ integer NOT NULL DEFAULT 1, + JOB_DEF_ID_ varchar(64), + PRIORITY_ bigint NOT NULL DEFAULT 0, + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + CREATE_TIME_ datetime(3), + LAST_FAILURE_LOG_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_JOBDEF ( + ID_ varchar(64) NOT NULL, + REV_ integer, + PROC_DEF_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + ACT_ID_ varchar(255), + JOB_TYPE_ varchar(255) NOT NULL, + JOB_CONFIGURATION_ varchar(255), + SUSPENSION_STATE_ integer, + JOB_PRIORITY_ bigint, + TENANT_ID_ varchar(64), + DEPLOYMENT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RE_PROCDEF ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + NAME_ varchar(255), + KEY_ varchar(255) not null, + VERSION_ integer not null, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + DGRM_RESOURCE_NAME_ varchar(4000), + HAS_START_FORM_KEY_ TINYINT, + SUSPENSION_STATE_ integer, + TENANT_ID_ varchar(64), + VERSION_TAG_ varchar(64), + HISTORY_TTL_ integer, + STARTABLE_ boolean NOT NULL default TRUE, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RE_CAMFORMDEF ( + ID_ varchar(64) not null, + REV_ integer, + KEY_ varchar(255) not null, + VERSION_ integer not null, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_TASK ( + ID_ varchar(64), + REV_ integer, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_DEF_ID_ varchar(64), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + TASK_DEF_KEY_ varchar(255), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + DELEGATION_ varchar(64), + PRIORITY_ integer, + CREATE_TIME_ datetime(3), + LAST_UPDATED_ datetime(3), + DUE_DATE_ datetime(3), + FOLLOW_UP_DATE_ datetime(3), + SUSPENSION_STATE_ integer, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_IDENTITYLINK ( + ID_ varchar(64), + REV_ integer, + GROUP_ID_ varchar(255), + TYPE_ varchar(255), + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_VARIABLE ( + ID_ varchar(64) not null, + REV_ integer, + TYPE_ varchar(255) not null, + NAME_ varchar(255) not null, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + TASK_ID_ varchar(64), + BATCH_ID_ varchar(64), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + VAR_SCOPE_ varchar(64) not null, + SEQUENCE_COUNTER_ bigint, + IS_CONCURRENT_LOCAL_ TINYINT, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_EVENT_SUBSCR ( + ID_ varchar(64) not null, + REV_ integer, + EVENT_TYPE_ varchar(255) not null, + EVENT_NAME_ varchar(255), + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + ACTIVITY_ID_ varchar(255), + CONFIGURATION_ varchar(255), + CREATED_ datetime(3) not null, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_INCIDENT ( + ID_ varchar(64) not null, + REV_ integer not null, + INCIDENT_TIMESTAMP_ datetime(3) not null, + INCIDENT_MSG_ varchar(4000), + INCIDENT_TYPE_ varchar(255) not null, + EXECUTION_ID_ varchar(64), + ACTIVITY_ID_ varchar(255), + FAILED_ACTIVITY_ID_ varchar(255), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + CAUSE_INCIDENT_ID_ varchar(64), + ROOT_CAUSE_INCIDENT_ID_ varchar(64), + CONFIGURATION_ varchar(255), + TENANT_ID_ varchar(64), + JOB_DEF_ID_ varchar(64), + ANNOTATION_ varchar(4000), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_AUTHORIZATION ( + ID_ varchar(64) not null, + REV_ integer not null, + TYPE_ integer not null, + GROUP_ID_ varchar(255), + USER_ID_ varchar(255), + RESOURCE_TYPE_ integer not null, + RESOURCE_ID_ varchar(255), + PERMS_ integer, + REMOVAL_TIME_ datetime(3), + ROOT_PROC_INST_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_FILTER ( + ID_ varchar(64) not null, + REV_ integer not null, + RESOURCE_TYPE_ varchar(255) not null, + NAME_ varchar(255) not null, + OWNER_ varchar(255), + QUERY_ LONGTEXT not null, + PROPERTIES_ LONGTEXT, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_METER_LOG ( + ID_ varchar(64) not null, + NAME_ varchar(64) not null, + REPORTER_ varchar(255), + VALUE_ bigint, + TIMESTAMP_ datetime(3), + MILLISECONDS_ bigint DEFAULT 0, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_TASK_METER_LOG ( + ID_ varchar(64) not null, + ASSIGNEE_HASH_ bigint, + TIMESTAMP_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_EXT_TASK ( + ID_ varchar(64) not null, + REV_ integer not null, + WORKER_ID_ varchar(255), + TOPIC_NAME_ varchar(255), + RETRIES_ integer, + ERROR_MSG_ varchar(4000), + ERROR_DETAILS_ID_ varchar(64), + LOCK_EXP_TIME_ datetime(3) NULL, + CREATE_TIME_ datetime(3) NULL, + SUSPENSION_STATE_ integer, + EXECUTION_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + ACT_ID_ varchar(255), + ACT_INST_ID_ varchar(64), + TENANT_ID_ varchar(64), + PRIORITY_ bigint NOT NULL DEFAULT 0, + LAST_FAILURE_LOG_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_RU_BATCH ( + ID_ varchar(64) not null, + REV_ integer not null, + TYPE_ varchar(255), + TOTAL_JOBS_ integer, + JOBS_CREATED_ integer, + JOBS_PER_SEED_ integer, + INVOCATIONS_PER_JOB_ integer, + SEED_JOB_DEF_ID_ varchar(64), + BATCH_JOB_DEF_ID_ varchar(64), + MONITOR_JOB_DEF_ID_ varchar(64), + SUSPENSION_STATE_ integer, + CONFIGURATION_ varchar(255), + TENANT_ID_ varchar(64), + CREATE_USER_ID_ varchar(255), + START_TIME_ datetime(3), + EXEC_START_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_EXEC_ROOT_PI on ACT_RU_EXECUTION(ROOT_PROC_INST_ID_); +create index ACT_IDX_EXEC_BUSKEY on ACT_RU_EXECUTION(BUSINESS_KEY_); +create index ACT_IDX_EXEC_TENANT_ID on ACT_RU_EXECUTION(TENANT_ID_); +create index ACT_IDX_TASK_CREATE on ACT_RU_TASK(CREATE_TIME_); +create index ACT_IDX_TASK_LAST_UPDATED on ACT_RU_TASK(LAST_UPDATED_); +create index ACT_IDX_TASK_ASSIGNEE on ACT_RU_TASK(ASSIGNEE_); +create index ACT_IDX_TASK_OWNER on ACT_RU_TASK(OWNER_); +create index ACT_IDX_TASK_TENANT_ID on ACT_RU_TASK(TENANT_ID_); +create index ACT_IDX_IDENT_LNK_USER on ACT_RU_IDENTITYLINK(USER_ID_); +create index ACT_IDX_IDENT_LNK_GROUP on ACT_RU_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_EVENT_SUBSCR_CONFIG_ on ACT_RU_EVENT_SUBSCR(CONFIGURATION_); +create index ACT_IDX_EVENT_SUBSCR_TENANT_ID on ACT_RU_EVENT_SUBSCR(TENANT_ID_); + +create index ACT_IDX_VARIABLE_TASK_ID on ACT_RU_VARIABLE(TASK_ID_); +create index ACT_IDX_VARIABLE_TENANT_ID on ACT_RU_VARIABLE(TENANT_ID_); +create index ACT_IDX_VARIABLE_TASK_NAME_TYPE on ACT_RU_VARIABLE(TASK_ID_, NAME_, TYPE_); + +create index ACT_IDX_ATHRZ_PROCEDEF on ACT_RU_IDENTITYLINK(PROC_DEF_ID_); +create index ACT_IDX_INC_CONFIGURATION on ACT_RU_INCIDENT(CONFIGURATION_); +create index ACT_IDX_INC_TENANT_ID on ACT_RU_INCIDENT(TENANT_ID_); +-- CAM-5914 +create index ACT_IDX_JOB_EXECUTION_ID on ACT_RU_JOB(EXECUTION_ID_); +-- this index needs to be limited in mariadb see CAM-6938 +create index ACT_IDX_JOB_HANDLER on ACT_RU_JOB(HANDLER_TYPE_(100),HANDLER_CFG_(155)); +create index ACT_IDX_JOB_PROCINST on ACT_RU_JOB(PROCESS_INSTANCE_ID_); +create index ACT_IDX_JOB_ROOT_PROCINST on ACT_RU_JOB(ROOT_PROC_INST_ID_); +create index ACT_IDX_JOB_TENANT_ID on ACT_RU_JOB(TENANT_ID_); +create index ACT_IDX_JOBDEF_TENANT_ID on ACT_RU_JOBDEF(TENANT_ID_); + +-- new metric milliseconds column +CREATE INDEX ACT_IDX_METER_LOG_MS ON ACT_RU_METER_LOG(MILLISECONDS_); +CREATE INDEX ACT_IDX_METER_LOG_NAME_MS ON ACT_RU_METER_LOG(NAME_, MILLISECONDS_); +CREATE INDEX ACT_IDX_METER_LOG_REPORT ON ACT_RU_METER_LOG(NAME_, REPORTER_, MILLISECONDS_); + +-- old metric timestamp column +CREATE INDEX ACT_IDX_METER_LOG_TIME ON ACT_RU_METER_LOG(TIMESTAMP_); +CREATE INDEX ACT_IDX_METER_LOG ON ACT_RU_METER_LOG(NAME_, TIMESTAMP_); + +-- task metric timestamp column +CREATE INDEX ACT_IDX_TASK_METER_LOG_TIME ON ACT_RU_TASK_METER_LOG(TIMESTAMP_); + +create index ACT_IDX_EXT_TASK_TOPIC on ACT_RU_EXT_TASK(TOPIC_NAME_); +create index ACT_IDX_EXT_TASK_TENANT_ID on ACT_RU_EXT_TASK(TENANT_ID_); +create index ACT_IDX_EXT_TASK_PRIORITY ON ACT_RU_EXT_TASK(PRIORITY_); +create index ACT_IDX_EXT_TASK_ERR_DETAILS ON ACT_RU_EXT_TASK(ERROR_DETAILS_ID_); +create index ACT_IDX_AUTH_GROUP_ID ON ACT_RU_AUTHORIZATION(GROUP_ID_); +create index ACT_IDX_JOB_JOB_DEF_ID on ACT_RU_JOB(JOB_DEF_ID_); + +alter table ACT_GE_BYTEARRAY + add constraint ACT_FK_BYTEARR_DEPL + foreign key (DEPLOYMENT_ID_) + references ACT_RE_DEPLOYMENT (ID_); + +alter table ACT_RU_EXECUTION + add constraint ACT_FK_EXE_PROCINST + foreign key (PROC_INST_ID_) + references ACT_RU_EXECUTION (ID_) on delete cascade on update cascade; + +alter table ACT_RU_EXECUTION + add constraint ACT_FK_EXE_PARENT + foreign key (PARENT_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_EXECUTION + add constraint ACT_FK_EXE_SUPER + foreign key (SUPER_EXEC_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_EXECUTION + add constraint ACT_FK_EXE_PROCDEF + foreign key (PROC_DEF_ID_) + references ACT_RE_PROCDEF (ID_); + +alter table ACT_RU_IDENTITYLINK + add constraint ACT_FK_TSKASS_TASK + foreign key (TASK_ID_) + references ACT_RU_TASK (ID_); + +alter table ACT_RU_IDENTITYLINK + add constraint ACT_FK_ATHRZ_PROCEDEF + foreign key (PROC_DEF_ID_) + references ACT_RE_PROCDEF(ID_); + +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_EXE + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_PROCINST + foreign key (PROC_INST_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_PROCDEF + foreign key (PROC_DEF_ID_) + references ACT_RE_PROCDEF (ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_EXE + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_PROCINST + foreign key (PROC_INST_ID_) + references ACT_RU_EXECUTION(ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BYTEARRAY + foreign key (BYTEARRAY_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_JOB + add constraint ACT_FK_JOB_EXCEPTION + foreign key (EXCEPTION_STACK_ID_) + references ACT_GE_BYTEARRAY (ID_); + +alter table ACT_RU_EVENT_SUBSCR + add constraint ACT_FK_EVENT_EXEC + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION(ID_); + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_EXE + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_PROCINST + foreign key (PROC_INST_ID_) + references ACT_RU_EXECUTION (ID_); + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_PROCDEF + foreign key (PROC_DEF_ID_) + references ACT_RE_PROCDEF (ID_); + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_CAUSE + foreign key (CAUSE_INCIDENT_ID_) + references ACT_RU_INCIDENT (ID_) on delete cascade on update cascade; + +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_RCAUSE + foreign key (ROOT_CAUSE_INCIDENT_ID_) + references ACT_RU_INCIDENT (ID_) on delete cascade on update cascade; + +alter table ACT_RU_EXT_TASK + add constraint ACT_FK_EXT_TASK_ERROR_DETAILS + foreign key (ERROR_DETAILS_ID_) + references ACT_GE_BYTEARRAY (ID_); + +create index ACT_IDX_INC_JOB_DEF on ACT_RU_INCIDENT(JOB_DEF_ID_); +alter table ACT_RU_INCIDENT + add constraint ACT_FK_INC_JOB_DEF + foreign key (JOB_DEF_ID_) + references ACT_RU_JOBDEF (ID_); + +alter table ACT_RU_AUTHORIZATION + add constraint ACT_UNIQ_AUTH_USER + unique (USER_ID_,TYPE_,RESOURCE_TYPE_,RESOURCE_ID_); + +alter table ACT_RU_AUTHORIZATION + add constraint ACT_UNIQ_AUTH_GROUP + unique (GROUP_ID_,TYPE_,RESOURCE_TYPE_,RESOURCE_ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_UNIQ_VARIABLE + unique (VAR_SCOPE_, NAME_); + +alter table ACT_RU_EXT_TASK + add constraint ACT_FK_EXT_TASK_EXE + foreign key (EXECUTION_ID_) + references ACT_RU_EXECUTION (ID_); + +create index ACT_IDX_BATCH_SEED_JOB_DEF ON ACT_RU_BATCH(SEED_JOB_DEF_ID_); +alter table ACT_RU_BATCH + add constraint ACT_FK_BATCH_SEED_JOB_DEF + foreign key (SEED_JOB_DEF_ID_) + references ACT_RU_JOBDEF (ID_); + +create index ACT_IDX_BATCH_MONITOR_JOB_DEF ON ACT_RU_BATCH(MONITOR_JOB_DEF_ID_); +alter table ACT_RU_BATCH + add constraint ACT_FK_BATCH_MONITOR_JOB_DEF + foreign key (MONITOR_JOB_DEF_ID_) + references ACT_RU_JOBDEF (ID_); + +create index ACT_IDX_BATCH_JOB_DEF ON ACT_RU_BATCH(BATCH_JOB_DEF_ID_); +alter table ACT_RU_BATCH + add constraint ACT_FK_BATCH_JOB_DEF + foreign key (BATCH_JOB_DEF_ID_) + references ACT_RU_JOBDEF (ID_); + +create index ACT_IDX_BATCH_ID ON ACT_RU_VARIABLE(BATCH_ID_); +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_BATCH + foreign key (BATCH_ID_) + references ACT_RU_BATCH (ID_); + +-- indexes for deadlock problems - https://app.camunda.com/jira/browse/CAM-2567 -- +create index ACT_IDX_INC_CAUSEINCID on ACT_RU_INCIDENT(CAUSE_INCIDENT_ID_); +create index ACT_IDX_INC_EXID on ACT_RU_INCIDENT(EXECUTION_ID_); +create index ACT_IDX_INC_PROCDEFID on ACT_RU_INCIDENT(PROC_DEF_ID_); +create index ACT_IDX_INC_PROCINSTID on ACT_RU_INCIDENT(PROC_INST_ID_); +create index ACT_IDX_INC_ROOTCAUSEINCID on ACT_RU_INCIDENT(ROOT_CAUSE_INCIDENT_ID_); +-- index for deadlock problem - https://app.camunda.com/jira/browse/CAM-4440 -- +create index ACT_IDX_AUTH_RESOURCE_ID on ACT_RU_AUTHORIZATION(RESOURCE_ID_); +-- index to prevent deadlock on fk constraint - https://app.camunda.com/jira/browse/CAM-5440 -- +create index ACT_IDX_EXT_TASK_EXEC on ACT_RU_EXT_TASK(EXECUTION_ID_); + +-- indexes to improve deployment +create index ACT_IDX_BYTEARRAY_ROOT_PI on ACT_GE_BYTEARRAY(ROOT_PROC_INST_ID_); +create index ACT_IDX_BYTEARRAY_RM_TIME on ACT_GE_BYTEARRAY(REMOVAL_TIME_); +create index ACT_IDX_BYTEARRAY_NAME on ACT_GE_BYTEARRAY(NAME_); +create index ACT_IDX_DEPLOYMENT_NAME on ACT_RE_DEPLOYMENT(NAME_); +create index ACT_IDX_DEPLOYMENT_TENANT_ID on ACT_RE_DEPLOYMENT(TENANT_ID_); +create index ACT_IDX_JOBDEF_PROC_DEF_ID ON ACT_RU_JOBDEF(PROC_DEF_ID_); +create index ACT_IDX_JOB_HANDLER_TYPE ON ACT_RU_JOB(HANDLER_TYPE_); +create index ACT_IDX_EVENT_SUBSCR_EVT_NAME ON ACT_RU_EVENT_SUBSCR(EVENT_NAME_); +create index ACT_IDX_PROCDEF_DEPLOYMENT_ID ON ACT_RE_PROCDEF(DEPLOYMENT_ID_); +create index ACT_IDX_PROCDEF_TENANT_ID ON ACT_RE_PROCDEF(TENANT_ID_); +create index ACT_IDX_PROCDEF_VER_TAG ON ACT_RE_PROCDEF(VERSION_TAG_); + +-- indices for history cleanup: https://jira.camunda.com/browse/CAM-11616 +create index ACT_IDX_AUTH_ROOT_PI on ACT_RU_AUTHORIZATION(ROOT_PROC_INST_ID_); +create index ACT_IDX_AUTH_RM_TIME on ACT_RU_AUTHORIZATION(REMOVAL_TIME_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +-- create case definition table -- +create table ACT_RE_CASE_DEF ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + NAME_ varchar(255), + KEY_ varchar(255) not null, + VERSION_ integer not null, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + DGRM_RESOURCE_NAME_ varchar(4000), + TENANT_ID_ varchar(64), + HISTORY_TTL_ integer, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create case execution table -- +create table ACT_RU_CASE_EXECUTION ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CASE_INST_ID_ varchar(64), + SUPER_CASE_EXEC_ varchar(64), + SUPER_EXEC_ varchar(64), + BUSINESS_KEY_ varchar(255), + PARENT_ID_ varchar(64), + CASE_DEF_ID_ varchar(64), + ACT_ID_ varchar(255), + PREV_STATE_ integer, + CURRENT_STATE_ integer, + REQUIRED_ boolean, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create case sentry part table -- + +create table ACT_RU_CASE_SENTRY_PART ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CASE_INST_ID_ varchar(64), + CASE_EXEC_ID_ varchar(64), + SENTRY_ID_ varchar(255), + TYPE_ varchar(255), + SOURCE_CASE_EXEC_ID_ varchar(64), + STANDARD_EVENT_ varchar(255), + SOURCE_ varchar(255), + VARIABLE_EVENT_ varchar(255), + VARIABLE_NAME_ varchar(255), + SATISFIED_ boolean, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create index on business key -- +create index ACT_IDX_CASE_EXEC_BUSKEY on ACT_RU_CASE_EXECUTION(BUSINESS_KEY_); + +-- https://app.camunda.com/jira/browse/CAM-9165 +create index ACT_IDX_CASE_EXE_CASE_INST on ACT_RU_CASE_EXECUTION(CASE_INST_ID_); + +-- create foreign key constraints on ACT_RU_CASE_EXECUTION -- +alter table ACT_RU_CASE_EXECUTION + add constraint ACT_FK_CASE_EXE_CASE_INST + foreign key (CASE_INST_ID_) + references ACT_RU_CASE_EXECUTION(ID_) on delete cascade on update cascade; + +alter table ACT_RU_CASE_EXECUTION + add constraint ACT_FK_CASE_EXE_PARENT + foreign key (PARENT_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +alter table ACT_RU_CASE_EXECUTION + add constraint ACT_FK_CASE_EXE_CASE_DEF + foreign key (CASE_DEF_ID_) + references ACT_RE_CASE_DEF(ID_); + +-- create foreign key constraints on ACT_RU_VARIABLE -- +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_CASE_EXE + foreign key (CASE_EXECUTION_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +alter table ACT_RU_VARIABLE + add constraint ACT_FK_VAR_CASE_INST + foreign key (CASE_INST_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +-- create foreign key constraints on ACT_RU_TASK -- +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_CASE_EXE + foreign key (CASE_EXECUTION_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +alter table ACT_RU_TASK + add constraint ACT_FK_TASK_CASE_DEF + foreign key (CASE_DEF_ID_) + references ACT_RE_CASE_DEF(ID_); + +-- create foreign key constraints on ACT_RU_CASE_SENTRY_PART -- +alter table ACT_RU_CASE_SENTRY_PART + add constraint ACT_FK_CASE_SENTRY_CASE_INST + foreign key (CASE_INST_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +alter table ACT_RU_CASE_SENTRY_PART + add constraint ACT_FK_CASE_SENTRY_CASE_EXEC + foreign key (CASE_EXEC_ID_) + references ACT_RU_CASE_EXECUTION(ID_); + +create index ACT_IDX_CASE_DEF_TENANT_ID on ACT_RE_CASE_DEF(TENANT_ID_); +create index ACT_IDX_CASE_EXEC_TENANT_ID on ACT_RU_CASE_EXECUTION(TENANT_ID_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +-- create decision definition table -- +create table ACT_RE_DECISION_DEF ( + ID_ varchar(64) not null, + REV_ integer, + CATEGORY_ varchar(255), + NAME_ varchar(255), + KEY_ varchar(255) not null, + VERSION_ integer not null, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + DGRM_RESOURCE_NAME_ varchar(4000), + DEC_REQ_ID_ varchar(64), + DEC_REQ_KEY_ varchar(255), + TENANT_ID_ varchar(64), + HISTORY_TTL_ integer, + VERSION_TAG_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create decision requirements definition table -- +create table ACT_RE_DECISION_REQ_DEF ( + ID_ varchar(64) NOT NULL, + REV_ integer, + CATEGORY_ varchar(255), + NAME_ varchar(255), + KEY_ varchar(255) NOT NULL, + VERSION_ integer NOT NULL, + DEPLOYMENT_ID_ varchar(64), + RESOURCE_NAME_ varchar(4000), + DGRM_RESOURCE_NAME_ varchar(4000), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +alter table ACT_RE_DECISION_DEF + add constraint ACT_FK_DEC_REQ + foreign key (DEC_REQ_ID_) + references ACT_RE_DECISION_REQ_DEF(ID_); + +create index ACT_IDX_DEC_DEF_TENANT_ID on ACT_RE_DECISION_DEF(TENANT_ID_); +create index ACT_IDX_DEC_DEF_REQ_ID on ACT_RE_DECISION_DEF(DEC_REQ_ID_); +create index ACT_IDX_DEC_REQ_DEF_TENANT_ID on ACT_RE_DECISION_REQ_DEF(TENANT_ID_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +create table ACT_HI_PROCINST ( + ID_ varchar(64) not null, + PROC_INST_ID_ varchar(64) not null, + BUSINESS_KEY_ varchar(255), + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64) not null, + START_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + REMOVAL_TIME_ datetime(3), + DURATION_ bigint, + START_USER_ID_ varchar(255), + START_ACT_ID_ varchar(255), + END_ACT_ID_ varchar(255), + SUPER_PROCESS_INSTANCE_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + SUPER_CASE_INSTANCE_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + DELETE_REASON_ varchar(4000), + TENANT_ID_ varchar(64), + STATE_ varchar(255), + primary key (ID_), + unique (PROC_INST_ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_ACTINST ( + ID_ varchar(64) not null, + PARENT_ACT_INST_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64) not null, + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64) not null, + EXECUTION_ID_ varchar(64) not null, + ACT_ID_ varchar(255) not null, + TASK_ID_ varchar(64), + CALL_PROC_INST_ID_ varchar(64), + CALL_CASE_INST_ID_ varchar(64), + ACT_NAME_ varchar(255), + ACT_TYPE_ varchar(255) not null, + ASSIGNEE_ varchar(255), + START_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + DURATION_ bigint, + ACT_INST_STATE_ integer, + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_TASKINST ( + ID_ varchar(64) not null, + TASK_DEF_KEY_ varchar(255), + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + CASE_DEF_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + ACT_INST_ID_ varchar(64), + NAME_ varchar(255), + PARENT_TASK_ID_ varchar(64), + DESCRIPTION_ varchar(4000), + OWNER_ varchar(255), + ASSIGNEE_ varchar(255), + START_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + DURATION_ bigint, + DELETE_REASON_ varchar(4000), + PRIORITY_ integer, + DUE_DATE_ datetime(3), + FOLLOW_UP_DATE_ datetime(3), + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_VARINST ( + ID_ varchar(64) not null, + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + ACT_INST_ID_ varchar(64), + CASE_DEF_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + NAME_ varchar(255) not null, + VAR_TYPE_ varchar(100), + CREATE_TIME_ datetime(3), + REV_ integer, + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + TENANT_ID_ varchar(64), + STATE_ varchar(20), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_DETAIL ( + ID_ varchar(64) not null, + TYPE_ varchar(255) not null, + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + CASE_DEF_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + ACT_INST_ID_ varchar(64), + VAR_INST_ID_ varchar(64), + NAME_ varchar(255) not null, + VAR_TYPE_ varchar(255), + REV_ integer, + TIME_ datetime(3) not null, + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + OPERATION_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + INITIAL_ boolean, + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_IDENTITYLINK ( + ID_ varchar(64) not null, + TIMESTAMP_ timestamp(3) not null, + TYPE_ varchar(255), + USER_ID_ varchar(255), + GROUP_ID_ varchar(255), + TASK_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + OPERATION_TYPE_ varchar(64), + ASSIGNER_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_COMMENT ( + ID_ varchar(64) not null, + TYPE_ varchar(255), + TIME_ datetime(3) not null, + USER_ID_ varchar(255), + TASK_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + ACTION_ varchar(255), + MESSAGE_ varchar(4000), + FULL_MSG_ LONGBLOB, + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_ATTACHMENT ( + ID_ varchar(64) not null, + REV_ integer, + USER_ID_ varchar(255), + NAME_ varchar(255), + DESCRIPTION_ varchar(4000), + TYPE_ varchar(255), + TASK_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + URL_ varchar(4000), + CONTENT_ID_ varchar(64), + TENANT_ID_ varchar(64), + CREATE_TIME_ datetime(3), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_OP_LOG ( + ID_ varchar(64) not null, + DEPLOYMENT_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + CASE_EXECUTION_ID_ varchar(64), + TASK_ID_ varchar(64), + JOB_ID_ varchar(64), + JOB_DEF_ID_ varchar(64), + BATCH_ID_ varchar(64), + USER_ID_ varchar(255), + TIMESTAMP_ timestamp(3) not null, + OPERATION_TYPE_ varchar(64), + OPERATION_ID_ varchar(64), + ENTITY_TYPE_ varchar(30), + PROPERTY_ varchar(64), + ORG_VALUE_ varchar(4000), + NEW_VALUE_ varchar(4000), + TENANT_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + CATEGORY_ varchar(64), + EXTERNAL_TASK_ID_ varchar(64), + ANNOTATION_ varchar(4000), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_INCIDENT ( + ID_ varchar(64) not null, + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + CREATE_TIME_ timestamp(3) not null, + END_TIME_ timestamp(3) null, + INCIDENT_MSG_ varchar(4000), + INCIDENT_TYPE_ varchar(255) not null, + ACTIVITY_ID_ varchar(255), + FAILED_ACTIVITY_ID_ varchar(255), + CAUSE_INCIDENT_ID_ varchar(64), + ROOT_CAUSE_INCIDENT_ID_ varchar(64), + CONFIGURATION_ varchar(255), + HISTORY_CONFIGURATION_ varchar(255), + INCIDENT_STATE_ integer, + TENANT_ID_ varchar(64), + JOB_DEF_ID_ varchar(64), + ANNOTATION_ varchar(4000), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_JOB_LOG ( + ID_ varchar(64) not null, + TIMESTAMP_ datetime(3) not null, + JOB_ID_ varchar(64) not null, + JOB_DUEDATE_ datetime(3) NULL, + JOB_RETRIES_ integer, + JOB_PRIORITY_ bigint NOT NULL DEFAULT 0, + JOB_EXCEPTION_MSG_ varchar(4000), + JOB_EXCEPTION_STACK_ID_ varchar(64), + JOB_STATE_ integer, + JOB_DEF_ID_ varchar(64), + JOB_DEF_TYPE_ varchar(255), + JOB_DEF_CONFIGURATION_ varchar(255), + ACT_ID_ varchar(255), + FAILED_ACT_ID_ varchar(255), + ROOT_PROC_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + PROCESS_INSTANCE_ID_ varchar(64), + PROCESS_DEF_ID_ varchar(64), + PROCESS_DEF_KEY_ varchar(255), + DEPLOYMENT_ID_ varchar(64), + SEQUENCE_COUNTER_ bigint, + TENANT_ID_ varchar(64), + HOSTNAME_ varchar(255), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_BATCH ( + ID_ varchar(64) not null, + TYPE_ varchar(255), + TOTAL_JOBS_ integer, + JOBS_PER_SEED_ integer, + INVOCATIONS_PER_JOB_ integer, + SEED_JOB_DEF_ID_ varchar(64), + MONITOR_JOB_DEF_ID_ varchar(64), + BATCH_JOB_DEF_ID_ varchar(64), + TENANT_ID_ varchar(64), + CREATE_USER_ID_ varchar(255), + START_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + REMOVAL_TIME_ datetime(3), + EXEC_START_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_EXT_TASK_LOG ( + ID_ varchar(64) not null, + TIMESTAMP_ timestamp(3) not null, + EXT_TASK_ID_ varchar(64) not null, + RETRIES_ integer, + TOPIC_NAME_ varchar(255), + WORKER_ID_ varchar(255), + PRIORITY_ bigint NOT NULL DEFAULT 0, + ERROR_MSG_ varchar(4000), + ERROR_DETAILS_ID_ varchar(64), + ACT_ID_ varchar(255), + ACT_INST_ID_ varchar(64), + EXECUTION_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + PROC_DEF_ID_ varchar(64), + PROC_DEF_KEY_ varchar(255), + TENANT_ID_ varchar(64), + STATE_ integer, + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_HI_PRO_INST_END on ACT_HI_PROCINST(END_TIME_); +create index ACT_IDX_HI_PRO_I_BUSKEY on ACT_HI_PROCINST(BUSINESS_KEY_); +create index ACT_IDX_HI_PRO_INST_TENANT_ID on ACT_HI_PROCINST(TENANT_ID_); +create index ACT_IDX_HI_PRO_INST_PROC_DEF_KEY on ACT_HI_PROCINST(PROC_DEF_KEY_); +create index ACT_IDX_HI_PRO_INST_PROC_TIME on ACT_HI_PROCINST(START_TIME_, END_TIME_); +create index ACT_IDX_HI_PI_PDEFID_END_TIME on ACT_HI_PROCINST(PROC_DEF_ID_, END_TIME_); +create index ACT_IDX_HI_PRO_INST_ROOT_PI on ACT_HI_PROCINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_PRO_INST_RM_TIME on ACT_HI_PROCINST(REMOVAL_TIME_); + +create index ACT_IDX_HI_ACTINST_ROOT_PI on ACT_HI_ACTINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_ACT_INST_START_END on ACT_HI_ACTINST(START_TIME_, END_TIME_); +create index ACT_IDX_HI_ACT_INST_END on ACT_HI_ACTINST(END_TIME_); +create index ACT_IDX_HI_ACT_INST_PROCINST on ACT_HI_ACTINST(PROC_INST_ID_, ACT_ID_); +create index ACT_IDX_HI_ACT_INST_COMP on ACT_HI_ACTINST(EXECUTION_ID_, ACT_ID_, END_TIME_, ID_); +create index ACT_IDX_HI_ACT_INST_STATS on ACT_HI_ACTINST(PROC_DEF_ID_, PROC_INST_ID_, ACT_ID_, END_TIME_, ACT_INST_STATE_); +create index ACT_IDX_HI_ACT_INST_TENANT_ID on ACT_HI_ACTINST(TENANT_ID_); +create index ACT_IDX_HI_ACT_INST_PROC_DEF_KEY on ACT_HI_ACTINST(PROC_DEF_KEY_); +create index ACT_IDX_HI_AI_PDEFID_END_TIME on ACT_HI_ACTINST(PROC_DEF_ID_, END_TIME_); +create index ACT_IDX_HI_ACT_INST_RM_TIME on ACT_HI_ACTINST(REMOVAL_TIME_); + +create index ACT_IDX_HI_TASKINST_ROOT_PI on ACT_HI_TASKINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_TASK_INST_TENANT_ID on ACT_HI_TASKINST(TENANT_ID_); +create index ACT_IDX_HI_TASK_INST_PROC_DEF_KEY on ACT_HI_TASKINST(PROC_DEF_KEY_); +create index ACT_IDX_HI_TASKINST_PROCINST on ACT_HI_TASKINST(PROC_INST_ID_); +create index ACT_IDX_HI_TASKINSTID_PROCINST on ACT_HI_TASKINST(ID_,PROC_INST_ID_); +create index ACT_IDX_HI_TASK_INST_RM_TIME on ACT_HI_TASKINST(REMOVAL_TIME_); +create index ACT_IDX_HI_TASK_INST_START on ACT_HI_TASKINST(START_TIME_); +create index ACT_IDX_HI_TASK_INST_END on ACT_HI_TASKINST(END_TIME_); + +create index ACT_IDX_HI_DETAIL_ROOT_PI on ACT_HI_DETAIL(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_DETAIL_PROC_INST on ACT_HI_DETAIL(PROC_INST_ID_); +create index ACT_IDX_HI_DETAIL_ACT_INST on ACT_HI_DETAIL(ACT_INST_ID_); +create index ACT_IDX_HI_DETAIL_CASE_INST on ACT_HI_DETAIL(CASE_INST_ID_); +create index ACT_IDX_HI_DETAIL_CASE_EXEC on ACT_HI_DETAIL(CASE_EXECUTION_ID_); +create index ACT_IDX_HI_DETAIL_TIME on ACT_HI_DETAIL(TIME_); +create index ACT_IDX_HI_DETAIL_NAME on ACT_HI_DETAIL(NAME_); +create index ACT_IDX_HI_DETAIL_TASK_ID on ACT_HI_DETAIL(TASK_ID_); +create index ACT_IDX_HI_DETAIL_TENANT_ID on ACT_HI_DETAIL(TENANT_ID_); +create index ACT_IDX_HI_DETAIL_PROC_DEF_KEY on ACT_HI_DETAIL(PROC_DEF_KEY_); +create index ACT_IDX_HI_DETAIL_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_); +create index ACT_IDX_HI_DETAIL_RM_TIME on ACT_HI_DETAIL(REMOVAL_TIME_); +create index ACT_IDX_HI_DETAIL_TASK_BYTEAR on ACT_HI_DETAIL(BYTEARRAY_ID_, TASK_ID_); +create index ACT_IDX_HI_DETAIL_VAR_INST_ID on ACT_HI_DETAIL(VAR_INST_ID_); + +create index ACT_IDX_HI_IDENT_LNK_ROOT_PI on ACT_HI_IDENTITYLINK(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_IDENT_LNK_USER on ACT_HI_IDENTITYLINK(USER_ID_); +create index ACT_IDX_HI_IDENT_LNK_GROUP on ACT_HI_IDENTITYLINK(GROUP_ID_); +create index ACT_IDX_HI_IDENT_LNK_TENANT_ID on ACT_HI_IDENTITYLINK(TENANT_ID_); +create index ACT_IDX_HI_IDENT_LNK_PROC_DEF_KEY on ACT_HI_IDENTITYLINK(PROC_DEF_KEY_); +create index ACT_IDX_HI_IDENT_LINK_TASK on ACT_HI_IDENTITYLINK(TASK_ID_); +create index ACT_IDX_HI_IDENT_LINK_RM_TIME on ACT_HI_IDENTITYLINK(REMOVAL_TIME_); +create index ACT_IDX_HI_IDENT_LNK_TIMESTAMP on ACT_HI_IDENTITYLINK(TIMESTAMP_); + +create index ACT_IDX_HI_VARINST_ROOT_PI on ACT_HI_VARINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_PROCVAR_PROC_INST on ACT_HI_VARINST(PROC_INST_ID_); +create index ACT_IDX_HI_PROCVAR_NAME_TYPE on ACT_HI_VARINST(NAME_, VAR_TYPE_); +create index ACT_IDX_HI_CASEVAR_CASE_INST on ACT_HI_VARINST(CASE_INST_ID_); +create index ACT_IDX_HI_VAR_INST_TENANT_ID on ACT_HI_VARINST(TENANT_ID_); +create index ACT_IDX_HI_VAR_INST_PROC_DEF_KEY on ACT_HI_VARINST(PROC_DEF_KEY_); +create index ACT_IDX_HI_VARINST_BYTEAR on ACT_HI_VARINST(BYTEARRAY_ID_); +create index ACT_IDX_HI_VARINST_RM_TIME on ACT_HI_VARINST(REMOVAL_TIME_); +create index ACT_IDX_HI_VAR_PI_NAME_TYPE on ACT_HI_VARINST(PROC_INST_ID_, NAME_, VAR_TYPE_); +create index ACT_IDX_HI_VARINST_NAME on ACT_HI_VARINST(NAME_); +create index ACT_IDX_HI_VARINST_ACT_INST_ID on ACT_HI_VARINST(ACT_INST_ID_); + +create index ACT_IDX_HI_INCIDENT_TENANT_ID on ACT_HI_INCIDENT(TENANT_ID_); +create index ACT_IDX_HI_INCIDENT_PROC_DEF_KEY on ACT_HI_INCIDENT(PROC_DEF_KEY_); +create index ACT_IDX_HI_INCIDENT_ROOT_PI on ACT_HI_INCIDENT(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_INCIDENT_PROCINST on ACT_HI_INCIDENT(PROC_INST_ID_); +create index ACT_IDX_HI_INCIDENT_RM_TIME on ACT_HI_INCIDENT(REMOVAL_TIME_); +create index ACT_IDX_HI_INCIDENT_CREATE_TIME on ACT_HI_INCIDENT(CREATE_TIME_); +create index ACT_IDX_HI_INCIDENT_END_TIME on ACT_HI_INCIDENT(END_TIME_); + +create index ACT_IDX_HI_JOB_LOG_ROOT_PI on ACT_HI_JOB_LOG(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_JOB_LOG_PROCINST on ACT_HI_JOB_LOG(PROCESS_INSTANCE_ID_); +create index ACT_IDX_HI_JOB_LOG_PROCDEF on ACT_HI_JOB_LOG(PROCESS_DEF_ID_); +create index ACT_IDX_HI_JOB_LOG_TENANT_ID on ACT_HI_JOB_LOG(TENANT_ID_); +create index ACT_IDX_HI_JOB_LOG_JOB_DEF_ID on ACT_HI_JOB_LOG(JOB_DEF_ID_); +create index ACT_IDX_HI_JOB_LOG_PROC_DEF_KEY on ACT_HI_JOB_LOG(PROCESS_DEF_KEY_); +create index ACT_IDX_HI_JOB_LOG_EX_STACK on ACT_HI_JOB_LOG(JOB_EXCEPTION_STACK_ID_); +create index ACT_IDX_HI_JOB_LOG_RM_TIME on ACT_HI_JOB_LOG(REMOVAL_TIME_); +create index ACT_IDX_HI_JOB_LOG_JOB_CONF on ACT_HI_JOB_LOG(JOB_DEF_CONFIGURATION_); + +create index ACT_HI_BAT_RM_TIME on ACT_HI_BATCH(REMOVAL_TIME_); + +create index ACT_HI_EXT_TASK_LOG_ROOT_PI on ACT_HI_EXT_TASK_LOG(ROOT_PROC_INST_ID_); +create index ACT_HI_EXT_TASK_LOG_PROCINST on ACT_HI_EXT_TASK_LOG(PROC_INST_ID_); +create index ACT_HI_EXT_TASK_LOG_PROCDEF on ACT_HI_EXT_TASK_LOG(PROC_DEF_ID_); +create index ACT_HI_EXT_TASK_LOG_PROC_DEF_KEY on ACT_HI_EXT_TASK_LOG(PROC_DEF_KEY_); +create index ACT_HI_EXT_TASK_LOG_TENANT_ID on ACT_HI_EXT_TASK_LOG(TENANT_ID_); +create index ACT_IDX_HI_EXTTASKLOG_ERRORDET on ACT_HI_EXT_TASK_LOG(ERROR_DETAILS_ID_); +create index ACT_HI_EXT_TASK_LOG_RM_TIME on ACT_HI_EXT_TASK_LOG(REMOVAL_TIME_); + +create index ACT_IDX_HI_OP_LOG_ROOT_PI on ACT_HI_OP_LOG(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_OP_LOG_PROCINST on ACT_HI_OP_LOG(PROC_INST_ID_); +create index ACT_IDX_HI_OP_LOG_PROCDEF on ACT_HI_OP_LOG(PROC_DEF_ID_); +create index ACT_IDX_HI_OP_LOG_TASK on ACT_HI_OP_LOG(TASK_ID_); +create index ACT_IDX_HI_OP_LOG_RM_TIME on ACT_HI_OP_LOG(REMOVAL_TIME_); +create index ACT_IDX_HI_OP_LOG_TIMESTAMP on ACT_HI_OP_LOG(TIMESTAMP_); +create index ACT_IDX_HI_OP_LOG_USER_ID on ACT_HI_OP_LOG(USER_ID_); +create index ACT_IDX_HI_OP_LOG_OP_TYPE on ACT_HI_OP_LOG(OPERATION_TYPE_); +create index ACT_IDX_HI_OP_LOG_ENTITY_TYPE on ACT_HI_OP_LOG(ENTITY_TYPE_); + +create index ACT_IDX_HI_COMMENT_TASK on ACT_HI_COMMENT(TASK_ID_); +create index ACT_IDX_HI_COMMENT_ROOT_PI on ACT_HI_COMMENT(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_COMMENT_PROCINST on ACT_HI_COMMENT(PROC_INST_ID_); +create index ACT_IDX_HI_COMMENT_RM_TIME on ACT_HI_COMMENT(REMOVAL_TIME_); + +create index ACT_IDX_HI_ATTACHMENT_CONTENT on ACT_HI_ATTACHMENT(CONTENT_ID_); +create index ACT_IDX_HI_ATTACHMENT_ROOT_PI on ACT_HI_ATTACHMENT(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_ATTACHMENT_PROCINST on ACT_HI_ATTACHMENT(PROC_INST_ID_); +create index ACT_IDX_HI_ATTACHMENT_TASK on ACT_HI_ATTACHMENT(TASK_ID_); +create index ACT_IDX_HI_ATTACHMENT_RM_TIME on ACT_HI_ATTACHMENT(REMOVAL_TIME_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +create table ACT_HI_CASEINST ( + ID_ varchar(64) not null, + CASE_INST_ID_ varchar(64) not null, + BUSINESS_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64) not null, + CREATE_TIME_ datetime(3) not null, + CLOSE_TIME_ datetime(3), + DURATION_ bigint, + STATE_ integer, + CREATE_USER_ID_ varchar(255), + SUPER_CASE_INSTANCE_ID_ varchar(64), + SUPER_PROCESS_INSTANCE_ID_ varchar(64), + TENANT_ID_ varchar(64), + primary key (ID_), + unique (CASE_INST_ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_HI_CASEACTINST ( + ID_ varchar(64) not null, + PARENT_ACT_INST_ID_ varchar(64), + CASE_DEF_ID_ varchar(64) not null, + CASE_INST_ID_ varchar(64) not null, + CASE_ACT_ID_ varchar(255) not null, + TASK_ID_ varchar(64), + CALL_PROC_INST_ID_ varchar(64), + CALL_CASE_INST_ID_ varchar(64), + CASE_ACT_NAME_ varchar(255), + CASE_ACT_TYPE_ varchar(255), + CREATE_TIME_ datetime(3) not null, + END_TIME_ datetime(3), + DURATION_ bigint, + STATE_ integer, + REQUIRED_ boolean, + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create index ACT_IDX_HI_CAS_I_CLOSE on ACT_HI_CASEINST(CLOSE_TIME_); +create index ACT_IDX_HI_CAS_I_BUSKEY on ACT_HI_CASEINST(BUSINESS_KEY_); +create index ACT_IDX_HI_CAS_I_TENANT_ID on ACT_HI_CASEINST(TENANT_ID_); +create index ACT_IDX_HI_CAS_A_I_CREATE on ACT_HI_CASEACTINST(CREATE_TIME_); +create index ACT_IDX_HI_CAS_A_I_END on ACT_HI_CASEACTINST(END_TIME_); +create index ACT_IDX_HI_CAS_A_I_COMP on ACT_HI_CASEACTINST(CASE_ACT_ID_, END_TIME_, ID_); +create index ACT_IDX_HI_CAS_A_I_CASEINST on ACT_HI_CASEACTINST(CASE_INST_ID_, CASE_ACT_ID_); +create index ACT_IDX_HI_CAS_A_I_TENANT_ID on ACT_HI_CASEACTINST(TENANT_ID_); +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +-- create history decision instance table -- +create table ACT_HI_DECINST ( + ID_ varchar(64) NOT NULL, + DEC_DEF_ID_ varchar(64) NOT NULL, + DEC_DEF_KEY_ varchar(255) NOT NULL, + DEC_DEF_NAME_ varchar(255), + PROC_DEF_KEY_ varchar(255), + PROC_DEF_ID_ varchar(64), + PROC_INST_ID_ varchar(64), + CASE_DEF_KEY_ varchar(255), + CASE_DEF_ID_ varchar(64), + CASE_INST_ID_ varchar(64), + ACT_INST_ID_ varchar(64), + ACT_ID_ varchar(255), + EVAL_TIME_ datetime(3) not null, + REMOVAL_TIME_ datetime(3), + COLLECT_VALUE_ double, + USER_ID_ varchar(255), + ROOT_DEC_INST_ID_ varchar(64), + ROOT_PROC_INST_ID_ varchar(64), + DEC_REQ_ID_ varchar(64), + DEC_REQ_KEY_ varchar(255), + TENANT_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create history decision input table -- +create table ACT_HI_DEC_IN ( + ID_ varchar(64) NOT NULL, + DEC_INST_ID_ varchar(64) NOT NULL, + CLAUSE_ID_ varchar(64), + CLAUSE_NAME_ varchar(255), + VAR_TYPE_ varchar(100), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + TENANT_ID_ varchar(64), + CREATE_TIME_ datetime(3), + ROOT_PROC_INST_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +-- create history decision output table -- +create table ACT_HI_DEC_OUT ( + ID_ varchar(64) NOT NULL, + DEC_INST_ID_ varchar(64) NOT NULL, + CLAUSE_ID_ varchar(64), + CLAUSE_NAME_ varchar(255), + RULE_ID_ varchar(64), + RULE_ORDER_ integer, + VAR_NAME_ varchar(255), + VAR_TYPE_ varchar(100), + BYTEARRAY_ID_ varchar(64), + DOUBLE_ double, + LONG_ bigint, + TEXT_ varchar(4000), + TEXT2_ varchar(4000), + TENANT_ID_ varchar(64), + CREATE_TIME_ datetime(3), + ROOT_PROC_INST_ID_ varchar(64), + REMOVAL_TIME_ datetime(3), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + + +create index ACT_IDX_HI_DEC_INST_ID on ACT_HI_DECINST(DEC_DEF_ID_); +create index ACT_IDX_HI_DEC_INST_KEY on ACT_HI_DECINST(DEC_DEF_KEY_); +create index ACT_IDX_HI_DEC_INST_PI on ACT_HI_DECINST(PROC_INST_ID_); +create index ACT_IDX_HI_DEC_INST_CI on ACT_HI_DECINST(CASE_INST_ID_); +create index ACT_IDX_HI_DEC_INST_ACT on ACT_HI_DECINST(ACT_ID_); +create index ACT_IDX_HI_DEC_INST_ACT_INST on ACT_HI_DECINST(ACT_INST_ID_); +create index ACT_IDX_HI_DEC_INST_TIME on ACT_HI_DECINST(EVAL_TIME_); +create index ACT_IDX_HI_DEC_INST_TENANT_ID on ACT_HI_DECINST(TENANT_ID_); +create index ACT_IDX_HI_DEC_INST_ROOT_ID on ACT_HI_DECINST(ROOT_DEC_INST_ID_); +create index ACT_IDX_HI_DEC_INST_REQ_ID on ACT_HI_DECINST(DEC_REQ_ID_); +create index ACT_IDX_HI_DEC_INST_REQ_KEY on ACT_HI_DECINST(DEC_REQ_KEY_); +create index ACT_IDX_HI_DEC_INST_ROOT_PI on ACT_HI_DECINST(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_DEC_INST_RM_TIME on ACT_HI_DECINST(REMOVAL_TIME_); + + +create index ACT_IDX_HI_DEC_IN_INST on ACT_HI_DEC_IN(DEC_INST_ID_); +create index ACT_IDX_HI_DEC_IN_CLAUSE on ACT_HI_DEC_IN(DEC_INST_ID_, CLAUSE_ID_); +create index ACT_IDX_HI_DEC_IN_ROOT_PI on ACT_HI_DEC_IN(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_DEC_IN_RM_TIME on ACT_HI_DEC_IN(REMOVAL_TIME_); + +create index ACT_IDX_HI_DEC_OUT_INST on ACT_HI_DEC_OUT(DEC_INST_ID_); +create index ACT_IDX_HI_DEC_OUT_RULE on ACT_HI_DEC_OUT(RULE_ORDER_, CLAUSE_ID_); +create index ACT_IDX_HI_DEC_OUT_ROOT_PI on ACT_HI_DEC_OUT(ROOT_PROC_INST_ID_); +create index ACT_IDX_HI_DEC_OUT_RM_TIME on ACT_HI_DEC_OUT(REMOVAL_TIME_); diff --git a/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_2__mariadb_identity_7.21.0.sql b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_2__mariadb_identity_7.21.0.sql new file mode 100644 index 000000000..dded0b4b8 --- /dev/null +++ b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_2__mariadb_identity_7.21.0.sql @@ -0,0 +1,104 @@ +-- +-- Copyright Camunda Services GmbH and/or licensed to Camunda Services GmbH +-- under one or more contributor license agreements. See the NOTICE file +-- distributed with this work for additional information regarding copyright +-- ownership. Camunda licenses this file to you under the Apache License, +-- Version 2.0; you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +create table ACT_ID_GROUP ( + ID_ varchar(64), + REV_ integer, + NAME_ varchar(255), + TYPE_ varchar(255), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_ID_MEMBERSHIP ( + USER_ID_ varchar(64), + GROUP_ID_ varchar(64), + primary key (USER_ID_, GROUP_ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_ID_USER ( + ID_ varchar(64), + REV_ integer, + FIRST_ varchar(255), + LAST_ varchar(255), + EMAIL_ varchar(255), + PWD_ varchar(255), + SALT_ varchar(255), + LOCK_EXP_TIME_ datetime(3) NULL, + ATTEMPTS_ integer, + PICTURE_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_ID_INFO ( + ID_ varchar(64), + REV_ integer, + USER_ID_ varchar(64), + TYPE_ varchar(64), + KEY_ varchar(255), + VALUE_ varchar(255), + PASSWORD_ LONGBLOB, + PARENT_ID_ varchar(255), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_ID_TENANT ( + ID_ varchar(64), + REV_ integer, + NAME_ varchar(255), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +create table ACT_ID_TENANT_MEMBER ( + ID_ varchar(64) not null, + TENANT_ID_ varchar(64) not null, + USER_ID_ varchar(64), + GROUP_ID_ varchar(64), + primary key (ID_) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_bin; + +alter table ACT_ID_MEMBERSHIP + add constraint ACT_FK_MEMB_GROUP + foreign key (GROUP_ID_) + references ACT_ID_GROUP (ID_); + +alter table ACT_ID_MEMBERSHIP + add constraint ACT_FK_MEMB_USER + foreign key (USER_ID_) + references ACT_ID_USER (ID_); + +alter table ACT_ID_TENANT_MEMBER + add constraint ACT_UNIQ_TENANT_MEMB_USER + unique (TENANT_ID_, USER_ID_); + +alter table ACT_ID_TENANT_MEMBER + add constraint ACT_UNIQ_TENANT_MEMB_GROUP + unique (TENANT_ID_, GROUP_ID_); + +alter table ACT_ID_TENANT_MEMBER + add constraint ACT_FK_TENANT_MEMB + foreign key (TENANT_ID_) + references ACT_ID_TENANT (ID_); + +alter table ACT_ID_TENANT_MEMBER + add constraint ACT_FK_TENANT_MEMB_USER + foreign key (USER_ID_) + references ACT_ID_USER (ID_); + +alter table ACT_ID_TENANT_MEMBER + add constraint ACT_FK_TENANT_MEMB_GROUP + foreign key (GROUP_ID_) + references ACT_ID_GROUP (ID_); diff --git a/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_3__admin.sql b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_3__admin.sql new file mode 100644 index 000000000..57e037cb1 --- /dev/null +++ b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_3__admin.sql @@ -0,0 +1,46 @@ +-- Create admin user (password: admin) +INSERT INTO ACT_ID_USER (ID_, REV_, FIRST_, LAST_, EMAIL_, PWD_, PICTURE_ID_) +VALUES ('admin', 1, 'Admin', 'Administratus', 'bpm@holunda.io', '{SHA}0DPiKuNIrrVmD8IUCuw1hQxNqZc=', null); + +-- Create admin group +INSERT INTO ACT_ID_GROUP (ID_, REV_, NAME_, TYPE_) +VALUES ('camunda-admin', 1, 'Camunda BPM Administrators', 'SYSTEM'); + +-- Add admin user to admin group +INSERT into ACT_ID_MEMBERSHIP (USER_ID_, GROUP_ID_) +VALUES ('admin', 'camunda-admin'); + +-- Add authorizations +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A1', 1, 1, null, 'admin', 1, 'admin', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A2', 1, 1, 'camunda-admin', null, 0, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A3', 1, 1, 'camunda-admin', null, 1, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A4', 1, 1, 'camunda-admin', null, 2, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A5', 1, 1, 'camunda-admin', null, 3, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A6', 1, 1, 'camunda-admin', null, 4, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A7', 1, 1, 'camunda-admin', null, 5, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A8', 1, 1, 'camunda-admin', null, 6, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A9', 1, 1, 'camunda-admin', null, 7, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A10', 1, 1, 'camunda-admin', null, 8, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A11', 1, 1, 'camunda-admin', null, 9, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A12', 1, 1, 'camunda-admin', null, 10, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A13', 1, 1, 'camunda-admin', null, 11, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A14', 1, 1, 'camunda-admin', null, 12, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A15', 1, 1, 'camunda-admin', null, 13, '*', 2147483647); +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A16', 1, 1, 'camunda-admin', null, 14, '*', 2147483647); + diff --git a/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_4__tasklist_filters.sql b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_4__tasklist_filters.sql new file mode 100644 index 000000000..c73b58032 --- /dev/null +++ b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_4__tasklist_filters.sql @@ -0,0 +1,7 @@ +-- All tasks excludes just for admin +INSERT INTO ACT_RU_FILTER (ID_, REV_, RESOURCE_TYPE_, NAME_, OWNER_, QUERY_, PROPERTIES_) +VALUES ('F000', 1, 'Task', 'All Tasks', 'admin', '{}', + '{"showUndefinedVariable":false,"description":"All tasks (for admin use only!)","refresh":true,"priority":0}'); + +INSERT INTO ACT_RU_AUTHORIZATION (ID_, REV_, TYPE_, GROUP_ID_, USER_ID_, RESOURCE_TYPE_, RESOURCE_ID_, PERMS_) +VALUES ('A20', 1, 1, null, 'admin', 5, 'F000', 2147483647); diff --git a/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_5__axon.sql b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_5__axon.sql new file mode 100644 index 000000000..94bdc3776 --- /dev/null +++ b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_5__axon.sql @@ -0,0 +1,75 @@ +CREATE SEQUENCE hibernate_sequence START WITH 1 INCREMENT BY 1; + +CREATE TABLE association_value_entry +( + id BIGINT NOT NULL, + association_key VARCHAR(255) NOT NULL, + association_value VARCHAR(255), + saga_id VARCHAR(255) NOT NULL, + saga_type VARCHAR(255), + PRIMARY KEY (id) +); + +CREATE TABLE domain_event_entry +( + global_index BIGINT NOT NULL, + event_identifier VARCHAR(255) NOT NULL, + meta_data BLOB, + payload BLOB NOT NULL, + payload_revision VARCHAR(255), + payload_type VARCHAR(255) NOT NULL, + time_stamp VARCHAR(255) NOT NULL, + aggregate_identifier VARCHAR(255) NOT NULL, + sequence_number BIGINT NOT NULL, + type VARCHAR(255), + PRIMARY KEY (global_index) +); + +CREATE TABLE saga_entry +( + saga_id VARCHAR(255) NOT NULL, + revision VARCHAR(255), + saga_type VARCHAR(255), + serialized_saga BLOB, + PRIMARY KEY (saga_id) +); + +CREATE TABLE snapshot_event_entry +( + aggregate_identifier VARCHAR(255) NOT NULL, + sequence_number BIGINT NOT NULL, + type VARCHAR(255) NOT NULL, + event_identifier VARCHAR(255) NOT NULL, + meta_data BLOB, + payload BLOB NOT NULL, + payload_revision VARCHAR(255), + payload_type VARCHAR(255) NOT NULL, + time_stamp VARCHAR(255) NOT NULL, + PRIMARY KEY (aggregate_identifier, sequence_number, type) +); + +CREATE TABLE token_entry +( + processor_name VARCHAR(255) NOT NULL, + segment INTEGER NOT NULL, + owner VARCHAR(255), + timestamp VARCHAR(255) NOT NULL, + token BLOB, + token_type VARCHAR(255), + PRIMARY KEY (processor_name, segment) +); + + +CREATE INDEX IDXk45eqnxkgd8hpdn6xixn8sgft ON association_value_entry (saga_type, association_key, association_value); +CREATE INDEX IDXgv5k1v2mh6frxuy5c0hgbau94 ON association_value_entry (saga_id, saga_type); + +ALTER TABLE domain_event_entry + ADD CONSTRAINT UK8s1f994p4la2ipb13me2xqm1w UNIQUE (aggregate_identifier, sequence_number); + +ALTER TABLE domain_event_entry + ADD CONSTRAINT UK_fwe6lsa8bfo6hyas6ud3m8c7x UNIQUE (event_identifier); + +ALTER TABLE snapshot_event_entry + ADD CONSTRAINT UK_e1uucjseo68gopmnd0vgdl44h UNIQUE (event_identifier); + + diff --git a/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_6__request.sql b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_6__request.sql new file mode 100644 index 000000000..d4aee7e21 --- /dev/null +++ b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_6__request.sql @@ -0,0 +1,9 @@ +create table APP_APPROVAL_REQUEST +( + id varchar(255) not null, + amount decimal(10, 2), + applicant varchar(255), + currency varchar(255), + subject varchar(255), + primary key (id) +); diff --git a/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_7__jpa_view.sql b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_7__jpa_view.sql new file mode 100644 index 000000000..4a7f1d2f5 --- /dev/null +++ b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_7__jpa_view.sql @@ -0,0 +1,176 @@ + +create table plf_data_entry +( + entry_id varchar(255) not null, + entry_type varchar(255) not null, + application_name varchar(255) not null, + date_created datetime(6) not null, + date_deleted datetime(6), + description varchar(2048), + form_key varchar(255), + date_last_modified datetime(6) not null, + name varchar(255) not null, + payload longtext, + revision bigint, + processing_type varchar(255) not null, + state varchar(255) not null, + type varchar(255) not null, + primary key (entry_id, entry_type) +); + +create table plf_data_entry_authorizations +( + entry_id varchar(255) not null, + entry_type varchar(255) not null, + authorized_principal varchar(255) not null, + primary key (entry_id, entry_type, authorized_principal) +); + +create table plf_data_entry_payload_attributes +( + entry_id varchar(64) not null, + entry_type varchar(128) not null, + path varchar(255) not null, + value varchar(128) not null, + primary key (entry_id, entry_type, path, value) +); + +create table plf_data_entry_protocol +( + id varchar(255) not null, + log_details varchar(255), + log_message varchar(255), + processing_type varchar(255) not null, + state varchar(255) not null, + time datetime(6) not null, + username varchar(255), + entry_id varchar(255) not null, + entry_type varchar(255) not null, + primary key (id) +); + +create table plf_proc_def +( + proc_def_id varchar(255) not null, + application_name varchar(255) not null, + description varchar(2048), + name varchar(255) not null, + proc_def_key varchar(255) not null, + proc_def_version integer not null, + start_form_key varchar(255), + startable_from_tasklist bit, + version_tag varchar(255), + primary key (proc_def_id) +); + +create table plf_proc_def_authorizations +( + proc_def_id varchar(255) not null, + authorized_starter_principal varchar(255) not null, + primary key (proc_def_id, authorized_starter_principal) +); + +create table plf_proc_instance +( + instance_id varchar(255) not null, + business_key varchar(255), + delete_reason varchar(255), + end_activity_id varchar(255), + application_name varchar(255) not null, + source_def_id varchar(255) not null, + source_def_key varchar(255) not null, + source_execution_id varchar(255) not null, + source_instance_id varchar(255) not null, + source_name varchar(255) not null, + source_type varchar(255) not null, + source_tenant_id varchar(255), + start_activity_id varchar(255), + start_user_id varchar(255), + run_state varchar(255) not null, + super_instance_id varchar(255), + primary key (instance_id) +); + +create table plf_task +( + task_id varchar(255) not null, + assignee_id varchar(255), + business_key varchar(255), + date_created datetime(6) not null, + description varchar(2048), + date_due datetime(6), + date_follow_up datetime(6), + form_key varchar(255), + name varchar(255) not null, + owner_id varchar(255), + payload longtext, + priority integer, + application_name varchar(255) not null, + source_def_id varchar(255) not null, + source_def_key varchar(255) not null, + source_execution_id varchar(255) not null, + source_instance_id varchar(255) not null, + source_name varchar(255) not null, + source_type varchar(255) not null, + source_tenant_id varchar(255), + task_def_key varchar(255) not null, + primary key (task_id) +); + +create table plf_task_authorizations +( + task_id varchar(255) not null, + authorized_principal varchar(255) not null, + primary key (task_id, authorized_principal) +); + +create table plf_task_correlations +( + task_id varchar(255) not null, + entry_id varchar(255) not null, + entry_type varchar(255) not null, + primary key (task_id, entry_id, entry_type) +); + +create table plf_task_payload_attributes +( + task_id varchar(255) not null, + path varchar(255) not null, + value varchar(255) not null, + primary key (task_id, path, value) +); + +ALTER TABLE plf_data_entry_authorizations + ADD CONSTRAINT FK_authorizations_have_data_entry + FOREIGN KEY (entry_id, entry_type) + REFERENCES plf_data_entry; + +ALTER TABLE plf_data_entry_payload_attributes + ADD CONSTRAINT FK_payload_attributes_have_data_entry + FOREIGN KEY (entry_id, entry_type) + REFERENCES plf_data_entry; + +ALTER TABLE plf_data_entry_protocol + ADD CONSTRAINT FK_protocol_have_data_entry + FOREIGN KEY (entry_id, entry_type) + REFERENCES plf_data_entry; + +ALTER TABLE plf_proc_def_authorizations + ADD CONSTRAINT FK_authorizations_have_proc_def + FOREIGN KEY (proc_def_id) + REFERENCES plf_proc_def; + +ALTER TABLE plf_task_authorizations + ADD CONSTRAINT FK_authorizations_have_task + FOREIGN KEY (task_id) + REFERENCES plf_task; + +ALTER TABLE plf_task_correlations + ADD CONSTRAINT FK_correlation_have_task + FOREIGN KEY (task_id) + REFERENCES plf_task; + +ALTER TABLE plf_task_payload_attributes + ADD CONSTRAINT FK_payload_attributes_have_task + FOREIGN KEY (task_id) + REFERENCES plf_task; diff --git a/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_8__axon_dlq.sql b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_8__axon_dlq.sql new file mode 100644 index 000000000..cb3f21ec2 --- /dev/null +++ b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_8__axon_dlq.sql @@ -0,0 +1,26 @@ +CREATE TABLE dead_letter_entry +( + dead_letter_id VARCHAR(255) NOT NULL, + cause_message VARCHAR(255), + cause_type VARCHAR(255), + diagnostics LONGBLOB, + enqueued_at TIMESTAMP NOT NULL, + last_touched TIMESTAMP, + aggregate_identifier VARCHAR(255), + event_identifier VARCHAR(255) NOT NULL, + message_type VARCHAR(255) NOT NULL, + meta_data LONGBLOB, + payload LONGBLOB NOT NULL, + payload_revision VARCHAR(255), + payload_type VARCHAR(255) NOT NULL, + sequence_number INT8, + time_stamp VARCHAR(255) NOT NULL, + token LONGBLOB, + token_type VARCHAR(255), + type VARCHAR(255), + processing_group VARCHAR(255) NOT NULL, + processing_started TIMESTAMP, + sequence_identifier VARCHAR(255) NOT NULL, + sequence_index INT8 NOT NULL, + PRIMARY KEY (dead_letter_id) +); diff --git a/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_9__axon_sequences_per_table.sql b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_9__axon_sequences_per_table.sql new file mode 100644 index 000000000..ad82813be --- /dev/null +++ b/view/jpa/src/test/resources/db/migrations/mariadb/V0_0_9__axon_sequences_per_table.sql @@ -0,0 +1,5 @@ +DROP SEQUENCE hibernate_sequence; + +CREATE SEQUENCE association_value_entry_seq START WITH 1 INCREMENT BY 50; + +CREATE SEQUENCE domain_event_entry_seq START WITH 1 INCREMENT BY 50; diff --git a/view/mongo/pom.xml b/view/mongo/pom.xml index d9b471e43..0f2dbce60 100644 --- a/view/mongo/pom.xml +++ b/view/mongo/pom.xml @@ -49,11 +49,16 @@ test - de.flapdoodle.embed - de.flapdoodle.embed.mongo.spring30x - 4.11.0 + org.testcontainers + junit-jupiter test + + org.testcontainers + mongodb + test + + com.tngtech.jgiven jgiven-junit5 diff --git a/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/PolyflowMongoTestApplication.kt b/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/PolyflowMongoTestApplication.kt deleted file mode 100644 index 920a7a305..000000000 --- a/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/PolyflowMongoTestApplication.kt +++ /dev/null @@ -1,7 +0,0 @@ -package io.holunda.polyflow.view.mongo - -import de.flapdoodle.embed.mongo.spring.autoconfigure.EmbeddedMongoAutoConfiguration -import org.springframework.boot.autoconfigure.SpringBootApplication - -@SpringBootApplication(exclude = [EmbeddedMongoAutoConfiguration::class]) -class PolyflowMongoTestApplication diff --git a/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/service/PolyflowMongoServiceChangeStreamChangeTrackingITest.kt b/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/service/PolyflowMongoServiceChangeStreamChangeTrackingITest.kt index efeaf08e4..3bafc1993 100644 --- a/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/service/PolyflowMongoServiceChangeStreamChangeTrackingITest.kt +++ b/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/service/PolyflowMongoServiceChangeStreamChangeTrackingITest.kt @@ -1,38 +1,38 @@ package io.holunda.polyflow.view.mongo.service -import io.holunda.polyflow.view.mongo.utils.MongoLauncher -import org.junit.jupiter.api.AfterAll +import io.holunda.polyflow.view.mongo.TaskPoolMongoViewConfiguration import org.junit.jupiter.api.AfterEach -import org.junit.jupiter.api.BeforeAll -import org.springframework.test.context.ActiveProfiles -import org.springframework.test.context.TestPropertySource +import org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTest +import org.springframework.test.context.* +import org.testcontainers.containers.MongoDBContainer +import org.testcontainers.junit.jupiter.Container +import org.testcontainers.junit.jupiter.Testcontainers @TestPropertySource( properties = [ "polyflow.view.mongo.changeTrackingMode=CHANGE_STREAM", - "spring.data.mongodb.database=TaskPoolMongoServiceChangeStreamChangeTrackingITest" ] ) @ActiveProfiles("itest-replicated") +@Testcontainers +@DataMongoTest +@ContextConfiguration(classes = [TaskPoolMongoViewConfiguration::class]) class PolyflowMongoServiceChangeStreamChangeTrackingITest : PolyflowMongoServiceITestBase() { companion object { - private val mongo = MongoLauncher.MongoInstance(true, "TaskPoolMongoServiceChangeStreamChangeTrackingITest") - - @BeforeAll + @Container @JvmStatic - fun initMongo() { - mongo.init() - } + var mongoDBContainer: MongoDBContainer = MongoDBContainer("mongo:4.4.2") + .withCommand("mongod", "--replSet", "myReplicaSet") - @AfterAll + @DynamicPropertySource @JvmStatic - fun stop() { - mongo.stop() + fun setProperties(registry: DynamicPropertyRegistry) { + registry.add("spring.data.mongodb.uri") { mongoDBContainer.replicaSetUrl } } } @AfterEach fun clearMongo() { - mongo.clear() + mongoDBContainer.clear() } } diff --git a/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/service/PolyflowMongoServiceEventHandlerChangeTrackingITest.kt b/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/service/PolyflowMongoServiceEventHandlerChangeTrackingITest.kt index aef82e655..360090ed9 100644 --- a/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/service/PolyflowMongoServiceEventHandlerChangeTrackingITest.kt +++ b/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/service/PolyflowMongoServiceEventHandlerChangeTrackingITest.kt @@ -1,38 +1,45 @@ package io.holunda.polyflow.view.mongo.service -import io.holunda.polyflow.view.mongo.utils.MongoLauncher -import org.junit.jupiter.api.AfterAll +import com.mongodb.client.MongoClients +import io.holunda.polyflow.view.mongo.TaskPoolMongoViewConfiguration +import org.axonframework.extensions.mongo.MongoTemplate import org.junit.jupiter.api.AfterEach -import org.junit.jupiter.api.BeforeAll -import org.springframework.test.context.ActiveProfiles -import org.springframework.test.context.TestPropertySource +import org.springframework.beans.factory.annotation.Autowired +import org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTest +import org.springframework.test.context.* +import org.testcontainers.containers.MongoDBContainer +import org.testcontainers.junit.jupiter.Container +import org.testcontainers.junit.jupiter.Testcontainers + @TestPropertySource( properties = [ "polyflow.view.mongo.changeTrackingMode=EVENT_HANDLER", - "spring.data.mongodb.database=TaskPoolMongoServiceEventHandlerChangeTrackingITest" ] ) @ActiveProfiles("itest-standalone") +@Testcontainers +@DataMongoTest +@ContextConfiguration(classes = [TaskPoolMongoViewConfiguration::class]) class PolyflowMongoServiceEventHandlerChangeTrackingITest : PolyflowMongoServiceITestBase() { companion object { - private val mongo = MongoLauncher.MongoInstance(false, "TaskPoolMongoServiceEventHandlerChangeTrackingITest") - - @BeforeAll + @Container @JvmStatic - fun initMongo() { - mongo.init() - } + var mongoDBContainer: MongoDBContainer = MongoDBContainer("mongo:4.4.2") - @AfterAll + @DynamicPropertySource @JvmStatic - fun stop() { - mongo.stop() + fun setProperties(registry: DynamicPropertyRegistry) { + registry.add("spring.data.mongodb.uri") { mongoDBContainer.replicaSetUrl } } } + @Autowired + var mongoTemplate: MongoTemplate? = null + @AfterEach fun clearMongo() { - mongo.clear() + mongoDBContainer.clear() } } + diff --git a/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/service/PolyflowMongoServiceTestBase.kt b/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/service/PolyflowMongoServiceTestBase.kt index fce9f3ffa..e321bdc05 100755 --- a/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/service/PolyflowMongoServiceTestBase.kt +++ b/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/service/PolyflowMongoServiceTestBase.kt @@ -1,5 +1,6 @@ package io.holunda.polyflow.view.mongo.service +import com.mongodb.client.MongoClients import com.tngtech.jgiven.integration.spring.junit5.SpringScenarioTest import com.tngtech.jgiven.junit5.JGivenExtension import io.holunda.camunda.taskpool.api.business.* @@ -9,20 +10,18 @@ import io.holunda.polyflow.view.ProtocolEntry import io.holunda.polyflow.view.Task import io.holunda.polyflow.view.TaskWithDataEntries import io.holunda.polyflow.view.auth.User -import io.holunda.polyflow.view.mongo.PolyflowMongoTestApplication import io.holunda.polyflow.view.query.data.DataEntriesForUserQuery import io.holunda.polyflow.view.query.task.* import org.camunda.bpm.engine.variable.VariableMap import org.camunda.bpm.engine.variable.Variables import org.junit.jupiter.api.Test import org.junit.jupiter.api.extension.ExtendWith -import org.springframework.boot.test.context.SpringBootTest import org.springframework.test.annotation.DirtiesContext +import org.testcontainers.containers.MongoDBContainer import java.time.OffsetDateTime import java.util.* @ExtendWith(JGivenExtension::class) -@SpringBootTest(classes = [PolyflowMongoTestApplication::class]) @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) abstract class PolyflowMongoServiceITestBase : SpringScenarioTest, PolyflowWhenStage<*>, PolyflowThenStage<*>>() { @@ -685,3 +684,13 @@ data class TestDataEntryData( } private fun Task.withDataEntries(dataEntries: List = listOf()) = TaskWithDataEntries(this, dataEntries) + +/** + * Clear client and db. + */ +fun MongoDBContainer.clear() { + MongoClients.create(this.connectionString).use { + val database = it.getDatabase("test") + database.drop() + } +} diff --git a/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/task/TaskRepositoryExtensionImplITest.kt b/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/task/TaskRepositoryExtensionImplITest.kt index 2885f5362..ab4c9fee8 100644 --- a/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/task/TaskRepositoryExtensionImplITest.kt +++ b/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/task/TaskRepositoryExtensionImplITest.kt @@ -1,30 +1,35 @@ package io.holunda.polyflow.view.mongo.task -import io.holunda.polyflow.view.mongo.PolyflowMongoTestApplication -import io.holunda.polyflow.view.mongo.utils.MongoLauncher +import io.holunda.polyflow.view.mongo.TaskPoolMongoViewConfiguration import org.assertj.core.api.Assertions.assertThat -import org.junit.jupiter.api.* -import org.junit.jupiter.api.extension.ExtendWith +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test import org.springframework.beans.factory.annotation.Autowired -import org.springframework.boot.test.context.SpringBootTest +import org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTest import org.springframework.data.domain.PageRequest import org.springframework.data.domain.Sort import org.springframework.test.context.ActiveProfiles +import org.springframework.test.context.ContextConfiguration +import org.springframework.test.context.DynamicPropertyRegistry +import org.springframework.test.context.DynamicPropertySource import org.springframework.test.context.TestPropertySource -import org.springframework.test.context.junit.jupiter.SpringExtension +import org.testcontainers.containers.MongoDBContainer +import org.testcontainers.junit.jupiter.Container +import org.testcontainers.junit.jupiter.Testcontainers import reactor.core.publisher.Mono import java.time.Instant import java.util.* + @TestPropertySource( properties = [ "polyflow.view.mongo.changeTrackingMode=EVENT_HANDLER", - "spring.data.mongodb.database=TaskRepositoryExtensionImplITest" ] ) -@SpringBootTest(classes = [PolyflowMongoTestApplication::class]) +@Testcontainers +@DataMongoTest @ActiveProfiles("itest-standalone") -@ExtendWith(SpringExtension::class) +@ContextConfiguration(classes = [TaskPoolMongoViewConfiguration::class]) class TaskRepositoryExtensionImplITest { companion object { @@ -39,19 +44,16 @@ class TaskRepositoryExtensionImplITest { const val PRIORITY_TWO = 90 const val PRIORITY_THREE = 100 - private val mongo = MongoLauncher.MongoInstance(false, "TaskRepositoryExtensionImplITest") - - @BeforeAll + @Container @JvmStatic - fun initMongo() { - mongo.init() - } + var mongoDBContainer: MongoDBContainer = MongoDBContainer("mongo:4.4.2") - @AfterAll + @DynamicPropertySource @JvmStatic - fun stop() { - mongo.stop() + fun setProperties(registry: DynamicPropertyRegistry) { + registry.add("spring.data.mongodb.uri") { mongoDBContainer.replicaSetUrl } } + } @BeforeEach @@ -62,12 +64,6 @@ class TaskRepositoryExtensionImplITest { @Autowired lateinit var taskRepository: TaskRepository - @AfterEach - fun clearMongo() { - mongo.clear() - } - - @Test fun finds_by_everything() { val documents = prepareDocuments(task().build()) diff --git a/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/utils/MongoLauncher.kt b/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/utils/MongoLauncher.kt deleted file mode 100644 index b4f13a16c..000000000 --- a/view/mongo/src/test/kotlin/io/holunda/polyflow/view/mongo/utils/MongoLauncher.kt +++ /dev/null @@ -1,176 +0,0 @@ -package io.holunda.polyflow.view.mongo.utils - -import com.mongodb.* -import com.mongodb.client.MongoClients -import de.flapdoodle.embed.mongo.commands.MongodArguments -import de.flapdoodle.embed.mongo.config.Net -import de.flapdoodle.embed.mongo.config.Storage -import de.flapdoodle.embed.mongo.distribution.Version -import de.flapdoodle.embed.mongo.transitions.Mongod -import de.flapdoodle.embed.mongo.transitions.RunningMongodProcess -import de.flapdoodle.embed.process.io.ProcessOutput -import de.flapdoodle.embed.process.io.Processors -import de.flapdoodle.embed.process.io.Slf4jLevel -import de.flapdoodle.embed.process.types.ProcessConfig -import de.flapdoodle.reverse.TransitionWalker -import de.flapdoodle.reverse.transitions.Start -import mu.KLogging -import org.awaitility.Awaitility.await -import org.bson.Document -import org.mockito.Mockito.mock -import org.slf4j.Logger -import java.io.IOException -import java.util.concurrent.TimeUnit -import javax.net.SocketFactory - - -/** - * Mongo Launcher... See https://github.com/AxonFramework/extension-mongo/blob/master/mongo/src/test/java/org/axonframework/extensions/mongo/utils/MongoLauncher.java - * @author Allard Buijze - * @author Simon Zambrovski - * @author Lars Bilger - */ -object MongoLauncher { - - - const val MONGO_DEFAULT_PORT = 27017 - const val LOCALHOST = "127.0.0.1" -// private val counter = AtomicInteger() - - private val isMongoRunning: Boolean - get() { - return try { - val mongoSocket = SocketFactory.getDefault().createSocket(LOCALHOST, MONGO_DEFAULT_PORT) - if (mongoSocket.isConnected) { - mongoSocket.close() - true - } else { - false - } - } catch (e: IOException) { - false - } - } - - fun prepareExecutable(asReplicaSet: Boolean, logger: Logger): Mongod { - if (isMongoRunning) { - return mock(Mongod::class.java) - } - - return Mongod.builder() - .net(Start.to(Net::class.java).initializedWith(Net.defaults().withPort(MONGO_DEFAULT_PORT))) - .mongodArguments( - Start.to(MongodArguments::class.java).initializedWith( - MongodArguments.builder() - .apply { if (asReplicaSet) replication(Storage.of("repembedded", 16)) } - .useNoJournal(!asReplicaSet) - .build() - ) - ) - .processOutput( - Start.to(ProcessOutput::class.java).initializedWith( - ProcessOutput.builder() - .output(Processors.logTo(logger, Slf4jLevel.DEBUG)) - .error(Processors.logTo(logger, Slf4jLevel.ERROR)) - .commands(Processors.named("[console>]", Processors.logTo(logger, Slf4jLevel.TRACE))) - .build() - ) - ) - // Increase timeout as default timeout seems not to be sufficient for shutdown in replicaSet mode - .processConfig(Start.to(ProcessConfig::class.java).initializedWith(ProcessConfig.defaults().withStopTimeoutInMillis(11000))) - .build() - - - // TODO check if there is a good reason for this fileNaming change and if there is, find out how to do it in the new version -// val command = Command.MongoD -// val downloadConfig = Defaults -// .downloadConfigFor(command) -// .fileNaming { prefix, postfix -> prefix + "_mongo_taskview_" + counter.getAndIncrement() + "_" + postfix } -// .build() - -// val artifactStore = Defaults -// .extractedArtifactStoreFor(command) -// .withDownloadConfig(downloadConfig) - -// val runtimeConfig = Defaults -// .runtimeConfigFor(command, logger) -// .artifactStore(artifactStore) -// .build() - -// val runtime = MongodStarter.getInstance(runtimeConfig) -// return runtime.prepare(mongodConfig) - } - - open class MongoInstance( - private val asReplicaSet: Boolean, - private val databaseName: String - ) { - - companion object : KLogging() - - private var mongod: TransitionWalker.ReachedState? = null - private var mongoExecutable: Mongod? = null - - /** - * Inits server. - */ - fun init() { - if (isMongoRunning) { - // There was already an existing mongo instance that we are reusing. Clear it in case there is any leftover data from a previous test run - clear() - } else { - this.mongoExecutable = prepareExecutable(asReplicaSet, logger) - this.mongod = mongoExecutable!!.start(Version.Main.V4_4) - if (asReplicaSet) { - - MongoClients.create( - MongoClientSettings - .builder() - .applyConnectionString(ConnectionString("mongodb://$LOCALHOST:$MONGO_DEFAULT_PORT")) - .readPreference(ReadPreference.nearest()) - .writeConcern(WriteConcern.W2) - .build() - ).use { mongo -> - - val config = Document( - mapOf("_id" to "repembedded", - "members" to BasicDBList().apply { - add(Document("_id", 0).append("host", "$LOCALHOST:$MONGO_DEFAULT_PORT")) - }) - ) - logger.info { "MongoDB Replica Config: $config" } - - val adminDatabase = mongo.getDatabase("admin") - adminDatabase.runCommand(Document("replSetInitiate", config)) - - await().atMost(5, TimeUnit.SECONDS).until { - val replStatus = adminDatabase.runCommand(Document("replSetGetStatus", 1)) - logger.info { "MongoDB Replica Set Status: $replStatus" } - "PRIMARY" == replStatus.getList("members", Document::class.java).first().getString("stateStr") - } - } - } - } - } - - /** - * Clear client and db. - */ - fun clear() { - MongoClients.create("mongodb://$LOCALHOST:$MONGO_DEFAULT_PORT").use { - val database = it.getDatabase(databaseName) - database.drop() - } - } - - /** - * Stops server. - */ - fun stop() { - mongod?.current()?.stop() - await().atMost(5, TimeUnit.SECONDS).until { - !isMongoRunning - } - } - } -} From e67fb843cf04595283061989639e3ff2be51a376 Mon Sep 17 00:00:00 2001 From: Patrick Wunderlich Date: Mon, 19 Aug 2024 10:07:16 +0200 Subject: [PATCH 17/19] Add JPA Queries for task attribute names + values #843 (#1019) --- docs/reference-guide/components/view-api.md | 28 ++++---- .../src/main/kotlin/VariableSerializer.kt | 2 +- .../view/jpa/JpaPolyflowViewTaskService.kt | 27 +++++++ .../polyflow/view/jpa/task/TaskRepository.kt | 33 ++++++++- .../jpa/JpaPolyflowViewServiceTaskITest.kt | 32 ++++++++- .../simple/service/SimpleTaskPoolService.kt | 48 +++++++++++++ .../service/SimpleTaskPoolServiceTest.kt | 72 +++++++++++++++++++ .../view/simple/service/TaskPoolStages.kt | 43 +++++++++++ .../src/main/kotlin/QueryGatewayExt.kt | 10 +++ .../src/main/kotlin/TaskQueryClient.kt | 18 +++++ .../main/kotlin/query/task/AllTasksQuery.kt | 2 - .../task/AllTasksWithDataEntriesQuery.kt | 1 - .../src/main/kotlin/query/task/TaskApi.kt | 10 +++ .../query/task/TaskAttributeNamesQuery.kt | 21 ++++++ .../task/TaskAttributeNamesQueryResult.kt | 14 ++++ .../query/task/TaskAttributeValuesQuery.kt | 34 +++++++++ .../task/TaskAttributeValuesQueryResult.kt | 15 ++++ 17 files changed, 391 insertions(+), 19 deletions(-) create mode 100755 view/view-api/src/main/kotlin/query/task/TaskAttributeNamesQuery.kt create mode 100644 view/view-api/src/main/kotlin/query/task/TaskAttributeNamesQueryResult.kt create mode 100755 view/view-api/src/main/kotlin/query/task/TaskAttributeValuesQuery.kt create mode 100644 view/view-api/src/main/kotlin/query/task/TaskAttributeValuesQueryResult.kt diff --git a/docs/reference-guide/components/view-api.md b/docs/reference-guide/components/view-api.md index d3c54365a..87f473e7e 100644 --- a/docs/reference-guide/components/view-api.md +++ b/docs/reference-guide/components/view-api.md @@ -21,19 +21,21 @@ and generic query paging and sorting. The Task API allows to query for tasks handled by the task-pool. -| Query Type | Description | Payload types | In-Memory | JPA | Mongo DB | -|-------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|-----------|------------|----------| -| AllTasksQuery | Retrieves a list of tasks applying additional filters | List | yes | yes | no | -| TasksForUserQuery | Retrieves a list of tasks accessible by the user and applying additional filters | List | yes | yes | yes | -| TasksForGroupQuery | Retrieves a list of tasks accessible by the user's group and applying additional filters | List | yes | yes | no | -| TasksForCandidateUserAndGroupQuery | Retrieves a list of tasks accessible by the user because listed as candidate and the user's group and applying additional filters | List | yes | yes | no | -| TaskForIdQuery | Retrieves a task by id (without any other filters) | Task or null | yes | yes | yes | -| TasksForApplicationQuery | Retrieves all tasks by given application name (without any further filters) | List | yes | yes | yes | -| AllTasksWithDataEntriesQuery | Retrieves a list of tasks applying additional filters and correlates result with data entries, if available | List<(Task, List) | yes | incubation | no | -| TasksWithDataEntriesForGroupQuery | Retrieves a list of tasks accessible by the user's group and applying additional filters and correlates result with data entries, if available | List<(Task, List) | yes | incubation | no | -| TasksWithDataEntriesForUserQuery | Retrieves a list of tasks accessible by the user and applying additional filters and correlates result with data entries, if available | List<(Task, List) | yes | incubation | yes | -| TaskWithDataEntriesForIdQuery | Retrieves a task by id and correlates result with data entries, if available | (Task, List) or null | yes | yes | yes | -| TaskCountByApplicationQuery | Counts tasks grouped by application names, useful for monitoring | List<(ApplicationName, Count)> | yes | no | yes | +| Query Type | Description | Payload types | In-Memory | JPA | Mongo DB | +|------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------|-----------|------------|----------| +| AllTasksQuery | Retrieves a list of tasks applying additional filters | List | yes | yes | no | +| TasksForUserQuery | Retrieves a list of tasks accessible by the user and applying additional filters | List | yes | yes | yes | +| TasksForGroupQuery | Retrieves a list of tasks accessible by the user's group and applying additional filters | List | yes | yes | no | +| TasksForCandidateUserAndGroupQuery | Retrieves a list of tasks accessible by the user because listed as candidate and the user's group and applying additional filters | List | yes | yes | no | +| TaskForIdQuery | Retrieves a task by id (without any other filters) | Task or null | yes | yes | yes | +| TasksForApplicationQuery | Retrieves all tasks by given application name (without any further filters) | List | yes | yes | yes | +| AllTasksWithDataEntriesQuery | Retrieves a list of tasks applying additional filters and correlates result with data entries, if available | List<(Task, List) | yes | incubation | no | +| TasksWithDataEntriesForGroupQuery | Retrieves a list of tasks accessible by the user's group and applying additional filters and correlates result with data entries, if available | List<(Task, List) | yes | incubation | no | +| TasksWithDataEntriesForUserQuery | Retrieves a list of tasks accessible by the user and applying additional filters and correlates result with data entries, if available | List<(Task, List) | yes | incubation | yes | +| TaskWithDataEntriesForIdQuery | Retrieves a task by id and correlates result with data entries, if available | (Task, List) or null | yes | yes | yes | +| TaskCountByApplicationQuery | Counts tasks grouped by application names, useful for monitoring | List<(ApplicationName, Count)> | yes | no | yes | +| TaskAttributeNamesQuery | Retrieves a list of all task (payload) attribut names | List<(String, Count)> | yes | no | yes | +| TaskAttributeValuesQuery | Retrieves a list of task (payload) attribut values for given name | List<(String, Count)> | yes | yes | no | ### Process Definition API diff --git a/integration/common/variable-serializer/src/main/kotlin/VariableSerializer.kt b/integration/common/variable-serializer/src/main/kotlin/VariableSerializer.kt index e02c34eca..86f0bca3c 100644 --- a/integration/common/variable-serializer/src/main/kotlin/VariableSerializer.kt +++ b/integration/common/variable-serializer/src/main/kotlin/VariableSerializer.kt @@ -96,7 +96,7 @@ internal fun Pair.toJsonPathWithValue( } else if (value is List<*>) { value.map { (key to it).toJsonPathWithValue(prefix, limit, filter) }.flatten() } else { - // ignore complex objects + // ignore complex objects, in default scenarios, complex objects got already deserialized by the sender in ProjectingCommandAccumulator.serializePayloadIfNeeded listOf() } } diff --git a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewTaskService.kt b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewTaskService.kt index 2ed36ab46..d7d249a2f 100644 --- a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewTaskService.kt +++ b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewTaskService.kt @@ -5,6 +5,7 @@ import io.holixon.axon.gateway.query.RevisionValue import io.holunda.camunda.taskpool.api.task.* import io.holunda.polyflow.view.Task import io.holunda.polyflow.view.TaskWithDataEntries +import io.holunda.polyflow.view.auth.User import io.holunda.polyflow.view.filter.toCriteria import io.holunda.polyflow.view.jpa.JpaPolyflowViewTaskService.Companion.PROCESSING_GROUP import io.holunda.polyflow.view.jpa.auth.AuthorizationPrincipal @@ -252,6 +253,28 @@ class JpaPolyflowViewTaskService( ) } + @QueryHandler + override fun query(query: TaskAttributeNamesQuery): TaskAttributeNamesQueryResult { + val assignee = if(query.assignedToMeOnly) query.user?.username else null + val distinctKeys = taskRepository.getTaskAttributeNames(assignee, query.user?.toAuthorizationPrincipalStrings()) + + return TaskAttributeNamesQueryResult( + elements = distinctKeys.toList(), + totalElementCount = distinctKeys.size + ) + } + + @QueryHandler + override fun query(query: TaskAttributeValuesQuery): TaskAttributeValuesQueryResult { + val assignee = if(query.assignedToMeOnly) query.user?.username else null + val distinctValues = taskRepository.getTaskAttributeValues(query.attributeName, assignee, query.user?.toAuthorizationPrincipalStrings()) + + return TaskAttributeValuesQueryResult( + elements = distinctValues.toList(), + totalElementCount = distinctValues.size + ) + } + @QueryHandler override fun query(query: TaskWithDataEntriesForIdQuery): Optional { return Optional.ofNullable(taskRepository.findByIdOrNull(query.id)?.let { taskEntity -> @@ -489,3 +512,7 @@ class JpaPolyflowViewTaskService( } } + +private fun User.toAuthorizationPrincipalStrings(): Set { + return this.groups.map(AuthorizationPrincipal.Companion::group).map { it.toString() }.toSet() + user(this.username).toString() +} diff --git a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/task/TaskRepository.kt b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/task/TaskRepository.kt index c8772fac8..db93b2d7e 100644 --- a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/task/TaskRepository.kt +++ b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/task/TaskRepository.kt @@ -366,7 +366,6 @@ interface TaskRepository : CrudRepository, JpaSpecificationE } } - /** * Counts user tasks grouped by application name, resulting in a total amount of tasks per application (=process engine). * Helpful for monitoring of tasks on the task pool projection side vs. engine side. @@ -375,4 +374,36 @@ interface TaskRepository : CrudRepository, JpaSpecificationE @Query("select new io.holunda.polyflow.view.jpa.CountByApplication(t.sourceReference.applicationName, count(t) ) from TaskEntity t group by t.sourceReference.applicationName") fun getCountByApplication(): List + /** + * Returns all task payload attribut names (path). + * If assignee is given, just attributes for the given assignee is queried. + * If authorizedPrincipals are given, just attributes for the given authorizedPrincipals are queried. + * @return list of task payload attribut names (path) + */ + @Query(""" + select att.path + from TaskEntity task + join task.payloadAttributes att + join task.authorizedPrincipals auth + where (?1 is null or task.assignee = ?1) + and (?2 is null or auth in ?2) + """) + fun getTaskAttributeNames(assignee: String?, principals: Set?): Set + + /** + * Returns a list of all task payload attribute values for the given task payload attribute name. + * If assignee is given, just attributes for the given assignee is queried. + * If authorizedPrincipals are given, just attributes for the given authorizedPrincipals are queried. + * @return list of task payload attribut values + */ + @Query(""" + select att.value + from TaskEntity task + join task.payloadAttributes att + join task.authorizedPrincipals auth + where att.path = ?1 + and (?2 is null or task.assignee = ?2) + and (?3 is null or auth in ?3) + """) + fun getTaskAttributeValues(attributeName: String, assignee: String?, principals: Set?): Set } diff --git a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceTaskITest.kt b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceTaskITest.kt index 6084ecbce..f26d17792 100644 --- a/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceTaskITest.kt +++ b/view/jpa/src/test/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewServiceTaskITest.kt @@ -548,6 +548,34 @@ internal class JpaPolyflowViewServiceTaskITest { assertThat(counts[0].taskCount).isEqualTo(3) } + @Test + fun `should find task attribute names`() { + // Some for zoro in muppets + val names = jpaPolyflowViewService.query(TaskAttributeNamesQuery(user = User("zoro", setOf("muppets")))) + assertThat(names).isNotNull + assertThat(names.elements).hasSize(4) + assertThat(names.elements).contains("key", "key-int", "complex.attribute1", "complex.attribute2") + + // But none for bud in heros + val namesOSH = jpaPolyflowViewService.query(TaskAttributeNamesQuery(user = User("bud", setOf("old_school_heros")))) + assertThat(namesOSH).isNotNull + assertThat(namesOSH.elements).hasSize(0) + } + + @Test + fun `should find task attribute values`() { + // Some for zoro in muppets + val names = jpaPolyflowViewService.query(TaskAttributeValuesQuery(user = User("zoro", setOf("muppets")), attributeName = "key")) + assertThat(names).isNotNull + assertThat(names.elements).hasSize(2) + assertThat(names.elements).contains("value", "otherValue") + + // But none for bud in heros + val namesOSH = jpaPolyflowViewService.query(TaskAttributeValuesQuery(user = User("bud", setOf("old_school_heros")), attributeName = "key")) + assertThat(namesOSH).isNotNull + assertThat(namesOSH.elements).hasSize(0) + } + private fun captureEmittedQueryUpdates(): List> { val queryTypeCaptor = argumentCaptor>() val predicateCaptor = argumentCaptor>() @@ -585,7 +613,9 @@ internal class JpaPolyflowViewServiceTaskITest { return mapOf( "key" to value, "key-int" to 1, - "complex" to Pojo( + "complex.attribute1" to "value", + "complex.attribute2" to Date.from(now), + "complexIgnored" to Pojo( // Normally, the event will never have a complex object like this in the payload. (Got already deserialized by the sender in ProjectingCommandAccumulator.serializePayloadIfNeeded) attribute1 = "value", attribute2 = Date.from(now) ) diff --git a/view/simple/src/main/kotlin/io/holunda/polyflow/view/simple/service/SimpleTaskPoolService.kt b/view/simple/src/main/kotlin/io/holunda/polyflow/view/simple/service/SimpleTaskPoolService.kt index 588d6e39c..1bcabeb2f 100755 --- a/view/simple/src/main/kotlin/io/holunda/polyflow/view/simple/service/SimpleTaskPoolService.kt +++ b/view/simple/src/main/kotlin/io/holunda/polyflow/view/simple/service/SimpleTaskPoolService.kt @@ -8,6 +8,7 @@ import io.holunda.polyflow.view.TaskWithDataEntries import io.holunda.polyflow.view.filter.createTaskPredicates import io.holunda.polyflow.view.filter.filterByPredicate import io.holunda.polyflow.view.filter.toCriteria +import io.holunda.polyflow.view.filter.toPayloadPredicates import io.holunda.polyflow.view.query.task.* import io.holunda.polyflow.view.simple.updateMapFilterQuery import io.holunda.polyflow.view.sort.taskComparator @@ -18,6 +19,7 @@ import org.axonframework.config.ProcessingGroup import org.axonframework.eventhandling.EventHandler import org.axonframework.queryhandling.QueryHandler import org.axonframework.queryhandling.QueryUpdateEmitter +import org.camunda.bpm.engine.variable.VariableMap import org.springframework.stereotype.Component import java.util.* import java.util.concurrent.ConcurrentHashMap @@ -199,6 +201,52 @@ class SimpleTaskPoolService( return queryForTasks(query) } + /** + * Retrieves all task attribute names + */ + @QueryHandler + override fun query(query: TaskAttributeNamesQuery): TaskAttributeNamesQueryResult { + val filterAssignee = query.assignedToMeOnly && query.user != null + val filterCandidates = query.user != null + + val distinctFilteredKeys = tasks.values.asSequence() + .filter { !filterAssignee || it.assignee == query.user!!.username } + .filter { task -> !filterCandidates || (task.candidateUsers.contains(query.user!!.username) || task.candidateGroups.any { query.user!!.groups.contains(it) } ) } + .map(Task::payload) + .flatMap(VariableMap::keys) + .distinct() + .toList() + + return TaskAttributeNamesQueryResult( + elements = distinctFilteredKeys, + totalElementCount = distinctFilteredKeys.size + ) + } + + /** + * Retrieves all task attribute values for an attribute name + */ + @QueryHandler + override fun query(query: TaskAttributeValuesQuery): TaskAttributeValuesQueryResult { + val filterAssignee = query.assignedToMeOnly && query.user != null + val filterCandidates = query.user != null + + val distinctFilteredValues = tasks.values.asSequence() + .filter { !filterAssignee || it.assignee == query.user!!.username } + .filter { task -> !filterCandidates || (task.candidateUsers.contains(query.user!!.username) || task.candidateGroups.any { query.user!!.groups.contains(it) } ) } + .map(Task::payload) + .filter { it.containsKey(query.attributeName) } + .mapNotNull { it[query.attributeName] } + .distinct() + .toList() + + return TaskAttributeValuesQueryResult( + elements = distinctFilteredValues, + totalElementCount = distinctFilteredValues.size + ) + } + + @QueryHandler private fun queryForTasks(query: PageableSortableFilteredTaskQuery): TaskQueryResult { val predicates = createTaskPredicates(toCriteria(query.filters)) val filtered = tasks.values.filter { query.applyFilter(it) } diff --git a/view/simple/src/test/kotlin/io/holunda/polyflow/view/simple/service/SimpleTaskPoolServiceTest.kt b/view/simple/src/test/kotlin/io/holunda/polyflow/view/simple/service/SimpleTaskPoolServiceTest.kt index ba5b1b94d..a267b0d6c 100755 --- a/view/simple/src/test/kotlin/io/holunda/polyflow/view/simple/service/SimpleTaskPoolServiceTest.kt +++ b/view/simple/src/test/kotlin/io/holunda/polyflow/view/simple/service/SimpleTaskPoolServiceTest.kt @@ -290,6 +290,78 @@ class SimpleTaskPoolServiceTest : ScenarioTest, Simp .all_task_are_returned_and_sorted_by(reversed = true) { it.task.businessKey } } + @Test + fun `should find task attribute names`() { + given() + .tasks_exist(3) + + `when`() + .task_attribute_names_are_queried("kermit", "muppetshow") + + then() + .attribute_names_are_returned(3) + } + + @Test + fun `should not find task attribute names if there is no matching candidate user`() { + given() + .tasks_exist(3) + + `when`() + .task_attribute_names_are_queried("bud", "old_school_heros") + + then() + .attribute_names_are_returned(0) + } + + @Test + fun `should not find task attribute names for wrong assignee`() { + given() + .tasks_exist(3) + + `when`() + .task_attribute_names_are_queried_for_assigned_user(user = "bud", group = null) + + then() + .attribute_names_are_returned(0) + } + + @Test + fun `should find task attribute values`() { + given() + .tasks_exist(3) + + `when`() + .task_attribute_values_are_queried("payloadIdString", "kermit", "muppetshow") + + then() + .attribute_values_are_returned(3) + } + + @Test + fun `should not find task attribute values if there is no matching candidate user`() { + given() + .tasks_exist(3) + + `when`() + .task_attribute_values_are_queried("payloadIdString", "bud", "old_school_heros") + + then() + .attribute_values_are_returned(0) + } + + @Test + fun `should not find task attribute values for wrong assignee`() { + given() + .tasks_exist(3) + + `when`() + .task_attribute_values_are_queried_for_assigned_user("payloadIdString", "bud", null) + + then() + .attribute_values_are_returned(0) + } + private infix fun String.withTaskCount(taskCount: Int) = ApplicationWithTaskCount(this, taskCount) } diff --git a/view/simple/src/test/kotlin/io/holunda/polyflow/view/simple/service/TaskPoolStages.kt b/view/simple/src/test/kotlin/io/holunda/polyflow/view/simple/service/TaskPoolStages.kt index 8d04c8d18..28ae7ac61 100644 --- a/view/simple/src/test/kotlin/io/holunda/polyflow/view/simple/service/TaskPoolStages.kt +++ b/view/simple/src/test/kotlin/io/holunda/polyflow/view/simple/service/TaskPoolStages.kt @@ -63,6 +63,7 @@ class SimpleTaskPoolGivenStage> : Abstract payload = createVariables().apply { put("payloadIdInt", i) put("payloadIdString", "$i") + put("payloadComplex.attr1", "$i") } ) @@ -93,6 +94,12 @@ class SimpleTaskPoolWhenStage> : AbstractSi @ExpectedScenarioState(resolution = ScenarioState.Resolution.NAME, required = true) private lateinit var tasks: List + @ProvidedScenarioState(resolution = ScenarioState.Resolution.NAME) + private var attributeNames: List = listOf() + + @ProvidedScenarioState(resolution = ScenarioState.Resolution.NAME) + private var attributeValues: List = listOf() + @ProvidedScenarioState(resolution = ScenarioState.Resolution.NAME) private var queriedTasks: MutableList = mutableListOf() @@ -130,6 +137,26 @@ class SimpleTaskPoolWhenStage> : AbstractSi queriedTasks.addAll(simpleTaskPoolService.query(AllTasksQuery(sort = sort, filters = filters)).elements.map { TaskWithDataEntries(it) }) } + @As("Task Attribute Names are queried for user $ with group $") + fun task_attribute_names_are_queried(user: String, group: String) = step { + attributeNames = simpleTaskPoolService.query(TaskAttributeNamesQuery(user = User(user, setOf(group)))).elements + } + + @As("Task Attribute Names are queried for assigned user $ with group $") + fun task_attribute_names_are_queried_for_assigned_user(user: String, group: String?) = step { + attributeNames = simpleTaskPoolService.query(TaskAttributeNamesQuery(user = User(user, setOfNotNull(group)), assignedToMeOnly = true)).elements + } + + @As("Task Attribute Values are queried for name $ and user $ with group $") + fun task_attribute_values_are_queried(name: String, user: String, group: String) = step { + attributeValues = simpleTaskPoolService.query(TaskAttributeValuesQuery(attributeName = name, user = User(user, setOf(group)))).elements + } + + @As("Task Attribute Values are queried for name $ and assigned user $ with group $") + fun task_attribute_values_are_queried_for_assigned_user(name: String, user: String, group: String?) = step { + attributeValues = simpleTaskPoolService.query(TaskAttributeValuesQuery(attributeName = name, user = User(user, setOfNotNull(group)), assignedToMeOnly = true)).elements + } + } @JGivenKotlinStage @@ -147,6 +174,12 @@ class SimpleTaskPoolThenStage> : AbstractSi @ExpectedScenarioState(resolution = ScenarioState.Resolution.NAME, required = true) private lateinit var returnedTasksForApplication: TaskQueryResult + @ExpectedScenarioState(resolution = ScenarioState.Resolution.NAME) + private var attributeNames: List = listOf() + + @ExpectedScenarioState(resolution = ScenarioState.Resolution.NAME) + private var attributeValues: List = listOf() + @As("$ tasks are returned") fun num_tasks_are_returned(numTasks: Int) = step { assertThat(queriedTasks.size).isEqualTo(numTasks) @@ -177,6 +210,16 @@ class SimpleTaskPoolThenStage> : AbstractSi assertThat(returnedTasksForApplication.elements).containsExactlyInAnyOrder(*expectedTasks) } + @As("attribute names $ are returned") + fun attribute_names_are_returned(count: Int) = step { + assertThat(attributeNames).hasSize(count) + } + + @As("attribute values $ are returned") + fun attribute_values_are_returned(count: Int) = step { + assertThat(attributeValues).hasSize(count) + } + fun task_is_created(task: Task) = step { val result = simpleTaskPoolService.query(TaskForIdQuery(task.id)) assertThat(result).isPresent diff --git a/view/view-api-client/src/main/kotlin/QueryGatewayExt.kt b/view/view-api-client/src/main/kotlin/QueryGatewayExt.kt index 05c3e687f..320b24cf0 100644 --- a/view/view-api-client/src/main/kotlin/QueryGatewayExt.kt +++ b/view/view-api-client/src/main/kotlin/QueryGatewayExt.kt @@ -134,4 +134,14 @@ object QueryGatewayExt { */ fun QueryGateway.tasksForCandidateUserAndGroup(query: TasksForCandidateUserAndGroupQuery): CompletableFuture = TaskQueryClient(this).query(query) + /** + * @see [TaskAttributeNamesQuery] + */ + fun QueryGateway.taskAttributeNames(query: TaskAttributeNamesQuery): CompletableFuture = TaskQueryClient(this).query(query) + + /** + * @see [TaskAttributeValuesQuery] + */ + fun QueryGateway.taskAttributeValues(query: TaskAttributeValuesQuery): CompletableFuture = TaskQueryClient(this).query(query) + } diff --git a/view/view-api-client/src/main/kotlin/TaskQueryClient.kt b/view/view-api-client/src/main/kotlin/TaskQueryClient.kt index 8cd29dc4f..cc2cce8cf 100644 --- a/view/view-api-client/src/main/kotlin/TaskQueryClient.kt +++ b/view/view-api-client/src/main/kotlin/TaskQueryClient.kt @@ -113,4 +113,22 @@ open class TaskQueryClient( ResponseTypes.instanceOf(TaskQueryResult::class.java) ) + /** + * @see io.holunda.polyflow.view.query.task.TaskApi.query + * @see io.holunda.polyflow.view.query.task.TaskAttributeNamesQuery + */ + open fun query(query: TaskAttributeNamesQuery): CompletableFuture = queryGateway.query( + query, + ResponseTypes.instanceOf(TaskAttributeNamesQueryResult::class.java) + ) + + /** + * @see io.holunda.polyflow.view.query.task.TaskApi.query + * @see io.holunda.polyflow.view.query.task.TaskAttributeValuesQuery + */ + open fun query(query: TaskAttributeValuesQuery): CompletableFuture = queryGateway.query( + query, + ResponseTypes.instanceOf(TaskAttributeValuesQueryResult::class.java) + ) + } diff --git a/view/view-api/src/main/kotlin/query/task/AllTasksQuery.kt b/view/view-api/src/main/kotlin/query/task/AllTasksQuery.kt index c4bc4e639..bd5373d55 100755 --- a/view/view-api/src/main/kotlin/query/task/AllTasksQuery.kt +++ b/view/view-api/src/main/kotlin/query/task/AllTasksQuery.kt @@ -1,8 +1,6 @@ package io.holunda.polyflow.view.query.task import io.holunda.polyflow.view.Task -import io.holunda.polyflow.view.query.FilterQuery -import io.holunda.polyflow.view.query.PageableSortableQuery /** * Query for all tasks. diff --git a/view/view-api/src/main/kotlin/query/task/AllTasksWithDataEntriesQuery.kt b/view/view-api/src/main/kotlin/query/task/AllTasksWithDataEntriesQuery.kt index 81b06e06d..443227d80 100755 --- a/view/view-api/src/main/kotlin/query/task/AllTasksWithDataEntriesQuery.kt +++ b/view/view-api/src/main/kotlin/query/task/AllTasksWithDataEntriesQuery.kt @@ -1,7 +1,6 @@ package io.holunda.polyflow.view.query.task import io.holunda.polyflow.view.TaskWithDataEntries -import io.holunda.polyflow.view.auth.User import io.holunda.polyflow.view.query.FilterQuery import io.holunda.polyflow.view.query.PageableSortableQuery diff --git a/view/view-api/src/main/kotlin/query/task/TaskApi.kt b/view/view-api/src/main/kotlin/query/task/TaskApi.kt index 3e6c88e64..30cf49b0d 100644 --- a/view/view-api/src/main/kotlin/query/task/TaskApi.kt +++ b/view/view-api/src/main/kotlin/query/task/TaskApi.kt @@ -63,4 +63,14 @@ interface TaskApi { * Retrieve all tasks. */ fun query(query: AllTasksQuery): TaskQueryResult + + /** + * Retrieves all task attribute names + */ + fun query(query: TaskAttributeNamesQuery): TaskAttributeNamesQueryResult + + /** + * Retrieves all task attribute values for an attribute name + */ + fun query(query: TaskAttributeValuesQuery): TaskAttributeValuesQueryResult } diff --git a/view/view-api/src/main/kotlin/query/task/TaskAttributeNamesQuery.kt b/view/view-api/src/main/kotlin/query/task/TaskAttributeNamesQuery.kt new file mode 100755 index 000000000..11dc586ad --- /dev/null +++ b/view/view-api/src/main/kotlin/query/task/TaskAttributeNamesQuery.kt @@ -0,0 +1,21 @@ +package io.holunda.polyflow.view.query.task + +import io.holunda.polyflow.view.Task +import io.holunda.polyflow.view.auth.User +import io.holunda.polyflow.view.query.FilterQuery +import io.holunda.polyflow.view.query.PageableSortableQuery + +/** + * Query for tasks attribute names. + * @param user - the user with groups accessing the tasks. If non is passed, all task attributes will be queried. + * @param assignedToMeOnly flag indicating if the resulting tasks must be assigned to the user only. + */ +data class TaskAttributeNamesQuery( + val user: User?, + val assignedToMeOnly: Boolean = false, +) : FilterQuery { + + override fun applyFilter(element: Task): Boolean = true + +} + diff --git a/view/view-api/src/main/kotlin/query/task/TaskAttributeNamesQueryResult.kt b/view/view-api/src/main/kotlin/query/task/TaskAttributeNamesQueryResult.kt new file mode 100644 index 000000000..c48f97c78 --- /dev/null +++ b/view/view-api/src/main/kotlin/query/task/TaskAttributeNamesQueryResult.kt @@ -0,0 +1,14 @@ +package io.holunda.polyflow.view.query.task + +import io.holunda.polyflow.view.query.PageableSortableQuery +import io.holunda.polyflow.view.query.QueryResult + +/** + * Result of query for multiple task attributes. + */ +data class TaskAttributeNamesQueryResult( + override val elements: List, + override val totalElementCount: Int = elements.size +) : QueryResult(elements = elements, totalElementCount = totalElementCount) { + override fun slice(query: PageableSortableQuery) = this.copy(elements = super.slice(query).elements) +} diff --git a/view/view-api/src/main/kotlin/query/task/TaskAttributeValuesQuery.kt b/view/view-api/src/main/kotlin/query/task/TaskAttributeValuesQuery.kt new file mode 100755 index 000000000..8873eb386 --- /dev/null +++ b/view/view-api/src/main/kotlin/query/task/TaskAttributeValuesQuery.kt @@ -0,0 +1,34 @@ +package io.holunda.polyflow.view.query.task + +import io.holunda.polyflow.view.Task +import io.holunda.polyflow.view.auth.User +import io.holunda.polyflow.view.query.FilterQuery +import io.holunda.polyflow.view.query.PageableSortableQuery + +/** + * Query and distinct tasks attribute values for the given attribute name. + * @param user - the user with groups accessing the tasks. If non is passed, all tasks attribute values will be queried. + * @param assignedToMeOnly flag indicating if the resulting tasks must be assigned to the user only. + * @param filters - currently not supported + */ +data class TaskAttributeValuesQuery( + val attributeName: String, + val user: User?, + val assignedToMeOnly: Boolean = false, +) : FilterQuery { + + override fun applyFilter(element: Task): Boolean = user == null || + if (assignedToMeOnly) { + // assignee + element.assignee == this.user.username + } else { + // candidate user + element.candidateUsers.contains(this.user.username) + // candidate groups + || element.candidateGroups.any { candidateGroup -> this.user.groups.contains(candidateGroup) } + // assignee + || element.assignee == this.user.username + } + +} + diff --git a/view/view-api/src/main/kotlin/query/task/TaskAttributeValuesQueryResult.kt b/view/view-api/src/main/kotlin/query/task/TaskAttributeValuesQueryResult.kt new file mode 100644 index 000000000..87bada373 --- /dev/null +++ b/view/view-api/src/main/kotlin/query/task/TaskAttributeValuesQueryResult.kt @@ -0,0 +1,15 @@ +package io.holunda.polyflow.view.query.task + +import io.holunda.polyflow.view.Task +import io.holunda.polyflow.view.query.PageableSortableQuery +import io.holunda.polyflow.view.query.QueryResult + +/** + * Result of query for multiple task attributes. + */ +data class TaskAttributeValuesQueryResult( + override val elements: List, + override val totalElementCount: Int = elements.size +) : QueryResult(elements = elements, totalElementCount = totalElementCount) { + override fun slice(query: PageableSortableQuery) = this.copy(elements = super.slice(query).elements) +} From d6b86c254d8e51af8411cd9dab30ce51d0ba11ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:07:35 +0200 Subject: [PATCH 18/19] chore(deps): bump org.axonframework.extensions.kotlin:axon-kotlin (#1026) Bumps [org.axonframework.extensions.kotlin:axon-kotlin](https://github.com/AxonFramework/extension-kotlin) from 4.9.0 to 4.10.0. - [Release notes](https://github.com/AxonFramework/extension-kotlin/releases) - [Commits](https://github.com/AxonFramework/extension-kotlin/compare/axon-kotlin-4.9.0...axon-kotlin-4.10.0) --- updated-dependencies: - dependency-name: org.axonframework.extensions.kotlin:axon-kotlin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- bom/parent/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bom/parent/pom.xml b/bom/parent/pom.xml index 1b3092a34..cbb455657 100644 --- a/bom/parent/pom.xml +++ b/bom/parent/pom.xml @@ -22,7 +22,7 @@ 7.21.0 4.10.0 - 4.9.0 + 4.10.0 2.1.0 4.2.2 From 5fcfaf8af3d04aa7d2142f117aaa3ec34cc31e7d Mon Sep 17 00:00:00 2001 From: Simon Zambrovski Date: Mon, 19 Aug 2024 10:29:24 +0200 Subject: [PATCH 19/19] Update for next development version --- bom/datapool-dependencies/pom.xml | 2 +- bom/parent/pom.xml | 2 +- bom/taskpool-dependencies/pom.xml | 2 +- core/bus-jackson/pom.xml | 2 +- core/datapool/datapool-api/pom.xml | 2 +- core/datapool/datapool-core/pom.xml | 2 +- core/datapool/datapool-event/pom.xml | 2 +- core/datapool/pom.xml | 2 +- core/spring-utils/pom.xml | 2 +- core/taskpool/pom.xml | 2 +- core/taskpool/taskpool-api/pom.xml | 2 +- core/taskpool/taskpool-core/pom.xml | 2 +- core/taskpool/taskpool-event/pom.xml | 2 +- integration/camunda-bpm/engine-client/pom.xml | 2 +- integration/camunda-bpm/pom.xml | 2 +- integration/camunda-bpm/springboot-autoconfigure/pom.xml | 2 +- integration/camunda-bpm/springboot-starter/pom.xml | 2 +- integration/camunda-bpm/taskpool-collector/pom.xml | 2 +- integration/camunda-bpm/taskpool-job-sender/pom.xml | 2 +- integration/common/datapool-sender/pom.xml | 2 +- integration/common/pom.xml | 2 +- integration/common/tasklist-url-resolver/pom.xml | 2 +- integration/common/taskpool-sender/pom.xml | 2 +- integration/common/variable-serializer/pom.xml | 2 +- pom.xml | 2 +- view/form-url-resolver/pom.xml | 2 +- view/jpa/pom.xml | 2 +- view/mongo/pom.xml | 2 +- view/pom.xml | 2 +- view/simple/pom.xml | 2 +- view/view-api-client/pom.xml | 2 +- view/view-api/pom.xml | 2 +- 32 files changed, 32 insertions(+), 32 deletions(-) diff --git a/bom/datapool-dependencies/pom.xml b/bom/datapool-dependencies/pom.xml index 3e71177c7..63966c482 100644 --- a/bom/datapool-dependencies/pom.xml +++ b/bom/datapool-dependencies/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.1-SNAPSHOT + 4.2.1 ../parent/pom.xml diff --git a/bom/parent/pom.xml b/bom/parent/pom.xml index cbb455657..844891337 100644 --- a/bom/parent/pom.xml +++ b/bom/parent/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-root - 4.2.1-SNAPSHOT + 4.2.1 ../../pom.xml diff --git a/bom/taskpool-dependencies/pom.xml b/bom/taskpool-dependencies/pom.xml index cdda7b16b..eca0e94ef 100644 --- a/bom/taskpool-dependencies/pom.xml +++ b/bom/taskpool-dependencies/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.1-SNAPSHOT + 4.2.1 ../parent/pom.xml diff --git a/core/bus-jackson/pom.xml b/core/bus-jackson/pom.xml index ea094fdb7..6f25ad374 100755 --- a/core/bus-jackson/pom.xml +++ b/core/bus-jackson/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.1-SNAPSHOT + 4.2.1 ../../bom/parent/pom.xml diff --git a/core/datapool/datapool-api/pom.xml b/core/datapool/datapool-api/pom.xml index 634a7cfa6..bcb70bac7 100755 --- a/core/datapool/datapool-api/pom.xml +++ b/core/datapool/datapool-api/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-datapool-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-datapool-api diff --git a/core/datapool/datapool-core/pom.xml b/core/datapool/datapool-core/pom.xml index 57054fdab..8c12ac81a 100644 --- a/core/datapool/datapool-core/pom.xml +++ b/core/datapool/datapool-core/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-datapool-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-datapool-core diff --git a/core/datapool/datapool-event/pom.xml b/core/datapool/datapool-event/pom.xml index 9432e1a3c..d3c8beb1b 100755 --- a/core/datapool/datapool-event/pom.xml +++ b/core/datapool/datapool-event/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-datapool-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-datapool-event diff --git a/core/datapool/pom.xml b/core/datapool/pom.xml index 5f5a676b7..4d077396f 100755 --- a/core/datapool/pom.xml +++ b/core/datapool/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.1-SNAPSHOT + 4.2.1 ../../bom/parent/pom.xml diff --git a/core/spring-utils/pom.xml b/core/spring-utils/pom.xml index cadef8d12..d342d58a9 100755 --- a/core/spring-utils/pom.xml +++ b/core/spring-utils/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.1-SNAPSHOT + 4.2.1 ../../bom/parent/pom.xml diff --git a/core/taskpool/pom.xml b/core/taskpool/pom.xml index 5d150288a..6521a103a 100755 --- a/core/taskpool/pom.xml +++ b/core/taskpool/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.1-SNAPSHOT + 4.2.1 ../../bom/parent/pom.xml diff --git a/core/taskpool/taskpool-api/pom.xml b/core/taskpool/taskpool-api/pom.xml index 2534e400c..5ea93501d 100755 --- a/core/taskpool/taskpool-api/pom.xml +++ b/core/taskpool/taskpool-api/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-taskpool-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-taskpool-api diff --git a/core/taskpool/taskpool-core/pom.xml b/core/taskpool/taskpool-core/pom.xml index 7dedb3f7b..a936b3e08 100755 --- a/core/taskpool/taskpool-core/pom.xml +++ b/core/taskpool/taskpool-core/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-taskpool-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-taskpool-core diff --git a/core/taskpool/taskpool-event/pom.xml b/core/taskpool/taskpool-event/pom.xml index f61d24f6b..5d323cb29 100644 --- a/core/taskpool/taskpool-event/pom.xml +++ b/core/taskpool/taskpool-event/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-taskpool-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-taskpool-event diff --git a/integration/camunda-bpm/engine-client/pom.xml b/integration/camunda-bpm/engine-client/pom.xml index 078f2a4f5..fed4fc227 100644 --- a/integration/camunda-bpm/engine-client/pom.xml +++ b/integration/camunda-bpm/engine-client/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-integration-camunda-bpm-engine-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-camunda-bpm-engine-client diff --git a/integration/camunda-bpm/pom.xml b/integration/camunda-bpm/pom.xml index 61b9f657e..549af1a37 100644 --- a/integration/camunda-bpm/pom.xml +++ b/integration/camunda-bpm/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.1-SNAPSHOT + 4.2.1 ../../bom/parent/pom.xml diff --git a/integration/camunda-bpm/springboot-autoconfigure/pom.xml b/integration/camunda-bpm/springboot-autoconfigure/pom.xml index 1579f0707..3866b867d 100755 --- a/integration/camunda-bpm/springboot-autoconfigure/pom.xml +++ b/integration/camunda-bpm/springboot-autoconfigure/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-camunda-bpm-engine-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-camunda-bpm-springboot-autoconfigure diff --git a/integration/camunda-bpm/springboot-starter/pom.xml b/integration/camunda-bpm/springboot-starter/pom.xml index e7bd8c498..d14a28777 100755 --- a/integration/camunda-bpm/springboot-starter/pom.xml +++ b/integration/camunda-bpm/springboot-starter/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-camunda-bpm-engine-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-camunda-bpm-springboot-starter diff --git a/integration/camunda-bpm/taskpool-collector/pom.xml b/integration/camunda-bpm/taskpool-collector/pom.xml index ec53d4d24..021a3c859 100755 --- a/integration/camunda-bpm/taskpool-collector/pom.xml +++ b/integration/camunda-bpm/taskpool-collector/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-camunda-bpm-engine-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-camunda-bpm-taskpool-collector diff --git a/integration/camunda-bpm/taskpool-job-sender/pom.xml b/integration/camunda-bpm/taskpool-job-sender/pom.xml index 793cb990d..3392b5a2f 100755 --- a/integration/camunda-bpm/taskpool-job-sender/pom.xml +++ b/integration/camunda-bpm/taskpool-job-sender/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-camunda-bpm-engine-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-camunda-bpm-taskpool-job-sender diff --git a/integration/common/datapool-sender/pom.xml b/integration/common/datapool-sender/pom.xml index 921eb4e8d..c4df09900 100755 --- a/integration/common/datapool-sender/pom.xml +++ b/integration/common/datapool-sender/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-common-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-datapool-sender diff --git a/integration/common/pom.xml b/integration/common/pom.xml index bc958fdda..986c1d77f 100755 --- a/integration/common/pom.xml +++ b/integration/common/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.1-SNAPSHOT + 4.2.1 ../../bom/parent/pom.xml diff --git a/integration/common/tasklist-url-resolver/pom.xml b/integration/common/tasklist-url-resolver/pom.xml index 658121e2f..02ef57e0c 100644 --- a/integration/common/tasklist-url-resolver/pom.xml +++ b/integration/common/tasklist-url-resolver/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-common-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-tasklist-url-resolver diff --git a/integration/common/taskpool-sender/pom.xml b/integration/common/taskpool-sender/pom.xml index be46e9579..879d26c4a 100755 --- a/integration/common/taskpool-sender/pom.xml +++ b/integration/common/taskpool-sender/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-common-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-taskpool-sender diff --git a/integration/common/variable-serializer/pom.xml b/integration/common/variable-serializer/pom.xml index c2ecdd4c7..7921fbe5c 100755 --- a/integration/common/variable-serializer/pom.xml +++ b/integration/common/variable-serializer/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-integration-common-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-variable-serializer diff --git a/pom.xml b/pom.xml index d94b5937c..3f484f2ec 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-root - 4.2.1-SNAPSHOT + 4.2.1 pom POM: ${project.artifactId} diff --git a/view/form-url-resolver/pom.xml b/view/form-url-resolver/pom.xml index a827624bf..0b8a1bc30 100644 --- a/view/form-url-resolver/pom.xml +++ b/view/form-url-resolver/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-form-url-resolver diff --git a/view/jpa/pom.xml b/view/jpa/pom.xml index 8d6ca0f2c..cefd4c3f0 100644 --- a/view/jpa/pom.xml +++ b/view/jpa/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-view-jpa diff --git a/view/mongo/pom.xml b/view/mongo/pom.xml index 0f2dbce60..0590fc6c5 100644 --- a/view/mongo/pom.xml +++ b/view/mongo/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-view-mongo diff --git a/view/pom.xml b/view/pom.xml index 1763bfb73..290c55978 100644 --- a/view/pom.xml +++ b/view/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.2.1-SNAPSHOT + 4.2.1 ../bom/parent/pom.xml diff --git a/view/simple/pom.xml b/view/simple/pom.xml index 5bf75367a..a302dd3fd 100755 --- a/view/simple/pom.xml +++ b/view/simple/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-view-simple diff --git a/view/view-api-client/pom.xml b/view/view-api-client/pom.xml index f153ac496..95bcb18f4 100755 --- a/view/view-api-client/pom.xml +++ b/view/view-api-client/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-view-api-client diff --git a/view/view-api/pom.xml b/view/view-api/pom.xml index 113f82476..f6544a893 100755 --- a/view/view-api/pom.xml +++ b/view/view-api/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.2.1-SNAPSHOT + 4.2.1 polyflow-view-api