diff --git a/data/src/main/kotlin/io/zeebe/zeeqs/data/repository/ErrorRepository.kt b/data/src/main/kotlin/io/zeebe/zeeqs/data/repository/ErrorRepository.kt index 225921ca..dd593d03 100644 --- a/data/src/main/kotlin/io/zeebe/zeeqs/data/repository/ErrorRepository.kt +++ b/data/src/main/kotlin/io/zeebe/zeeqs/data/repository/ErrorRepository.kt @@ -6,4 +6,7 @@ import org.springframework.stereotype.Repository @Repository interface ErrorRepository: PagingAndSortingRepository { + + fun findByProcessInstanceKey(processInstanceKey: Long): Error? + } \ No newline at end of file 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 915127b2..0f67f20f 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 @@ -16,7 +16,8 @@ class ProcessInstanceResolver( val incidentRepository: IncidentRepository, val elementInstanceRepository: ElementInstanceRepository, val timerRepository: TimerRepository, - val messageSubscriptionRepository: MessageSubscriptionRepository + val messageSubscriptionRepository: MessageSubscriptionRepository, + val errorRepository: ErrorRepository ) : GraphQLResolver { fun startTime(processInstance: ProcessInstance, zoneId: String): String? { @@ -77,4 +78,8 @@ class ProcessInstanceResolver( return messageSubscriptionRepository.findByProcessInstanceKey(processInstance.key) } + fun error(processInstance: ProcessInstance): Error? { + return errorRepository.findByProcessInstanceKey(processInstance.key) + } + } \ 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 ca3ca3b1..4ca6890e 100644 --- a/graphql-api/src/main/resources/graphql/ProcessInstance.graphqls +++ b/graphql-api/src/main/resources/graphql/ProcessInstance.graphqls @@ -34,6 +34,8 @@ type ProcessInstance { timers: [Timer!] # the opened message subscriptions related to the process instance (e.g. message catch events) messageSubscriptions: [MessageSubscription!] + # the occurred error related to the process instance + error: Error } enum ProcessInstanceState {