Skip to content

Commit

Permalink
Merge pull request #343 from camunda-community-hub/decision-evaluatio…
Browse files Browse the repository at this point in the history
…n-time

feat: Get the evaluation time of the decision
  • Loading branch information
saig0 authored Mar 2, 2023
2 parents bc928e2 + 0554f6f commit 61d1fa3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package io.zeebe.zeeqs.graphql.resolvers.type
import io.zeebe.zeeqs.data.entity.*
import io.zeebe.zeeqs.data.repository.*
import org.springframework.data.repository.findByIdOrNull
import org.springframework.graphql.data.method.annotation.Argument
import org.springframework.graphql.data.method.annotation.SchemaMapping
import org.springframework.stereotype.Controller
import kotlin.jvm.optionals.getOrNull
Expand Down Expand Up @@ -46,6 +47,19 @@ class DecisionEvaluationResolver(
}
}

@SchemaMapping(typeName = "DecisionEvaluation", field = "evaluationTime")
fun evaluationTime(
decisionEvaluation: DecisionEvaluation,
@Argument zoneId: String
): String? {
return decisionEvaluation.evaluationTime.let {
ResolverExtension.timestampToString(
it,
zoneId
)
}
}

@SchemaMapping(typeName = "DecisionEvaluation", field = "evaluatedDecisions")
fun evaluatedDecisions(decisionEvaluation: DecisionEvaluation): List<EvaluatedDecision> {
return evaluatedDecisionRepository.findAllByDecisionEvaluationKey(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ type DecisionEvaluation {
decisionOutput: String!
# The state of the evaluation (i.e. evaluation was successful or with failures).
state: DecisionEvaluationState!
# The time when the decision was evaluated.
evaluationTime(zoneId: String = "Z"): String!
# All evaluated decisions (i.e. the root decision and all required decisions).
evaluatedDecisions: [EvaluatedDecision!]
# The failure message if the evaluation was not successful.
Expand Down

0 comments on commit 61d1fa3

Please sign in to comment.