diff --git a/bom/datapool-dependencies/pom.xml b/bom/datapool-dependencies/pom.xml index 82208fc6c..356589eb6 100644 --- a/bom/datapool-dependencies/pom.xml +++ b/bom/datapool-dependencies/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 3.8.0 + 3.8.1 ../parent/pom.xml diff --git a/bom/parent/pom.xml b/bom/parent/pom.xml index 84ee2099f..6fe99cedc 100644 --- a/bom/parent/pom.xml +++ b/bom/parent/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-root - 3.8.0 + 3.8.1 ../../pom.xml diff --git a/bom/taskpool-dependencies/pom.xml b/bom/taskpool-dependencies/pom.xml index 998b7d34a..d3f7dbc96 100644 --- a/bom/taskpool-dependencies/pom.xml +++ b/bom/taskpool-dependencies/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 3.8.0 + 3.8.1 ../parent/pom.xml diff --git a/core/bus-jackson/pom.xml b/core/bus-jackson/pom.xml index 5792427be..b630efcc6 100755 --- a/core/bus-jackson/pom.xml +++ b/core/bus-jackson/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 3.8.0 + 3.8.1 ../../bom/parent/pom.xml @@ -71,5 +71,11 @@ jackson-datatype-jsr310 test + + org.junit.jupiter + junit-jupiter-params + test + + diff --git a/core/bus-jackson/src/main/kotlin/io/holunda/polyflow/bus/jackson/JacksonExtensions.kt b/core/bus-jackson/src/main/kotlin/io/holunda/polyflow/bus/jackson/JacksonExtensions.kt index c1d9c8ece..24f9694ef 100644 --- a/core/bus-jackson/src/main/kotlin/io/holunda/polyflow/bus/jackson/JacksonExtensions.kt +++ b/core/bus-jackson/src/main/kotlin/io/holunda/polyflow/bus/jackson/JacksonExtensions.kt @@ -4,17 +4,26 @@ import com.fasterxml.jackson.databind.ObjectMapper import io.holunda.camunda.taskpool.api.business.AuthorizationChange import io.holunda.camunda.taskpool.api.task.SourceReference import io.holunda.polyflow.view.filter.Criterion +import io.holunda.polyflow.view.query.process.variable.ProcessVariableFilter /** * Configures object mapper. */ fun ObjectMapper.configurePolyflowJacksonObjectMapper(): ObjectMapper = this + /* + * List all custom modules. + */ .registerModule(VariableMapTypeMappingModule()) .registerModule(DataEntryStateTypeMappingModule()) .apply { + /* + * List here all interfaces used in messages, which have multiple implementations and require additional + * type descriminator. + */ addMixIn(SourceReference::class.java, KotlinTypeInfo::class.java) addMixIn(AuthorizationChange::class.java, KotlinTypeInfo::class.java) addMixIn(Criterion::class.java, KotlinTypeInfo::class.java) + addMixIn(ProcessVariableFilter::class.java, KotlinTypeInfo::class.java) } /** diff --git a/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/data/DataEntryQueriesDeserializationTest.kt b/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/data/DataEntryQueriesDeserializationTest.kt new file mode 100644 index 000000000..190700dba --- /dev/null +++ b/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/data/DataEntryQueriesDeserializationTest.kt @@ -0,0 +1,54 @@ +package io.holunda.polyflow.view.query.data + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import io.holunda.polyflow.bus.jackson.configurePolyflowJacksonObjectMapper +import io.holunda.polyflow.view.auth.User +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.MethodSource +import java.util.stream.Stream + +/** + * Test to make sure all queries and responses are deserializable. + */ +internal class DataEntryQueriesDeserializationTest { + + private val objectMapper: ObjectMapper = jacksonObjectMapper().configurePolyflowJacksonObjectMapper() + + companion object { + @JvmStatic + fun provideDataEntryQueries(): Stream = Stream.of( + Arguments.of( + DataEntryForIdentityQuery::class.java, + DataEntryForIdentityQuery(entryId = "4711", entryType = "domain.type") + ), Arguments.of( + DataEntryForIdentityQuery::class.java, + DataEntryForIdentityQuery(QueryDataIdentity(entryId = "4711", entryType = "domain.type")) + ), + + Arguments.of( + DataEntriesForUserQuery::class.java, + DataEntriesForUserQuery( + user = User( + username = "kermit", groups = setOf("muppets") + ), page = 1, size = 50, sort = "+name", filters = listOf("data.name=test") + ) + ), Arguments.of( + DataEntriesForDataEntryTypeQuery::class.java, + DataEntriesForDataEntryTypeQuery( + entryType = "domain.type", page = 1, size = 50, sort = "+name" + ) + ) + ) + } + + @ParameterizedTest + @MethodSource("provideDataEntryQueries") + fun `checks serialization is not changing the query`(type: Class, query: Q) { + val serialized = objectMapper.writeValueAsString(query) + val deserialized: Q = objectMapper.readValue(serialized, type) + assertThat(deserialized).isEqualTo(deserialized) + } +} diff --git a/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/process/ProcessDefinitionQueriesDeserializationTest.kt b/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/process/ProcessDefinitionQueriesDeserializationTest.kt new file mode 100644 index 000000000..ec10ed0ff --- /dev/null +++ b/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/process/ProcessDefinitionQueriesDeserializationTest.kt @@ -0,0 +1,39 @@ +package io.holunda.polyflow.view.query.process + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import io.holunda.polyflow.bus.jackson.configurePolyflowJacksonObjectMapper +import io.holunda.polyflow.view.auth.User +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.MethodSource +import java.util.stream.Stream + +/** + * Test to make sure all queries and responses are deserializable. + */ +internal class ProcessDefinitionQueriesDeserializationTest { + + private val objectMapper: ObjectMapper = jacksonObjectMapper().configurePolyflowJacksonObjectMapper() + + companion object { + @JvmStatic + fun provideProcessDefinitionQueries(): Stream = Stream.of( + Arguments.of( + ProcessDefinitionsStartableByUserQuery::class.java, + ProcessDefinitionsStartableByUserQuery( + user = User(username = "kermit", groups = setOf("muppets")) + ) + ), + ) + } + + @ParameterizedTest + @MethodSource("provideProcessDefinitionQueries") + fun `checks serialization is not changing the query`(type: Class, query: Q) { + val serialized = objectMapper.writeValueAsString(query) + val deserialized: Q = objectMapper.readValue(serialized, type) + assertThat(deserialized).isEqualTo(deserialized) + } +} diff --git a/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/process/ProcessInstanceQueriesDeserializationTest.kt b/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/process/ProcessInstanceQueriesDeserializationTest.kt new file mode 100644 index 000000000..57deb80ff --- /dev/null +++ b/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/process/ProcessInstanceQueriesDeserializationTest.kt @@ -0,0 +1,37 @@ +package io.holunda.polyflow.view.query.process + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import io.holunda.polyflow.bus.jackson.configurePolyflowJacksonObjectMapper +import io.holunda.polyflow.view.ProcessInstanceState +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.MethodSource +import java.util.stream.Stream + +/** + * Test to make sure all queries and responses are deserializable. + */ +internal class ProcessInstanceQueriesDeserializationTest { + + private val objectMapper: ObjectMapper = jacksonObjectMapper().configurePolyflowJacksonObjectMapper() + + companion object { + @JvmStatic + fun provideProcessInstanceQueries(): Stream = Stream.of( + Arguments.of( + ProcessInstancesByStateQuery::class.java, + ProcessInstancesByStateQuery(states = setOf(ProcessInstanceState.FINISHED, ProcessInstanceState.CANCELLED)) + ), + ) + } + + @ParameterizedTest + @MethodSource("provideProcessInstanceQueries") + fun `checks serialization is not changing the query`(type: Class, query: Q) { + val serialized = objectMapper.writeValueAsString(query) + val deserialized: Q = objectMapper.readValue(serialized, type) + assertThat(deserialized).isEqualTo(deserialized) + } +} diff --git a/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/process/variable/ProcessInstanceQueriesDeserializationTest.kt b/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/process/variable/ProcessInstanceQueriesDeserializationTest.kt new file mode 100644 index 000000000..543aa1549 --- /dev/null +++ b/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/process/variable/ProcessInstanceQueriesDeserializationTest.kt @@ -0,0 +1,44 @@ +package io.holunda.polyflow.view.query.process.variable + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import io.holunda.polyflow.bus.jackson.configurePolyflowJacksonObjectMapper +import io.holunda.polyflow.view.query.process.variable.filter.ProcessVariableFilterExactlyOne +import io.holunda.polyflow.view.query.process.variable.filter.ProcessVariableFilterOneOf +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.MethodSource +import java.util.stream.Stream + +/** + * Test to make sure all queries and responses are deserializable. + */ +internal class ProcessInstanceQueriesDeserializationTest { + + private val objectMapper: ObjectMapper = jacksonObjectMapper().configurePolyflowJacksonObjectMapper() + + companion object { + @JvmStatic + fun provideProcessVariableQueries(): Stream = Stream.of( + Arguments.of( + ProcessVariablesForInstanceQuery::class.java, + ProcessVariablesForInstanceQuery( + processInstanceId = "4712", + variableFilter = listOf( + ProcessVariableFilterOneOf(setOf("var1", "var2")), + ProcessVariableFilterExactlyOne("var3") + ) + ) + ), + ) + } + + @ParameterizedTest + @MethodSource("provideProcessVariableQueries") + fun `checks serialization is not changing the query`(type: Class, query: Q) { + val serialized = objectMapper.writeValueAsString(query) + val deserialized: Q = objectMapper.readValue(serialized, type) + assertThat(deserialized).isEqualTo(deserialized) + } +} diff --git a/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/task/TaskQueriesDeserializationTest.kt b/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/task/TaskQueriesDeserializationTest.kt new file mode 100644 index 000000000..873ef505a --- /dev/null +++ b/core/bus-jackson/src/test/kotlin/io/holunda/polyflow/view/query/task/TaskQueriesDeserializationTest.kt @@ -0,0 +1,109 @@ +package io.holunda.polyflow.view.query.task + +import com.fasterxml.jackson.databind.ObjectMapper +import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper +import io.holunda.polyflow.bus.jackson.configurePolyflowJacksonObjectMapper +import io.holunda.polyflow.view.auth.User +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.MethodSource +import java.util.stream.Stream + +/** + * Test to make sure all queries and responses are deserializable. + */ +internal class TaskQueriesDeserializationTest { + + private val objectMapper: ObjectMapper = jacksonObjectMapper().configurePolyflowJacksonObjectMapper() + + companion object { + @JvmStatic + fun provideTaskQueries() = Stream.of( + Arguments.of( + AllTasksQuery::class.java, + AllTasksQuery( + page = 1, + size = 50, + sort = "+name", + filters = listOf("task.name=test") + ) + ), + Arguments.of( + AllTasksWithDataEntriesQuery::class.java, + AllTasksWithDataEntriesQuery( + page = 1, + size = 50, + sort = "+name", + filters = listOf("task.name=test") + ) + ), + Arguments.of( + TaskCountByApplicationQuery::class.java, + TaskCountByApplicationQuery() + ), + Arguments.of( + TaskForIdQuery::class.java, + TaskForIdQuery(id = "4712") + ), + Arguments.of( + TasksForApplicationQuery::class.java, + TasksForApplicationQuery(applicationName = "appl") + ), + Arguments.of( + TasksForGroupQuery::class.java, + TasksForGroupQuery( + user = User(username = "kermit", groups = setOf("muppets")), + page = 1, + size = 50, + sort = "+name", + filters = listOf("task.name=test") + ) + ), + Arguments.of( + TasksForUserQuery::class.java, + TasksForUserQuery( + user = User(username = "kermit", groups = setOf("muppets")), + page = 1, + size = 50, + sort = "+name", + filters = listOf("task.name=test") + ) + ), + Arguments.of( + TasksWithDataEntriesForGroupQuery::class.java, + TasksWithDataEntriesForGroupQuery( + user = User(username = "kermit", groups = setOf("muppets")), + page = 1, + size = 50, + sort = "+name", + filters = listOf("task.name=test") + ) + ), + Arguments.of( + TasksWithDataEntriesForUserQuery::class.java, + TasksWithDataEntriesForUserQuery( + user = User(username = "kermit", groups = setOf("muppets")), + page = 1, + size = 50, + sort = "+name", + filters = listOf("task.name=test") + ) + ), + Arguments.of( + TaskWithDataEntriesForIdQuery::class.java, + TaskWithDataEntriesForIdQuery( + id = "4713" + ) + ), + ) + } + + @ParameterizedTest + @MethodSource("provideTaskQueries") + fun `checks serialization is not changing the query`(type: Class, query: Q) { + val serialized = objectMapper.writeValueAsString(query) + val deserialized: Q = objectMapper.readValue(serialized, type) + assertThat(deserialized).isEqualTo(query) + } +} diff --git a/core/datapool/datapool-api/pom.xml b/core/datapool/datapool-api/pom.xml index b34e02977..eaf481a9d 100755 --- a/core/datapool/datapool-api/pom.xml +++ b/core/datapool/datapool-api/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-datapool-parent - 3.8.0 + 3.8.1 polyflow-datapool-api diff --git a/core/datapool/datapool-core/pom.xml b/core/datapool/datapool-core/pom.xml index a89d8f626..887f7ac40 100644 --- a/core/datapool/datapool-core/pom.xml +++ b/core/datapool/datapool-core/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-datapool-parent - 3.8.0 + 3.8.1 polyflow-datapool-core diff --git a/core/datapool/datapool-event/pom.xml b/core/datapool/datapool-event/pom.xml index aed08c153..b34f70b4f 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 - 3.8.0 + 3.8.1 polyflow-datapool-event diff --git a/core/datapool/pom.xml b/core/datapool/pom.xml index ee4573656..9e61a2937 100755 --- a/core/datapool/pom.xml +++ b/core/datapool/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-parent - 3.8.0 + 3.8.1 ../../bom/parent/pom.xml diff --git a/core/taskpool/pom.xml b/core/taskpool/pom.xml index fd5d41c8c..04d5152fd 100755 --- a/core/taskpool/pom.xml +++ b/core/taskpool/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-parent - 3.8.0 + 3.8.1 ../../bom/parent/pom.xml diff --git a/core/taskpool/taskpool-api/pom.xml b/core/taskpool/taskpool-api/pom.xml index 31a8e9495..5b2db1ad0 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 - 3.8.0 + 3.8.1 polyflow-taskpool-api diff --git a/core/taskpool/taskpool-core/pom.xml b/core/taskpool/taskpool-core/pom.xml index 3cbde6a1c..2a7306245 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 - 3.8.0 + 3.8.1 polyflow-taskpool-core diff --git a/core/taskpool/taskpool-event/pom.xml b/core/taskpool/taskpool-event/pom.xml index fb21946b8..a50ab3e2a 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 - 3.8.0 + 3.8.1 polyflow-taskpool-event diff --git a/docs/reference-guide/components/view-api.md b/docs/reference-guide/components/view-api.md index a8df65b59..b5eb4f0ec 100644 --- a/docs/reference-guide/components/view-api.md +++ b/docs/reference-guide/components/view-api.md @@ -73,11 +73,12 @@ The Data Entry API allows to query for data entries handled by the data-pool. The Data Entry API supports revision-aware queries by JPA and In-Memory implementations **ONLY**. -| Query Type | Description | Payload types | In-Memory | JPA | Mongo DB | -|-------------------------------|---------------------------------------------------------------------------------------|-----------------|-----------|-------|----------| -| DataEntriesForUserQuery | Retrieves a list of data entries accessible by the user with some additional filters. | List | yes | yes | yes | -| DataEntryForIdentityQuery | Retrieves a a list by type and an optional id (without any other filters) | List | yes | yes | yes | -| DataEntriesQuery | Retrieves a list of data entries matching filters | List | yes | yes | yes | +| Query Type | Description | Payload types | In-Memory | JPA | Mongo DB | +|--------------------------------|---------------------------------------------------------------------------------------|-----------------|-----------|-------|----------| +| DataEntriesForUserQuery | Retrieves a list of data entries accessible by the user with some additional filters. | List | yes | yes | yes | +| DataEntryForIdentityQuery | Retrieves a single data entry by type and an id | DataEntry | yes | yes | yes | +| DataEntryForDataEntryTypeQuery | Retrieves a list of data entries by type | List | yes | yes | yes | +| DataEntriesQuery | Retrieves a list of data entries matching filters | List | yes | yes | yes | ## Revision-aware query support diff --git a/integration/camunda-bpm/engine-client/pom.xml b/integration/camunda-bpm/engine-client/pom.xml index aee021cf5..1d397ee40 100644 --- a/integration/camunda-bpm/engine-client/pom.xml +++ b/integration/camunda-bpm/engine-client/pom.xml @@ -4,7 +4,7 @@ io.holunda.polyflow polyflow-integration-camunda-bpm-engine-parent - 3.8.0 + 3.8.1 polyflow-camunda-bpm-engine-client diff --git a/integration/camunda-bpm/pom.xml b/integration/camunda-bpm/pom.xml index 06d75d6f6..046192ce5 100644 --- a/integration/camunda-bpm/pom.xml +++ b/integration/camunda-bpm/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-parent - 3.8.0 + 3.8.1 ../../bom/parent/pom.xml diff --git a/integration/camunda-bpm/springboot-autoconfigure/pom.xml b/integration/camunda-bpm/springboot-autoconfigure/pom.xml index 193e5e3f2..7d39934c9 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 - 3.8.0 + 3.8.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 4dd5802c7..53eb19509 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 - 3.8.0 + 3.8.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 85040e721..abb01344f 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 - 3.8.0 + 3.8.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 5c063a2f2..b047ec661 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 - 3.8.0 + 3.8.1 polyflow-camunda-bpm-taskpool-job-sender diff --git a/integration/common/datapool-sender/pom.xml b/integration/common/datapool-sender/pom.xml index cba55bbaa..c6b312c27 100755 --- a/integration/common/datapool-sender/pom.xml +++ b/integration/common/datapool-sender/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-integration-common-parent - 3.8.0 + 3.8.1 polyflow-datapool-sender diff --git a/integration/common/pom.xml b/integration/common/pom.xml index 470ebe339..5794f84e8 100755 --- a/integration/common/pom.xml +++ b/integration/common/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-parent - 3.8.0 + 3.8.1 ../../bom/parent/pom.xml diff --git a/integration/common/tasklist-url-resolver/pom.xml b/integration/common/tasklist-url-resolver/pom.xml index 6f6320cb6..723af088e 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 - 3.8.0 + 3.8.1 polyflow-tasklist-url-resolver diff --git a/integration/common/taskpool-sender/pom.xml b/integration/common/taskpool-sender/pom.xml index 414042a98..8a8e09c2f 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 - 3.8.0 + 3.8.1 polyflow-taskpool-sender diff --git a/integration/common/variable-serializer/pom.xml b/integration/common/variable-serializer/pom.xml index 84a912fcd..d05c2dcaa 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 - 3.8.0 + 3.8.1 polyflow-variable-serializer diff --git a/pom.xml b/pom.xml index 08b63494f..db8dbd938 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-root - 3.8.0 + 3.8.1 pom POM: ${project.artifactId} diff --git a/view/form-url-resolver/pom.xml b/view/form-url-resolver/pom.xml index 5bcd6652d..22fc99d9b 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 - 3.8.0 + 3.8.1 polyflow-form-url-resolver diff --git a/view/jpa/pom.xml b/view/jpa/pom.xml index 023b31617..8a4ddc287 100644 --- a/view/jpa/pom.xml +++ b/view/jpa/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 3.8.0 + 3.8.1 polyflow-view-jpa diff --git a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewDataEntryService.kt b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewDataEntryService.kt index cf71e08f3..f356f2838 100644 --- a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewDataEntryService.kt +++ b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/JpaPolyflowViewDataEntryService.kt @@ -30,6 +30,7 @@ import org.axonframework.queryhandling.QueryUpdateEmitter import org.springframework.data.domain.Page import org.springframework.data.repository.findByIdOrNull import org.springframework.stereotype.Component +import java.util.* /** * Implementation of the Polyflow Data Entry View API using JPA to create the persistence model. @@ -49,13 +50,18 @@ class JpaPolyflowViewDataEntryService( @QueryHandler override fun query(query: DataEntryForIdentityQuery, metaData: MetaData): QueryResponseMessage { - val specification = composeAnd(listOf(hasEntryId(query.identity.entryId), hasEntryType(query.identity.entryType))) + val specification = composeAnd(listOf(hasEntryId(query.entryId), hasEntryType(query.entryType))) return dataEntryRepository.findOne(specification).map { QueryResponseMessageResponseType.asQueryResponseMessage( payload = it.toDataEntry(objectMapper), metaData = RevisionValue(it.revision).toMetaData() ) - }.orElse(QueryResponseMessageResponseType.asQueryResponseMessage(null)) + }.orElse( + QueryResponseMessageResponseType.asQueryResponseMessage( + payload = null, + metaData = MetaData.emptyInstance() + ) + ) } @QueryHandler diff --git a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/SpecificationExt.kt b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/SpecificationExt.kt index 6b866f983..8cb6747b1 100644 --- a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/SpecificationExt.kt +++ b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/SpecificationExt.kt @@ -63,13 +63,13 @@ fun List.toTaskSpecification(): Specification? { * @param sort optional sort in format +filedName or -fieldName */ fun pageRequest(page: Int, size: Int, sort: String?): PageRequest { - val sort = if (sort.isNullOrBlank()) { + val sortCriteria = if (sort.isNullOrBlank()) { null } else { Sort.by(Sort.Direction.fromOptionalString(sort.substring(0, 1)).orElse(Sort.DEFAULT_DIRECTION), sort.substring(1)) } - return if (sort != null) { - PageRequest.of(page, size, sort) + return if (sortCriteria != null) { + PageRequest.of(page, size, sortCriteria) } else { PageRequest.of(page, size) } 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 df117256e..c27d0a432 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 @@ -198,6 +198,7 @@ internal class JpaPolyflowViewServiceDataEntryITest { val result = jpaPolyflowViewService.query( DataEntryForIdentityQuery(entryType = "io.polyflow.test", entryId = id) ) + assertThat(result.payload).isNotNull assertTestDataEntry1(result.payload) } diff --git a/view/mongo/pom.xml b/view/mongo/pom.xml index b9ab45d11..c3a38b0af 100755 --- a/view/mongo/pom.xml +++ b/view/mongo/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 3.8.0 + 3.8.1 polyflow-view-mongo diff --git a/view/mongo/src/main/kotlin/io/holunda/polyflow/view/mongo/MongoViewService.kt b/view/mongo/src/main/kotlin/io/holunda/polyflow/view/mongo/MongoViewService.kt index ed4f260e7..1e4a74bf9 100755 --- a/view/mongo/src/main/kotlin/io/holunda/polyflow/view/mongo/MongoViewService.kt +++ b/view/mongo/src/main/kotlin/io/holunda/polyflow/view/mongo/MongoViewService.kt @@ -122,7 +122,7 @@ class MongoViewService( @QueryHandler override fun query(query: DataEntryForIdentityQuery, metaData: MetaData): CompletableFuture = dataEntryRepository - .findNotDeletedById(dataIdentityString(entryType = query.identity.entryType, entryId = query.identity.entryId)) + .findNotDeletedById(dataIdentityString(entryType = query.entryType, entryId = query.entryId)) .map { it.dataEntry() } .toFuture() diff --git a/view/pom.xml b/view/pom.xml index 77a0c3e9e..8d21fb035 100644 --- a/view/pom.xml +++ b/view/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-parent - 3.8.0 + 3.8.1 ../bom/parent/pom.xml diff --git a/view/simple/pom.xml b/view/simple/pom.xml index 6673d05e0..9e2c1f2ec 100755 --- a/view/simple/pom.xml +++ b/view/simple/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-view-parent - 3.8.0 + 3.8.1 polyflow-view-simple diff --git a/view/simple/src/main/kotlin/io/holunda/polyflow/view/simple/service/SimpleDataEntryService.kt b/view/simple/src/main/kotlin/io/holunda/polyflow/view/simple/service/SimpleDataEntryService.kt index 74e807150..5537b4ced 100644 --- a/view/simple/src/main/kotlin/io/holunda/polyflow/view/simple/service/SimpleDataEntryService.kt +++ b/view/simple/src/main/kotlin/io/holunda/polyflow/view/simple/service/SimpleDataEntryService.kt @@ -20,6 +20,7 @@ import org.axonframework.queryhandling.QueryHandler import org.axonframework.queryhandling.QueryResponseMessage import org.axonframework.queryhandling.QueryUpdateEmitter import org.springframework.stereotype.Component +import java.util.* import java.util.concurrent.ConcurrentHashMap /** @@ -106,7 +107,10 @@ class SimpleDataEntryService( metaData = filtered.let { revisionSupport.getRevisionMax(listOf(it.identity)).toMetaData() } ) } else { - QueryResponseMessageResponseType.asQueryResponseMessage(null, MetaData.emptyInstance()); + QueryResponseMessageResponseType.asQueryResponseMessage( + payload = null, + metaData = MetaData.emptyInstance() + ) } } diff --git a/view/view-api-client/pom.xml b/view/view-api-client/pom.xml index 51f985427..74c863a8e 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 - 3.8.0 + 3.8.1 polyflow-view-api-client diff --git a/view/view-api/pom.xml b/view/view-api/pom.xml index 959af6b58..d3377d94b 100755 --- a/view/view-api/pom.xml +++ b/view/view-api/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 3.8.0 + 3.8.1 polyflow-view-api diff --git a/view/view-api/src/main/kotlin/query/data/DataEntryApi.kt b/view/view-api/src/main/kotlin/query/data/DataEntryApi.kt index af6122cdb..164f76fa6 100644 --- a/view/view-api/src/main/kotlin/query/data/DataEntryApi.kt +++ b/view/view-api/src/main/kotlin/query/data/DataEntryApi.kt @@ -3,6 +3,7 @@ package io.holunda.polyflow.view.query.data import io.holunda.polyflow.view.DataEntry import org.axonframework.messaging.MetaData import org.axonframework.queryhandling.QueryResponseMessage +import java.util.* /** * Defines an API interface for Data Entry Queries. diff --git a/view/view-api/src/main/kotlin/query/data/DataEntryForIdentityQuery.kt b/view/view-api/src/main/kotlin/query/data/DataEntryForIdentityQuery.kt index f36d1918b..81694a2cb 100755 --- a/view/view-api/src/main/kotlin/query/data/DataEntryForIdentityQuery.kt +++ b/view/view-api/src/main/kotlin/query/data/DataEntryForIdentityQuery.kt @@ -8,26 +8,25 @@ import io.holunda.polyflow.view.query.FilterQuery /** * Query for entry type and optional id. - * @param identity identity to query for. + * @param entryType type of the data entry. + * @param entryId id of the data entry. */ data class DataEntryForIdentityQuery( - val identity: DataIdentity, + val entryType: EntryType, + val entryId: EntryId, ) : FilterQuery { /** - * Compatibility constructor to avoid compile errors. + * Additional convenience constructor. */ constructor( - entryType: EntryType, - entryId: EntryId, + identity: DataIdentity ) : this( - identity = QueryDataIdentity( - entryType = entryType, - entryId = entryId, - ) + entryType = identity.entryType, + entryId = identity.entryId, ) - override fun applyFilter(element: DataEntry) = element.entryType == this.identity.entryType && element.entryId == this.identity.entryId + override fun applyFilter(element: DataEntry) = element.entryType == this.entryType && element.entryId == this.entryId } diff --git a/view/view-api/src/main/kotlin/query/data/ReactiveDataEntryApi.kt b/view/view-api/src/main/kotlin/query/data/ReactiveDataEntryApi.kt index 172f2ac66..5cf664ed7 100644 --- a/view/view-api/src/main/kotlin/query/data/ReactiveDataEntryApi.kt +++ b/view/view-api/src/main/kotlin/query/data/ReactiveDataEntryApi.kt @@ -2,6 +2,7 @@ package io.holunda.polyflow.view.query.data import io.holunda.polyflow.view.DataEntry import org.axonframework.messaging.MetaData +import java.util.* import java.util.concurrent.CompletableFuture /** @@ -13,7 +14,7 @@ interface ReactiveDataEntryApi { * Query data entries for id. * @param query object representing data identity. * @param metaData metadata for the query, may be empty. - * @return completable future with data entries. + * @return query result. */ fun query(query: DataEntryForIdentityQuery, metaData: MetaData = MetaData.emptyInstance()): CompletableFuture diff --git a/view/view-api/src/main/kotlin/query/process/variable/filter/ProcessVariableOneOf.kt b/view/view-api/src/main/kotlin/query/process/variable/filter/ProcessVariableFilterOneOf.kt similarity index 95% rename from view/view-api/src/main/kotlin/query/process/variable/filter/ProcessVariableOneOf.kt rename to view/view-api/src/main/kotlin/query/process/variable/filter/ProcessVariableFilterOneOf.kt index f0f58373b..5f759db73 100644 --- a/view/view-api/src/main/kotlin/query/process/variable/filter/ProcessVariableOneOf.kt +++ b/view/view-api/src/main/kotlin/query/process/variable/filter/ProcessVariableFilterOneOf.kt @@ -7,7 +7,7 @@ import io.holunda.polyflow.view.query.process.variable.ProcessVariableFilterType /** * Filter to query for a list of variables. Every variable present in the list matches the filter. */ -data class ProcessVariableOneOf( +data class ProcessVariableFilterOneOf( val processVariableNames: Set ) : ProcessVariableFilter { diff --git a/view/view-api/src/main/kotlin/query/task/TaskCountByApplicationQuery.kt b/view/view-api/src/main/kotlin/query/task/TaskCountByApplicationQuery.kt index 9a2eae832..fac35edf9 100644 --- a/view/view-api/src/main/kotlin/query/task/TaskCountByApplicationQuery.kt +++ b/view/view-api/src/main/kotlin/query/task/TaskCountByApplicationQuery.kt @@ -3,5 +3,20 @@ package io.holunda.polyflow.view.query.task /** * Query for amount of tasks for every application. */ -class TaskCountByApplicationQuery +class TaskCountByApplicationQuery { + + /* + * This is a marker class. All instances should be equal. + */ + override fun equals(other: Any?): Boolean { + return (other is TaskCountByApplicationQuery) + } + + /* + * This is a marker class. All instances should be equal. + */ + override fun hashCode(): Int { + return 1329081230; + } +}