diff --git a/bom/datapool-dependencies/pom.xml b/bom/datapool-dependencies/pom.xml index 318c13745..575eea33c 100644 --- a/bom/datapool-dependencies/pom.xml +++ b/bom/datapool-dependencies/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 3.9.1 + 3.10.0 ../parent/pom.xml diff --git a/bom/parent/pom.xml b/bom/parent/pom.xml index eeeabdc35..fa47fa2ec 100644 --- a/bom/parent/pom.xml +++ b/bom/parent/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-root - 3.9.1 + 3.10.0 ../../pom.xml diff --git a/bom/taskpool-dependencies/pom.xml b/bom/taskpool-dependencies/pom.xml index 0da55d930..510e10b40 100644 --- a/bom/taskpool-dependencies/pom.xml +++ b/bom/taskpool-dependencies/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 3.9.1 + 3.10.0 ../parent/pom.xml diff --git a/core/bus-jackson/pom.xml b/core/bus-jackson/pom.xml index 919fab839..14804e34a 100755 --- a/core/bus-jackson/pom.xml +++ b/core/bus-jackson/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 3.9.1 + 3.10.0 ../../bom/parent/pom.xml diff --git a/core/datapool/datapool-api/pom.xml b/core/datapool/datapool-api/pom.xml index a323f2b45..fe8de1bf8 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.9.1 + 3.10.0 polyflow-datapool-api diff --git a/core/datapool/datapool-core/pom.xml b/core/datapool/datapool-core/pom.xml index 2d8e6f652..6fa36ea98 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.9.1 + 3.10.0 polyflow-datapool-core diff --git a/core/datapool/datapool-event/pom.xml b/core/datapool/datapool-event/pom.xml index 34601edd1..b515de624 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.9.1 + 3.10.0 polyflow-datapool-event diff --git a/core/datapool/pom.xml b/core/datapool/pom.xml index 931ca2ec6..6da49f0e0 100755 --- a/core/datapool/pom.xml +++ b/core/datapool/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-parent - 3.9.1 + 3.10.0 ../../bom/parent/pom.xml diff --git a/core/taskpool/pom.xml b/core/taskpool/pom.xml index 15baa2bf6..03cd53162 100755 --- a/core/taskpool/pom.xml +++ b/core/taskpool/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-parent - 3.9.1 + 3.10.0 ../../bom/parent/pom.xml diff --git a/core/taskpool/taskpool-api/pom.xml b/core/taskpool/taskpool-api/pom.xml index 826535293..c53613086 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.9.1 + 3.10.0 polyflow-taskpool-api diff --git a/core/taskpool/taskpool-core/pom.xml b/core/taskpool/taskpool-core/pom.xml index 03fb0c306..301875e58 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.9.1 + 3.10.0 polyflow-taskpool-core diff --git a/core/taskpool/taskpool-event/pom.xml b/core/taskpool/taskpool-event/pom.xml index b0505c61f..ec871c1e2 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.9.1 + 3.10.0 polyflow-taskpool-event diff --git a/integration/camunda-bpm/engine-client/pom.xml b/integration/camunda-bpm/engine-client/pom.xml index 214e09e46..434fde71d 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.9.1 + 3.10.0 polyflow-camunda-bpm-engine-client diff --git a/integration/camunda-bpm/pom.xml b/integration/camunda-bpm/pom.xml index 32a27a913..5fd83dcc6 100644 --- a/integration/camunda-bpm/pom.xml +++ b/integration/camunda-bpm/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-parent - 3.9.1 + 3.10.0 ../../bom/parent/pom.xml diff --git a/integration/camunda-bpm/springboot-autoconfigure/pom.xml b/integration/camunda-bpm/springboot-autoconfigure/pom.xml index 4263cf223..540959ed4 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.9.1 + 3.10.0 polyflow-camunda-bpm-springboot-autoconfigure diff --git a/integration/camunda-bpm/springboot-starter/pom.xml b/integration/camunda-bpm/springboot-starter/pom.xml index a1ae2d5cc..e9af668f2 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.9.1 + 3.10.0 polyflow-camunda-bpm-springboot-starter diff --git a/integration/camunda-bpm/taskpool-collector/pom.xml b/integration/camunda-bpm/taskpool-collector/pom.xml index bb6bc3058..d75cfa45b 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.9.1 + 3.10.0 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 17f1efa91..f5ee9f19f 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.9.1 + 3.10.0 polyflow-camunda-bpm-taskpool-job-sender diff --git a/integration/common/datapool-sender/pom.xml b/integration/common/datapool-sender/pom.xml index d5681cefc..06f83b9f7 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.9.1 + 3.10.0 polyflow-datapool-sender diff --git a/integration/common/pom.xml b/integration/common/pom.xml index 41b8049ce..acce6c5aa 100755 --- a/integration/common/pom.xml +++ b/integration/common/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-parent - 3.9.1 + 3.10.0 ../../bom/parent/pom.xml diff --git a/integration/common/tasklist-url-resolver/pom.xml b/integration/common/tasklist-url-resolver/pom.xml index be8d28602..92158c1a1 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.9.1 + 3.10.0 polyflow-tasklist-url-resolver diff --git a/integration/common/taskpool-sender/pom.xml b/integration/common/taskpool-sender/pom.xml index 693885731..1d06c591f 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.9.1 + 3.10.0 polyflow-taskpool-sender diff --git a/integration/common/variable-serializer/pom.xml b/integration/common/variable-serializer/pom.xml index 40e11dccc..6a5fc6579 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.9.1 + 3.10.0 polyflow-variable-serializer diff --git a/pom.xml b/pom.xml index b676145de..e95b93f2b 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-root - 3.9.1 + 3.10.0 pom POM: ${project.artifactId} diff --git a/view/form-url-resolver/pom.xml b/view/form-url-resolver/pom.xml index a32e48a40..d08aeeb3b 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.9.1 + 3.10.0 polyflow-form-url-resolver diff --git a/view/jpa/pom.xml b/view/jpa/pom.xml index 3d49cacff..5527fefe7 100644 --- a/view/jpa/pom.xml +++ b/view/jpa/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 3.9.1 + 3.10.0 polyflow-view-jpa diff --git a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/data/DataEntryEntity.kt b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/data/DataEntryEntity.kt index 23b38f495..a058e6316 100644 --- a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/data/DataEntryEntity.kt +++ b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/data/DataEntryEntity.kt @@ -16,7 +16,6 @@ class DataEntryEntity( @Column(name = "TYPE", nullable = false) var type: String, @Column(name = "NAME", nullable = false) - @Lob var name: String, @Column(name = "APPLICATION_NAME", nullable = false) var applicationName: String, @@ -26,8 +25,7 @@ class DataEntryEntity( var revision: Long = 0L, @Embedded var state: DataEntryStateEmbeddable, - @Column(name = "DESCRIPTION") - @Lob + @Column(name = "DESCRIPTION", length = 2048) var description: String? = null, @Column(name = "DATE_CREATED", nullable = false) diff --git a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/process/ProcessDefinitionEntity.kt b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/process/ProcessDefinitionEntity.kt index d723e1d86..04b1cb1f1 100644 --- a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/process/ProcessDefinitionEntity.kt +++ b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/process/ProcessDefinitionEntity.kt @@ -21,8 +21,7 @@ class ProcessDefinitionEntity( var name: String, @Column(name = "VERSION_TAG") var versionTag: String? = null, - @Column(name = "DESCRIPTION") - @Lob + @Column(name = "DESCRIPTION", length = 2048) var description: String? = null, @Column(name = "START_FORM_KEY") var startFormKey: String? = null, diff --git a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/task/TaskEntity.kt b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/task/TaskEntity.kt index 4fc26282b..53e5165a4 100644 --- a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/task/TaskEntity.kt +++ b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/task/TaskEntity.kt @@ -18,7 +18,6 @@ class TaskEntity( var taskId: String, @Column(name = "TASK_DEF_KEY", nullable = false) var taskDefinitionKey: String, - @Lob @Column(name = "NAME", nullable = false) var name: String, @Column(name = "PRIORITY") @@ -52,8 +51,7 @@ class TaskEntity( var payloadAttributes: MutableSet = mutableSetOf(), @Column(name = "BUSINESS_KEY") var businessKey: String? = null, - @Lob - @Column(name = "DESCRIPTION") + @Column(name = "DESCRIPTION", length = 2048) var description: String? = null, @Column(name = "FORM_KEY") var formKey: String? = null, 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 1456c972d..44b6d64d2 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 @@ -49,6 +49,8 @@ internal class DataEntryRepositoryITest { @BeforeEach fun `insert entries`() { + dataEntryRepository.deleteAll() + entityManager.flush() val id = UUID.randomUUID().toString() diff --git a/view/mongo/pom.xml b/view/mongo/pom.xml index 915c14e9b..40d451fb5 100755 --- a/view/mongo/pom.xml +++ b/view/mongo/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 3.9.1 + 3.10.0 polyflow-view-mongo diff --git a/view/pom.xml b/view/pom.xml index e05741d6c..a7e7ca730 100644 --- a/view/pom.xml +++ b/view/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-parent - 3.9.1 + 3.10.0 ../bom/parent/pom.xml diff --git a/view/simple/pom.xml b/view/simple/pom.xml index ed2df209f..2a7cdaf54 100755 --- a/view/simple/pom.xml +++ b/view/simple/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-view-parent - 3.9.1 + 3.10.0 polyflow-view-simple diff --git a/view/view-api-client/pom.xml b/view/view-api-client/pom.xml index 3c2ffd599..6314f3e87 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.9.1 + 3.10.0 polyflow-view-api-client diff --git a/view/view-api/pom.xml b/view/view-api/pom.xml index 8d75841b5..a71bc672b 100755 --- a/view/view-api/pom.xml +++ b/view/view-api/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 3.9.1 + 3.10.0 polyflow-view-api diff --git a/view/view-api/src/main/kotlin/filter/Filter.kt b/view/view-api/src/main/kotlin/filter/Filter.kt index 1f0cdcf1a..eab6dd3e0 100755 --- a/view/view-api/src/main/kotlin/filter/Filter.kt +++ b/view/view-api/src/main/kotlin/filter/Filter.kt @@ -61,7 +61,7 @@ internal fun compareOperator(sign: String): CompareOperator = } } - EQUALS-> { filter, actual -> filter.toString() == actual.toString() } + EQUALS -> { filter, actual -> filter.toString() == actual.toString() } else -> throw IllegalArgumentException("Unsupported operator $sign") } @@ -105,7 +105,8 @@ fun filterByPredicate(value: TaskWithDataEntries, wrapper: TaskPredicateWrapper) // constraint is defined on task and matches on task property || (wrapper.taskAttributePredicate != null && wrapper.taskAttributePredicate.test(value.task) && wrapper.taskPayloadPredicate == null) // constraint is defined on data and matches on data entry property - || (wrapper.taskAttributePredicate == null && (wrapper.taskPayloadPredicate != null && (value.dataEntries.asSequence().map { dataEntry -> dataEntry.payload } + || (wrapper.taskAttributePredicate == null && (wrapper.taskPayloadPredicate != null && (value.dataEntries.asSequence() + .map { dataEntry -> dataEntry.payload } .find { payload -> wrapper.taskPayloadPredicate.test(payload) } != null || wrapper.taskPayloadPredicate.test(value.task.payload)))) // both constraints || (wrapper.taskAttributePredicate != null && wrapper.taskAttributePredicate.test(value.task) && (wrapper.taskPayloadPredicate != null && (value.dataEntries.asSequence() @@ -140,7 +141,9 @@ fun filterByPredicate(value: Task, wrapper: TaskPredicateWrapper): Boolean = // constraint is defined on data and matches || (wrapper.taskAttributePredicate == null && wrapper.taskPayloadPredicate != null && wrapper.taskPayloadPredicate.test(value.payload)) // both constraints - || (wrapper.taskAttributePredicate != null && wrapper.taskAttributePredicate.test(value) && wrapper.taskPayloadPredicate != null && wrapper.taskPayloadPredicate.test(value.payload)) + || (wrapper.taskAttributePredicate != null && wrapper.taskAttributePredicate.test(value) && wrapper.taskPayloadPredicate != null && wrapper.taskPayloadPredicate.test( + value.payload + )) /** @@ -268,7 +271,14 @@ internal fun toCriterion(filter: String): Criterion { internal fun isTaskAttribute(propertyName: String): Boolean = propertyName.startsWith(TASK_PREFIX) && propertyName.length > TASK_PREFIX.length - && Task::class.memberProperties.map { it.name }.contains(propertyName.substring(TASK_PREFIX.length)) + && propertyName.substring(TASK_PREFIX.length).let { taskAttribute -> + when { + Task::class.memberProperties.map { it.name }.contains(taskAttribute) -> true + taskAttribute == "processName" -> true + taskAttribute == "textSearch" -> true + else -> false + } + } /** * Checks is a property is a data entry attribute. @@ -276,10 +286,13 @@ internal fun isTaskAttribute(propertyName: String): Boolean = internal fun isDataEntryAttribute(propertyName: String): Boolean = propertyName.startsWith(DATA_PREFIX) && propertyName.length > DATA_PREFIX.length - && ( - DataEntry::class.memberProperties.map { it.name }.contains(propertyName.substring(DATA_PREFIX.length)) || - DataEntryState::class.memberProperties.map { "${DataEntry::state.name}.${it.name}" }.contains(propertyName.substring(DATA_PREFIX.length)) - ) + && propertyName.substring(DATA_PREFIX.length).let { dataEntryAttribute -> + when { + DataEntry::class.memberProperties.map { it.name }.contains(dataEntryAttribute) -> true + DataEntryState::class.memberProperties.map { "${DataEntry::state.name}.${it.name}" }.contains(dataEntryAttribute) -> true + else -> false + } + } /** * Criterion. diff --git a/view/view-api/src/test/kotlin/filter/FilterTest.kt b/view/view-api/src/test/kotlin/filter/FilterTest.kt index 033094ad9..8b6cb30e2 100755 --- a/view/view-api/src/test/kotlin/filter/FilterTest.kt +++ b/view/view-api/src/test/kotlin/filter/FilterTest.kt @@ -84,8 +84,11 @@ class FilterTest { fun `should classify properties`() { assertThat(isTaskAttribute("task.id")).isTrue assertThat(isTaskAttribute("task.name")).isTrue - assertThat(isTaskAttribute("task.name")).isTrue + assertThat(isTaskAttribute("task.followUpDate")).isTrue assertThat(isTaskAttribute("task.dueDate")).isTrue + assertThat(isTaskAttribute("task.processName")).isTrue + assertThat(isTaskAttribute("task.textSearch")).isTrue + assertThat(isTaskAttribute("task.businessKey")).isTrue assertThat(isTaskAttribute("task.")).isFalse assertThat(isTaskAttribute("assignee")).isFalse @@ -115,6 +118,20 @@ class FilterTest { } } + @Test + fun `should create task criteria for process name and text search`() { + val criteria = toCriteria(listOf("task.processName${LIKE}foo", "task.textSearch${LIKE}bar")) + assertThat(criteria).isNotNull + assertThat(criteria.size).isEqualTo(2) + assertThat(criteria).containsExactlyElementsOf( + listOf( + Criterion.TaskCriterion("processName", "foo", operator = LIKE), + Criterion.TaskCriterion("textSearch", "bar", operator = LIKE), + ) + ) + } + + @Test fun `should fail to create criteria 2`() { assertThatThrownBy { @@ -134,20 +151,20 @@ class FilterTest { assertThat(predicates).isNotNull assertThat(predicates.taskAttributePredicate).isNotNull - val criteriaWithSpaces = toCriteria(listOf("task.name ${EQUALS} some")) + val criteriaWithSpaces = toCriteria(listOf("task.name $EQUALS some")) val predicatesTrimmed = createTaskPredicates(criteriaWithSpaces) assertThat(predicatesTrimmed).isNotNull assertThat(predicatesTrimmed.taskAttributePredicate).isNotNull } + @Suppress("UNNECESSARY_NOT_NULL_ASSERTION") @Test fun `should create predicates`() { val criteria = toCriteria(filtersList) val predicates = createTaskPredicates(criteria) - assertThat(predicates).isNotNull assertThat(predicates.taskAttributePredicate).isNotNull assertThat(predicates.taskPayloadPredicate).isNotNull