Search in sources :

Example 21 with KogitoNodeInstance

use of org.kie.kogito.internal.process.runtime.KogitoNodeInstance in project kogito-runtimes by kiegroup.

the class KogitoProcessEventSupportImpl method fireBeforeNodeTriggered.

@Override
public void fireBeforeNodeTriggered(final KogitoNodeInstance nodeInstance, KieRuntime kruntime) {
    final ProcessNodeTriggeredEvent event = new KogitoProcessNodeTriggeredEventImpl(nodeInstance, kruntime);
    unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
        if (hasListeners()) {
            notifyAllListeners(event, (l, e1) -> l.beforeNodeTriggered(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) ProcessNodeTriggeredEvent(org.kie.api.event.process.ProcessNodeTriggeredEvent)

Example 22 with KogitoNodeInstance

use of org.kie.kogito.internal.process.runtime.KogitoNodeInstance 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 23 with KogitoNodeInstance

use of org.kie.kogito.internal.process.runtime.KogitoNodeInstance in project kogito-runtimes by kiegroup.

the class KogitoProcessEventSupportImpl method fireAfterVariableChanged.

@Override
public void fireAfterVariableChanged(final String name, final String id, final Object oldValue, final Object newValue, final List<String> tags, final KogitoProcessInstance processInstance, KogitoNodeInstance nodeInstance, KieRuntime kruntime) {
    final ProcessVariableChangedEvent event = new KogitoProcessVariableChangedEventImpl(name, id, oldValue, newValue, tags, processInstance, nodeInstance, kruntime);
    unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
        if (hasListeners()) {
            notifyAllListeners(event, (l, e1) -> l.afterVariableChanged(e1));
        }
    }));
}
Also used : ProcessVariableChangedEvent(org.kie.api.event.process.ProcessVariableChangedEvent) 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)

Example 24 with KogitoNodeInstance

use of org.kie.kogito.internal.process.runtime.KogitoNodeInstance 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 25 with KogitoNodeInstance

use of org.kie.kogito.internal.process.runtime.KogitoNodeInstance in project kogito-runtimes by kiegroup.

the class KogitoProcessEventSupportImpl method fireBeforeVariableChanged.

@Override
public void fireBeforeVariableChanged(final String id, final String instanceId, final Object oldValue, final Object newValue, final List<String> tags, final KogitoProcessInstance processInstance, KogitoNodeInstance nodeInstance, KieRuntime kruntime) {
    final ProcessVariableChangedEvent event = new KogitoProcessVariableChangedEventImpl(id, instanceId, oldValue, newValue, tags, processInstance, nodeInstance, kruntime);
    unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
        if (hasListeners()) {
            notifyAllListeners(event, (l, e1) -> l.beforeVariableChanged(e1));
        }
    }));
}
Also used : ProcessVariableChangedEvent(org.kie.api.event.process.ProcessVariableChangedEvent) 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)

Aggregations

KogitoNodeInstance (org.kie.kogito.internal.process.runtime.KogitoNodeInstance)33 KogitoWorkItem (org.kie.kogito.internal.process.runtime.KogitoWorkItem)15 KogitoProcessInstance (org.kie.kogito.internal.process.runtime.KogitoProcessInstance)14 Map (java.util.Map)12 SLAViolatedEvent (org.kie.api.event.process.SLAViolatedEvent)12 KogitoProcessEventListener (org.kie.kogito.internal.process.event.KogitoProcessEventListener)12 List (java.util.List)11 HumanTaskWorkItem (org.kie.kogito.process.workitem.HumanTaskWorkItem)9 WorkUnit (org.kie.kogito.uow.WorkUnit)9 AbstractEventSupport (org.drools.core.event.AbstractEventSupport)8 MessageEventImpl (org.drools.core.event.MessageEventImpl)8 ProcessCompletedEventImpl (org.drools.core.event.ProcessCompletedEventImpl)8 ProcessStartedEventImpl (org.drools.core.event.ProcessStartedEventImpl)8 SLAViolatedEventImpl (org.drools.core.event.SLAViolatedEventImpl)8 SignalEventImpl (org.drools.core.event.SignalEventImpl)8 Date (java.util.Date)7 ExclusiveGroupInstance (org.jbpm.process.instance.context.exclusive.ExclusiveGroupInstance)6 ArrayList (java.util.ArrayList)5 HashMap (java.util.HashMap)5 MessageEvent (org.kie.api.event.process.MessageEvent)5