Search in sources :

Example 1 with SLAViolatedEventImpl

use of org.drools.core.event.SLAViolatedEventImpl in project kogito-runtimes by kiegroup.

the class KogitoProcessEventSupportImpl method fireBeforeSLAViolated.

@Override
public void fireBeforeSLAViolated(final KogitoProcessInstance instance, KieRuntime kruntime) {
    final SLAViolatedEvent event = new SLAViolatedEventImpl(instance, kruntime);
    unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
        if (hasListeners()) {
            notifyAllListeners(event, (l, e1) -> l.beforeSLAViolated(e1));
        }
    }));
}
Also used : ProcessStartedEventImpl(org.drools.core.event.ProcessStartedEventImpl) ProcessCompletedEvent(org.kie.api.event.process.ProcessCompletedEvent) KogitoWorkItem(org.kie.kogito.internal.process.runtime.KogitoWorkItem) WorkUnit(org.kie.kogito.uow.WorkUnit) KogitoProcessInstance(org.kie.kogito.internal.process.runtime.KogitoProcessInstance) AbstractEventSupport(org.drools.core.event.AbstractEventSupport) ProcessEventListener(org.kie.api.event.process.ProcessEventListener) DeadlineType(org.kie.kogito.internal.process.event.HumanTaskDeadlineEvent.DeadlineType) KogitoProcessEventListener(org.kie.kogito.internal.process.event.KogitoProcessEventListener) ProcessNodeLeftEvent(org.kie.api.event.process.ProcessNodeLeftEvent) Map(java.util.Map) UnitOfWorkManager(org.kie.kogito.uow.UnitOfWorkManager) SLAViolatedEventImpl(org.drools.core.event.SLAViolatedEventImpl) SignalEvent(org.kie.api.event.process.SignalEvent) ProcessVariableChangedEvent(org.kie.api.event.process.ProcessVariableChangedEvent) SignalEventImpl(org.drools.core.event.SignalEventImpl) ProcessCompletedEventImpl(org.drools.core.event.ProcessCompletedEventImpl) MessageEvent(org.kie.api.event.process.MessageEvent) KogitoNodeInstance(org.kie.kogito.internal.process.runtime.KogitoNodeInstance) MessageEventImpl(org.drools.core.event.MessageEventImpl) List(java.util.List) ProcessNodeTriggeredEvent(org.kie.api.event.process.ProcessNodeTriggeredEvent) Transition(org.kie.kogito.process.workitem.Transition) KieRuntime(org.kie.api.runtime.KieRuntime) KogitoProcessEventSupport(org.kie.kogito.internal.process.event.KogitoProcessEventSupport) HumanTaskDeadlineEvent(org.kie.kogito.internal.process.event.HumanTaskDeadlineEvent) SLAViolatedEvent(org.kie.api.event.process.SLAViolatedEvent) HumanTaskWorkItem(org.kie.kogito.process.workitem.HumanTaskWorkItem) ProcessStartedEvent(org.kie.api.event.process.ProcessStartedEvent) ProcessWorkItemTransitionEvent(org.kie.kogito.internal.process.event.ProcessWorkItemTransitionEvent) SLAViolatedEvent(org.kie.api.event.process.SLAViolatedEvent) SLAViolatedEventImpl(org.drools.core.event.SLAViolatedEventImpl)

Example 2 with SLAViolatedEventImpl

use of org.drools.core.event.SLAViolatedEventImpl in project kogito-runtimes by kiegroup.

the class KogitoProcessEventSupportImpl method fireBeforeSLAViolated.

