Search in sources :

Example 1 with DecisionTableRulesSelectedEvent

use of org.kie.dmn.feel.runtime.events.DecisionTableRulesSelectedEvent in project drools by kiegroup.

the class DMNDTExpressionEvaluator method processEvents.

private EventResults processEvents(List<FEELEvent> events, DMNRuntimeEventManager eventManager, DMNResultImpl result) {
    EventResults r = new EventResults();
    for (FEELEvent e : events) {
        if (e instanceof DecisionTableRulesMatchedEvent) {
            r.matchedRules = ((DecisionTableRulesMatchedEvent) e).getMatches();
        } else if (e instanceof DecisionTableRulesSelectedEvent) {
            r.fired = ((DecisionTableRulesSelectedEvent) e).getFired();
        } else if (e.getSeverity() == FEELEvent.Severity.ERROR) {
            MsgUtil.reportMessage(logger, DMNMessage.Severity.ERROR, ((DMNBaseNode) node).getSource(), result, null, e, Msg.FEEL_ERROR, e.getMessage());
            r.hasErrors = true;
        } else if (e.getSeverity() == FEELEvent.Severity.WARN) {
            MsgUtil.reportMessage(logger, DMNMessage.Severity.WARN, ((DMNBaseNode) node).getSource(), result, null, e, Msg.FEEL_WARN, e.getMessage());
        }
    }
    events.clear();
    return r;
}
Also used : DecisionTableRulesSelectedEvent(org.kie.dmn.feel.runtime.events.DecisionTableRulesSelectedEvent) DecisionTableRulesMatchedEvent(org.kie.dmn.feel.runtime.events.DecisionTableRulesMatchedEvent) FEELEvent(org.kie.dmn.api.feel.runtime.events.FEELEvent)

Aggregations

FEELEvent (org.kie.dmn.api.feel.runtime.events.FEELEvent)1 DecisionTableRulesMatchedEvent (org.kie.dmn.feel.runtime.events.DecisionTableRulesMatchedEvent)1 DecisionTableRulesSelectedEvent (org.kie.dmn.feel.runtime.events.DecisionTableRulesSelectedEvent)1