Search in sources :

Example 1 with ProcessCompletedEventImpl

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

the class KogitoProcessEventSupportImpl method fireAfterProcessCompleted.

@Override
public void fireAfterProcessCompleted(final KogitoProcessInstance instance, KieRuntime kruntime) {
    final ProcessCompletedEvent event = new ProcessCompletedEventImpl(instance, kruntime);
    unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
        if (hasListeners()) {
            notifyAllListeners(event, (l, e1) -> l.afterProcessCompleted(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) ProcessCompletedEvent(org.kie.api.event.process.ProcessCompletedEvent) ProcessCompletedEventImpl(org.drools.core.event.ProcessCompletedEventImpl)

Example 2 with ProcessCompletedEventImpl

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

the class KogitoProcessEventSupportImpl method fireBeforeProcessCompleted.

@Override
public void fireBeforeProcessCompleted(final KogitoProcessInstance instance, KieRuntime kruntime) {
    final ProcessCompletedEvent event = new ProcessCompletedEventImpl(instance, kruntime);
    unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
        if (hasListeners()) {
            notifyAllListeners(event, (l, e1) -> l.beforeProcessCompleted(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) ProcessCompletedEvent(org.kie.api.event.process.ProcessCompletedEvent) ProcessCompletedEventImpl(org.drools.core.event.ProcessCompletedEventImpl)

Aggregations

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