diff --git a/bom/datapool-dependencies/pom.xml b/bom/datapool-dependencies/pom.xml index 37515e254..5f744e008 100644 --- a/bom/datapool-dependencies/pom.xml +++ b/bom/datapool-dependencies/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.1.1 + 4.1.2 ../parent/pom.xml diff --git a/bom/parent/pom.xml b/bom/parent/pom.xml index b9dff31a3..1e7ed21b4 100644 --- a/bom/parent/pom.xml +++ b/bom/parent/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-root - 4.1.1 + 4.1.2 ../../pom.xml @@ -21,14 +21,14 @@ 3.1.5 7.20.0 - 4.9.2 + 4.9.3 4.9.0 2.0.0 4.2.0 5.2.1 1.3.1 - 1.3.0.0 + 1.3.1.0 **/*ITest.* **/itest/**/*.* diff --git a/bom/taskpool-dependencies/pom.xml b/bom/taskpool-dependencies/pom.xml index c146f3757..28b6db085 100644 --- a/bom/taskpool-dependencies/pom.xml +++ b/bom/taskpool-dependencies/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.1.1 + 4.1.2 ../parent/pom.xml diff --git a/core/bus-jackson/pom.xml b/core/bus-jackson/pom.xml index 947a51a4a..4c60288ff 100755 --- a/core/bus-jackson/pom.xml +++ b/core/bus-jackson/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.1.1 + 4.1.2 ../../bom/parent/pom.xml diff --git a/core/datapool/datapool-api/pom.xml b/core/datapool/datapool-api/pom.xml index ccf9a139d..1f291d66a 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.1.1 + 4.1.2 polyflow-datapool-api diff --git a/core/datapool/datapool-core/pom.xml b/core/datapool/datapool-core/pom.xml index aeeb76e25..3490b93db 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.1.1 + 4.1.2 polyflow-datapool-core diff --git a/core/datapool/datapool-event/pom.xml b/core/datapool/datapool-event/pom.xml index 6dcafa688..2d05c720c 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.1.1 + 4.1.2 polyflow-datapool-event diff --git a/core/datapool/pom.xml b/core/datapool/pom.xml index c73a5b7fc..11771f3a7 100755 --- a/core/datapool/pom.xml +++ b/core/datapool/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.1.1 + 4.1.2 ../../bom/parent/pom.xml diff --git a/core/spring-utils/pom.xml b/core/spring-utils/pom.xml index 06ba03b73..4dd4ae15d 100755 --- a/core/spring-utils/pom.xml +++ b/core/spring-utils/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.1.1 + 4.1.2 ../../bom/parent/pom.xml diff --git a/core/taskpool/pom.xml b/core/taskpool/pom.xml index 831b01117..98bda5c5c 100755 --- a/core/taskpool/pom.xml +++ b/core/taskpool/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.1.1 + 4.1.2 ../../bom/parent/pom.xml diff --git a/core/taskpool/taskpool-api/pom.xml b/core/taskpool/taskpool-api/pom.xml index e81f6504f..7e889d527 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.1.1 + 4.1.2 polyflow-taskpool-api diff --git a/core/taskpool/taskpool-core/pom.xml b/core/taskpool/taskpool-core/pom.xml index 5df9eace9..90090387e 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.1.1 + 4.1.2 polyflow-taskpool-core diff --git a/core/taskpool/taskpool-event/pom.xml b/core/taskpool/taskpool-event/pom.xml index fe7b0a741..abb01235f 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.1.1 + 4.1.2 polyflow-taskpool-event diff --git a/integration/camunda-bpm/engine-client/pom.xml b/integration/camunda-bpm/engine-client/pom.xml index 07aa42010..47b8cc6d3 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.1.1 + 4.1.2 polyflow-camunda-bpm-engine-client diff --git a/integration/camunda-bpm/pom.xml b/integration/camunda-bpm/pom.xml index 989252776..893f72197 100644 --- a/integration/camunda-bpm/pom.xml +++ b/integration/camunda-bpm/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.1.1 + 4.1.2 ../../bom/parent/pom.xml diff --git a/integration/camunda-bpm/springboot-autoconfigure/pom.xml b/integration/camunda-bpm/springboot-autoconfigure/pom.xml index 3d81ba5e4..a80b1d713 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.1.1 + 4.1.2 polyflow-camunda-bpm-springboot-autoconfigure diff --git a/integration/camunda-bpm/springboot-starter/pom.xml b/integration/camunda-bpm/springboot-starter/pom.xml index c3ba693bc..5a522924a 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.1.1 + 4.1.2 polyflow-camunda-bpm-springboot-starter diff --git a/integration/camunda-bpm/taskpool-collector/pom.xml b/integration/camunda-bpm/taskpool-collector/pom.xml index b51187b0a..3ccff3205 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.1.1 + 4.1.2 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 f3cf1f8ea..468b01175 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.1.1 + 4.1.2 polyflow-camunda-bpm-taskpool-job-sender diff --git a/integration/common/datapool-sender/pom.xml b/integration/common/datapool-sender/pom.xml index 51af78fb1..a0cfa39ee 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.1.1 + 4.1.2 polyflow-datapool-sender diff --git a/integration/common/pom.xml b/integration/common/pom.xml index ac349c944..e232cb9a9 100755 --- a/integration/common/pom.xml +++ b/integration/common/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.1.1 + 4.1.2 ../../bom/parent/pom.xml diff --git a/integration/common/tasklist-url-resolver/pom.xml b/integration/common/tasklist-url-resolver/pom.xml index 802fd4196..94022f73e 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.1.1 + 4.1.2 polyflow-tasklist-url-resolver diff --git a/integration/common/taskpool-sender/pom.xml b/integration/common/taskpool-sender/pom.xml index 4202433ec..51fa7b062 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.1.1 + 4.1.2 polyflow-taskpool-sender diff --git a/integration/common/variable-serializer/pom.xml b/integration/common/variable-serializer/pom.xml index 081cbed9e..865e400b1 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.1.1 + 4.1.2 polyflow-variable-serializer diff --git a/pom.xml b/pom.xml index 0d6dc1a35..ddbe1620a 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ io.holunda.polyflow polyflow-root - 4.1.1 + 4.1.2 pom POM: ${project.artifactId} diff --git a/view/form-url-resolver/pom.xml b/view/form-url-resolver/pom.xml index b717f81f4..958bda03c 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.1.1 + 4.1.2 polyflow-form-url-resolver diff --git a/view/jpa/pom.xml b/view/jpa/pom.xml index 0a77e71aa..271752b76 100644 --- a/view/jpa/pom.xml +++ b/view/jpa/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.1.1 + 4.1.2 polyflow-view-jpa @@ -233,7 +233,7 @@ com.microsoft.sqlserver mssql-jdbc - 12.5.0.jre11-preview + 12.6.0.jre11 org.postgresql diff --git a/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/CountByApplication.kt b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/CountByApplication.kt new file mode 100644 index 000000000..8fdfe587c --- /dev/null +++ b/view/jpa/src/main/kotlin/io/holunda/polyflow/view/jpa/CountByApplication.kt @@ -0,0 +1,15 @@ +package io.holunda.polyflow.view.jpa + +/** + * Helper multi-valued class to support count by application name queries. + */ +data class CountByApplication( + /** + * application name (grouping criteria). + */ + val applicationName: String, + /** + * Count. + */ + val count: Long +) 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 5ad12f4c3..be569047d 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 @@ -292,7 +292,9 @@ class JpaPolyflowViewTaskService( @QueryHandler override fun query(query: TaskCountByApplicationQuery): List { - TODO("Count by application query is not implemented yet") + return taskRepository.getCountByApplication().map { + ApplicationWithTaskCount(application = it.applicationName, taskCount = it.count.toInt()) + } } @QueryHandler 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 f7aacd7d2..a1a65416e 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 @@ -1,11 +1,13 @@ package io.holunda.polyflow.view.jpa.task +import io.holunda.polyflow.view.jpa.CountByApplication import io.holunda.polyflow.view.jpa.auth.AuthorizationPrincipal import io.holunda.polyflow.view.jpa.composeOr import io.holunda.polyflow.view.jpa.payload.PayloadAttribute import io.holunda.polyflow.view.jpa.process.SourceReferenceEmbeddable import org.springframework.data.jpa.domain.Specification import org.springframework.data.jpa.repository.JpaSpecificationExecutor +import org.springframework.data.jpa.repository.Query import org.springframework.data.repository.CrudRepository import java.time.Instant @@ -268,4 +270,14 @@ interface TaskRepository : CrudRepository, JpaSpecificationE builder.and(pathEquals, valueAnyOf) } } + + + /** + * 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. + * @return list of count by application groupings. + */ + @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 + } 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 a1d3ace6d..6da80a10f 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 @@ -514,6 +514,16 @@ internal class JpaPolyflowViewServiceTaskITest { } + @Test + fun `should count tasks`() { + + val counts = jpaPolyflowViewService.query(TaskCountByApplicationQuery()) + assertThat(counts).isNotNull + assertThat(counts).hasSize(1) + assertThat(counts[0].application).isEqualTo("test-application") + assertThat(counts[0].taskCount).isEqualTo(3) + } + private fun captureEmittedQueryUpdates(): List> { val queryTypeCaptor = argumentCaptor>() val predicateCaptor = argumentCaptor>() diff --git a/view/mongo/pom.xml b/view/mongo/pom.xml index 4d5b184c9..204e6b843 100644 --- a/view/mongo/pom.xml +++ b/view/mongo/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.1.1 + 4.1.2 polyflow-view-mongo diff --git a/view/pom.xml b/view/pom.xml index 44cd1dbb8..9ba864f67 100644 --- a/view/pom.xml +++ b/view/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-parent - 4.1.1 + 4.1.2 ../bom/parent/pom.xml diff --git a/view/simple/pom.xml b/view/simple/pom.xml index 59fae6f21..84bd56b5a 100755 --- a/view/simple/pom.xml +++ b/view/simple/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.1.1 + 4.1.2 polyflow-view-simple diff --git a/view/view-api-client/pom.xml b/view/view-api-client/pom.xml index 24a46c755..0b1a67bf3 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.1.1 + 4.1.2 polyflow-view-api-client diff --git a/view/view-api/pom.xml b/view/view-api/pom.xml index f92e462cb..912e49740 100755 --- a/view/view-api/pom.xml +++ b/view/view-api/pom.xml @@ -6,7 +6,7 @@ io.holunda.polyflow polyflow-view-parent - 4.1.1 + 4.1.2 polyflow-view-api