@Override
public void fireBeforeSLAViolated(final KogitoProcessInstance instance, KogitoNodeInstance nodeInstance, KieRuntime kruntime) {
    final SLAViolatedEvent event = new SLAViolatedEventImpl(instance, nodeInstance, kruntime);
    unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
        if (hasListeners()) {
            notifyAllListeners(event, (l, e1) -> l.beforeSLAViolated(e1));
        }
    }));
}
Also used : ProcessStartedEventImpl(org.drools.core.event.ProcessStartedEventImpl) ProcessCompletedEvent(org.kie.api.event.process.ProcessCompletedEvent) KogitoWorkItem(org.kie.kogito.internal.process.runtime.KogitoWorkItem) WorkUnit(org.kie.kogito.uow.WorkUnit) KogitoProcessInstance(org.kie.kogito.internal.process.runtime.KogitoProcessInstance) AbstractEventSupport(org.drools.core.event.AbstractEventSupport) ProcessEventListener(org.kie.api.event.process.ProcessEventListener) DeadlineType(org.kie.kogito.internal.process.event.HumanTaskDeadlineEvent.DeadlineType) KogitoProcessEventListener(org.kie.kogito.internal.process.event.KogitoProcessEventListener) ProcessNodeLeftEvent(org.kie.api.event.process.ProcessNodeLeftEvent) Map(java.util.Map) UnitOfWorkManager(org.kie.kogito.uow.UnitOfWorkManager) SLAViolatedEventImpl(org.drools.core.event.SLAViolatedEventImpl) SignalEvent(org.kie.api.event.process.SignalEvent) ProcessVariableChangedEvent(org.kie.api.event.process.ProcessVariableChangedEvent) SignalEventImpl(org.drools.core.event.SignalEventImpl) ProcessCompletedEventImpl(org.drools.core.event.ProcessCompletedEventImpl) MessageEvent(org.kie.api.event.process.MessageEvent) KogitoNodeInstance(org.kie.kogito.internal.process.runtime.KogitoNodeInstance) MessageEventImpl(org.drools.core.event.MessageEventImpl) List(java.util.List) ProcessNodeTriggeredEvent(org.kie.api.event.process.ProcessNodeTriggeredEvent) Transition(org.kie.kogito.process.workitem.Transition) KieRuntime(org.kie.api.runtime.KieRuntime) KogitoProcessEventSupport(org.kie.kogito.internal.process.event.KogitoProcessEventSupport) HumanTaskDeadlineEvent(org.kie.kogito.internal.process.event.HumanTaskDeadlineEvent) SLAViolatedEvent(org.kie.api.event.process.SLAViolatedEvent) HumanTaskWorkItem(org.kie.kogito.process.workitem.HumanTaskWorkItem) ProcessStartedEvent(org.kie.api.event.process.ProcessStartedEvent) ProcessWorkItemTransitionEvent(org.kie.kogito.internal.process.event.ProcessWorkItemTransitionEvent) SLAViolatedEvent(org.kie.api.event.process.SLAViolatedEvent) SLAViolatedEventImpl(org.drools.core.event.SLAViolatedEventImpl)

Example 3 with SLAViolatedEventImpl

use of org.drools.core.event.SLAViolatedEventImpl in project kogito-runtimes by kiegroup.

the class KogitoProcessEventSupportImpl method fireAfterSLAViolated.

@Override
public void fireAfterSLAViolated(final KogitoProcessInstance instance, KogitoNodeInstance nodeInstance, KieRuntime kruntime) {
    final SLAViolatedEvent event = new SLAViolatedEventImpl(instance, nodeInstance, kruntime);
    unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
        if (hasListeners()) {
            notifyAllListeners(event, (l, e1) -> l.afterSLAViolated(e1));
        }
    }));
}
Also used : ProcessStartedEventImpl(org.drools.core.event.ProcessStartedEventImpl) ProcessCompletedEvent(org.kie.api.event.process.ProcessCompletedEvent) KogitoWorkItem(org.kie.kogito.internal.process.runtime.KogitoWorkItem) WorkUnit(org.kie.kogito.uow.WorkUnit) KogitoProcessInstance(org.kie.kogito.internal.process.runtime.KogitoProcessInstance) AbstractEventSupport(org.drools.core.event.AbstractEventSupport) ProcessEventListener(org.kie.api.event.process.ProcessEventListener) DeadlineType(org.kie.kogito.internal.process.event.HumanTaskDeadlineEvent.DeadlineType) KogitoProcessEventListener(org.kie.kogito.internal.process.event.KogitoProcessEventListener) ProcessNodeLeftEvent(org.kie.api.event.process.ProcessNodeLeftEvent) Map(java.util.Map) UnitOfWorkManager(org.kie.kogito.uow.UnitOfWorkManager) SLAViolatedEventImpl(org.drools.core.event.SLAViolatedEventImpl) SignalEvent(org.kie.api.event.process.SignalEvent) ProcessVariableChangedEvent(org.kie.api.event.process.ProcessVariableChangedEvent) SignalEventImpl(org.drools.core.event.SignalEventImpl) ProcessCompletedEventImpl(org.drools.core.event.ProcessCompletedEventImpl) MessageEvent(org.kie.api.event.process.MessageEvent) KogitoNodeInstance(org.kie.kogito.internal.process.runtime.KogitoNodeInstance) MessageEventImpl(org.drools.core.event.MessageEventImpl) List(java.util.List) ProcessNodeTriggeredEvent(org.kie.api.event.process.ProcessNodeTriggeredEvent) Transition(org.kie.kogito.process.workitem.Transition) KieRuntime(org.kie.api.runtime.KieRuntime) KogitoProcessEventSupport(org.kie.kogito.internal.process.event.KogitoProcessEventSupport) HumanTaskDeadlineEvent(org.kie.kogito.internal.process.event.HumanTaskDeadlineEvent) SLAViolatedEvent(org.kie.api.event.process.SLAViolatedEvent) HumanTaskWorkItem(org.kie.kogito.process.workitem.HumanTaskWorkItem) ProcessStartedEvent(org.kie.api.event.process.ProcessStartedEvent) ProcessWorkItemTransitionEvent(org.kie.kogito.internal.process.event.ProcessWorkItemTransitionEvent) SLAViolatedEvent(org.kie.api.event.process.SLAViolatedEvent) SLAViolatedEventImpl(org.drools.core.event.SLAViolatedEventImpl)

