diff --git a/data/src/main/kotlin/io/zeebe/zeeqs/data/repository/DecisionEvaluationRepository.kt b/data/src/main/kotlin/io/zeebe/zeeqs/data/repository/DecisionEvaluationRepository.kt index f90c19bb..e3fc2930 100644 --- a/data/src/main/kotlin/io/zeebe/zeeqs/data/repository/DecisionEvaluationRepository.kt +++ b/data/src/main/kotlin/io/zeebe/zeeqs/data/repository/DecisionEvaluationRepository.kt @@ -27,9 +27,16 @@ interface DecisionEvaluationRepository : PagingAndSortingRepository + fun findAllByProcessInstanceKeyAndStateIn( + processInstanceKey: Long, + stateIn: List, + pageable: Pageable + ): List - fun countByProcessInstanceKey(processInstanceKey: Long): Long + fun countByProcessInstanceKeyAndStateIn( + processInstanceKey: Long, + stateIn: List + ): Long fun findAllByElementInstanceKey(elementInstanceKey: Long): List diff --git a/graphql-api/src/main/kotlin/io/zeebe/zeeqs/graphql/resolvers/type/ProcessInstanceResolver.kt b/graphql-api/src/main/kotlin/io/zeebe/zeeqs/graphql/resolvers/type/ProcessInstanceResolver.kt index 8b5d260e..195839d2 100644 --- a/graphql-api/src/main/kotlin/io/zeebe/zeeqs/graphql/resolvers/type/ProcessInstanceResolver.kt +++ b/graphql-api/src/main/kotlin/io/zeebe/zeeqs/graphql/resolvers/type/ProcessInstanceResolver.kt @@ -152,10 +152,26 @@ class ProcessInstanceResolver( } @SchemaMapping(typeName = "ProcessInstance", field = "decisionEvaluations") - fun decisionEvaluations(processInstance: ProcessInstance): DecisionEvaluationConnection { + fun decisionEvaluations( + processInstance: ProcessInstance, + @Argument perPage: Int, + @Argument page: Int, + @Argument stateIn: List + ): DecisionEvaluationConnection { return DecisionEvaluationConnection( - getItems = { decisionEvaluationRepository.findAllByProcessInstanceKey(processInstanceKey = processInstance.key) }, - getCount = { decisionEvaluationRepository.countByProcessInstanceKey(processInstanceKey = processInstance.key) } + getItems = { + decisionEvaluationRepository.findAllByProcessInstanceKeyAndStateIn( + processInstanceKey = processInstance.key, + stateIn = stateIn, + pageable = PageRequest.of(page, perPage) + ) + }, + getCount = { + decisionEvaluationRepository.countByProcessInstanceKeyAndStateIn( + processInstanceKey = processInstance.key, + stateIn = stateIn + ) + } ) } } \ No newline at end of file diff --git a/graphql-api/src/main/resources/graphql/ProcessInstance.graphqls b/graphql-api/src/main/resources/graphql/ProcessInstance.graphqls index f0520466..acafefd8 100644 --- a/graphql-api/src/main/resources/graphql/ProcessInstance.graphqls +++ b/graphql-api/src/main/resources/graphql/ProcessInstance.graphqls @@ -45,7 +45,11 @@ type ProcessInstance { # the opened message subscriptions related to the process instance (e.g. message catch events) messageSubscriptions: [MessageSubscription!] # The evaluated decisions that are called by a business rule task of this process instance. - decisionEvaluations: DecisionEvaluationConnection + decisionEvaluations( + perPage: Int = 10, + page: Int = 0, + stateIn: [DecisionEvaluationState!] = [EVALUATED, FAILED] + ): DecisionEvaluationConnection # the occurred error related to the process instance error: Error }