Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Get the evaluation time of the decision #343

Merged
merged 1 commit into from
Mar 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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