Example 4 with SLAViolatedEventImpl

use of org.drools.core.event.SLAViolatedEventImpl in project kogito-runtimes by kiegroup.

the class KogitoProcessEventSupportImpl method fireAfterSLAViolated.

@Override
public void fireAfterSLAViolated(final KogitoProcessInstance instance, KieRuntime kruntime) {
    final SLAViolatedEvent event = new SLAViolatedEventImpl(instance, kruntime);
    unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
        if (hasListeners()) {
            notifyAllListeners(event, (l, e1) -> l.afterSLAViolated(e1));
        }
    }));
}
Also used : ProcessStartedEventImpl(org.drools.core.event.ProcessStartedEventImpl) ProcessCompletedEvent(org.kie.api.event.process.ProcessCompletedEvent) KogitoWorkItem(org.kie.kogito.internal.process.runtime.KogitoWorkItem) WorkUnit(org.kie.kogito.uow.WorkUnit) KogitoProcessInstance(org.kie.kogito.internal.process.runtime.KogitoProcessInstance) AbstractEventSupport(org.drools.core.event.AbstractEventSupport) ProcessEventListener(org.kie.api.event.process.ProcessEventListener) DeadlineType(org.kie.kogito.internal.process.event.HumanTaskDeadlineEvent.DeadlineType) KogitoProcessEventListener(org.kie.kogito.internal.process.event.KogitoProcessEventListener) ProcessNodeLeftEvent(org.kie.api.event.process.ProcessNodeLeftEvent) Map(java.util.Map) UnitOfWorkManager(org.kie.kogito.uow.UnitOfWorkManager) SLAViolatedEventImpl(org.drools.core.event.SLAViolatedEventImpl) SignalEvent(org.kie.api.event.process.SignalEvent) ProcessVariableChangedEvent(org.kie.api.event.process.ProcessVariableChangedEvent) SignalEventImpl(org.drools.core.event.SignalEventImpl) ProcessCompletedEventImpl(org.drools.core.event.ProcessCompletedEventImpl) MessageEvent(org.kie.api.event.process.MessageEvent) KogitoNodeInstance(org.kie.kogito.internal.process.runtime.KogitoNodeInstance) MessageEventImpl(org.drools.core.event.MessageEventImpl) List(java.util.List) ProcessNodeTriggeredEvent(org.kie.api.event.process.ProcessNodeTriggeredEvent) Transition(org.kie.kogito.process.workitem.Transition) KieRuntime(org.kie.api.runtime.KieRuntime) KogitoProcessEventSupport(org.kie.kogito.internal.process.event.KogitoProcessEventSupport) HumanTaskDeadlineEvent(org.kie.kogito.internal.process.event.HumanTaskDeadlineEvent) SLAViolatedEvent(org.kie.api.event.process.SLAViolatedEvent) HumanTaskWorkItem(org.kie.kogito.process.workitem.HumanTaskWorkItem) ProcessStartedEvent(org.kie.api.event.process.ProcessStartedEvent) ProcessWorkItemTransitionEvent(org.kie.kogito.internal.process.event.ProcessWorkItemTransitionEvent) SLAViolatedEvent(org.kie.api.event.process.SLAViolatedEvent) SLAViolatedEventImpl(org.drools.core.event.SLAViolatedEventImpl)

Aggregations

List (java.util.List)4 Map (java.util.Map)4 AbstractEventSupport (org.drools.core.event.AbstractEventSupport)4 MessageEventImpl (org.drools.core.event.MessageEventImpl)4 ProcessCompletedEventImpl (org.drools.core.event.ProcessCompletedEventImpl)4 ProcessStartedEventImpl (org.drools.core.event.ProcessStartedEventImpl)4 SLAViolatedEventImpl (org.drools.core.event.SLAViolatedEventImpl)4 SignalEventImpl (org.drools.core.event.SignalEventImpl)4 MessageEvent (org.kie.api.event.process.MessageEvent)4 ProcessCompletedEvent (org.kie.api.event.process.ProcessCompletedEvent)4 ProcessEventListener (org.kie.api.event.process.ProcessEventListener)4 ProcessNodeLeftEvent (org.kie.api.event.process.ProcessNodeLeftEvent)4 ProcessNodeTriggeredEvent (org.kie.api.event.process.ProcessNodeTriggeredEvent)4 ProcessStartedEvent (org.kie.api.event.process.ProcessStartedEvent)4 ProcessVariableChangedEvent (org.kie.api.event.process.ProcessVariableChangedEvent)4 SLAViolatedEvent (org.kie.api.event.process.SLAViolatedEvent)4 SignalEvent (org.kie.api.event.process.SignalEvent)4 KieRuntime (org.kie.api.runtime.KieRuntime)4 HumanTaskDeadlineEvent (org.kie.kogito.internal.process.event.HumanTaskDeadlineEvent)4 DeadlineType (org.kie.kogito.internal.process.event.HumanTaskDeadlineEvent.DeadlineType)4