use of org.kie.kogito.process.workitem.Transition in project kogito-runtimes by kiegroup.
the class KogitoProcessEventSupportImpl method fireBeforeWorkItemTransition.
@Override
public void fireBeforeWorkItemTransition(final KogitoProcessInstance instance, KogitoWorkItem workitem, Transition<?> transition, KieRuntime kruntime) {
final ProcessWorkItemTransitionEvent event = new KogitoProcessWorkItemTransitionEventImpl(instance, workitem, transition, kruntime, false);
unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
if (hasListeners()) {
notifyAllListeners(event, (l, e1) -> l.beforeWorkItemTransition(e1));
}
}));
}
use of org.kie.kogito.process.workitem.Transition in project kogito-runtimes by kiegroup.
the class KogitoProcessEventSupportImpl method fireAfterWorkItemTransition.
@Override
public void fireAfterWorkItemTransition(final KogitoProcessInstance instance, KogitoWorkItem workitem, Transition<?> transition, KieRuntime kruntime) {
final ProcessWorkItemTransitionEvent event = new KogitoProcessWorkItemTransitionEventImpl(instance, workitem, transition, kruntime, true);
unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
if (hasListeners()) {
notifyAllListeners(event, (l, e1) -> l.afterWorkItemTransition(e1));
}
}));
}
Aggregations