Skip to content

Commit

Permalink
feat: expose error of process instance (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
saig0 authored Aug 25, 2022
1 parent 20d5f6a commit 1e158ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@ import org.springframework.stereotype.Repository

@Repository
interface ErrorRepository: PagingAndSortingRepository<Error, Long> {

fun findByProcessInstanceKey(processInstanceKey: Long): Error?

}
Original file line number Diff line number Diff line change
Expand Up @@ -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<ProcessInstance> {

fun startTime(processInstance: ProcessInstance, zoneId: String): String? {
Expand Down Expand Up @@ -77,4 +78,8 @@ class ProcessInstanceResolver(
return messageSubscriptionRepository.findByProcessInstanceKey(processInstance.key)
}

fun error(processInstance: ProcessInstance): Error? {
return errorRepository.findByProcessInstanceKey(processInstance.key)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 1e158ba

Please sign in to comment.