use of org.kie.kogito.tracing.decision.event.evaluate.EvaluateEventType in project kogito-runtimes by kiegroup.
the class DefaultAggregator method buildTraceExecutionStep.
private static TraceExecutionStep buildTraceExecutionStep(DMNModel model, DefaultAggregatorStackEntry stackEntry, EvaluateEvent afterEvent) {
TraceExecutionStepType type = Optional.ofNullable(afterEvent.getType()).map(EvaluateEventType::toTraceExecutionStepType).orElse(null);
if (type == null) {
return null;
}
long duration = Optional.ofNullable(stackEntry).map(DefaultAggregatorStackEntry::getBeforeEvent).map(beforeEvent -> computeDurationMillis(beforeEvent, afterEvent)).orElse(0L);
List<TraceExecutionStep> children = Optional.ofNullable(stackEntry).map(DefaultAggregatorStackEntry::getChildren).orElse(Collections.emptyList());
switch(type) {
case DMN_BKM_EVALUATION:
case DMN_DECISION_SERVICE:
case DMN_BKM_INVOCATION:
return buildDefaultTraceExecutionStep(duration, afterEvent, children, type);
case DMN_CONTEXT_ENTRY:
return buildDmnContextEntryTraceExecutionStep(duration, afterEvent, children, model);
case DMN_DECISION:
return buildDmnDecisionTraceExecutionStep(duration, afterEvent, children);
case DMN_DECISION_TABLE:
return buildDmnDecisionTableTraceExecutionStep(duration, afterEvent, children, model);
default:
return null;
}
}
Aggregations