Skip to content

Commit

Permalink
[incubator-kie-issues#1528] Adapt tracing code. Fix tests (#3727)
Browse files Browse the repository at this point in the history
Co-authored-by: Gabriele-Cardosi <gabriele.cardosi@ibm.com>
  • Loading branch information
gitgabrio and Gabriele-Cardosi authored Oct 16, 2024
1 parent 23155eb commit d9aa6f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
import org.kie.kogito.tracing.event.trace.TraceExecutionStepType;

public enum EvaluateEventType {
AFTER_CONDITIONAL_EVALUATION(false),
BEFORE_EVALUATE_ALL(true),
AFTER_EVALUATE_ALL(false),
BEFORE_EVALUATE_BKM(true),
AFTER_EVALUATE_BKM(false),
AFTER_EVALUATE_CONDITIONAL(false),
BEFORE_EVALUATE_CONTEXT_ENTRY(true),
AFTER_EVALUATE_CONTEXT_ENTRY(false),
BEFORE_EVALUATE_DECISION(true),
Expand Down Expand Up @@ -52,6 +54,10 @@ public boolean isAfter() {

public TraceExecutionStepType toTraceExecutionStepType() {
switch (this) {
case AFTER_CONDITIONAL_EVALUATION:
case AFTER_EVALUATE_CONDITIONAL:
return TraceExecutionStepType.DMN_CONDITIONAL_INVOCATION;

case BEFORE_EVALUATE_CONTEXT_ENTRY:
case AFTER_EVALUATE_CONTEXT_ENTRY:
return TraceExecutionStepType.DMN_CONTEXT_ENTRY;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@
import java.util.Optional;

import org.junit.jupiter.api.Test;
import org.kie.dmn.api.core.event.AfterConditionalEvaluationEvent;
import org.kie.dmn.api.core.event.AfterEvaluateAllEvent;
import org.kie.dmn.api.core.event.AfterEvaluateBKMEvent;
import org.kie.dmn.api.core.event.AfterEvaluateConditionalEvent;
import org.kie.dmn.api.core.event.AfterEvaluateContextEntryEvent;
import org.kie.dmn.api.core.event.AfterEvaluateDecisionEvent;
import org.kie.dmn.api.core.event.AfterEvaluateDecisionServiceEvent;
Expand Down Expand Up @@ -67,6 +69,8 @@ class EvaluateEventTypeTest {
put(EvaluateEventType.AFTER_EVALUATE_DECISION_TABLE, new Pair<>("afterEvaluateDecisionTable", AfterEvaluateDecisionTableEvent.class));
put(EvaluateEventType.BEFORE_INVOKE_BKM, new Pair<>("beforeInvokeBKM", BeforeInvokeBKMEvent.class));
put(EvaluateEventType.AFTER_INVOKE_BKM, new Pair<>("afterInvokeBKM", AfterInvokeBKMEvent.class));
put(EvaluateEventType.AFTER_CONDITIONAL_EVALUATION, new Pair<>("afterConditionalEvaluation", AfterConditionalEvaluationEvent.class));
put(EvaluateEventType.AFTER_EVALUATE_CONDITIONAL, new Pair<>("afterEvaluateConditional", AfterEvaluateConditionalEvent.class));
}
};
private static final Class<DMNRuntimeEventListener> LISTENER_CLASS = DMNRuntimeEventListener.class;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
public enum TraceExecutionStepType {
DMN_BKM_EVALUATION,
DMN_BKM_INVOCATION,
DMN_CONDITIONAL_INVOCATION,
DMN_CONTEXT_ENTRY,
DMN_DECISION,
DMN_DECISION_SERVICE,
Expand Down

0 comments on commit d9aa6f9

Please sign in to comment.