use of io.automatiko.engine.api.event.process.SLAViolatedEvent in project automatiko-engine by automatiko-io.
the class ProcessEventSupport method fireAfterSLAViolated.
public void fireAfterSLAViolated(final ProcessInstance instance, ProcessRuntime runtime) {
final Iterator<ProcessEventListener> iter = getEventListenersIterator();
final List<ProcessEventListener> delayedListeners = new ArrayList<ProcessEventListener>();
final SLAViolatedEvent event = new SLAViolatedEventImpl(instance, runtime);
if (iter.hasNext()) {
do {
ProcessEventListener listener = iter.next();
if (listener instanceof DelayedExecution) {
delayedListeners.add(listener);
} else {
listener.afterSLAViolated(event);
}
} while (iter.hasNext());
}
unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
delayedListeners.forEach(l -> l.afterSLAViolated(e));
}));
}
use of io.automatiko.engine.api.event.process.SLAViolatedEvent in project automatiko-engine by automatiko-io.
the class ProcessEventSupport method fireAfterSLAViolated.
public void fireAfterSLAViolated(final ProcessInstance instance, NodeInstance nodeInstance, ProcessRuntime runtime) {
final Iterator<ProcessEventListener> iter = getEventListenersIterator();
final List<ProcessEventListener> delayedListeners = new ArrayList<ProcessEventListener>();
final SLAViolatedEvent event = new SLAViolatedEventImpl(instance, nodeInstance, runtime);
if (iter.hasNext()) {
do {
ProcessEventListener listener = iter.next();
if (listener instanceof DelayedExecution) {
delayedListeners.add(listener);
} else {
listener.afterSLAViolated(event);
}
} while (iter.hasNext());
}
unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
delayedListeners.forEach(l -> l.afterSLAViolated(e));
}));
}
use of io.automatiko.engine.api.event.process.SLAViolatedEvent in project automatiko-engine by automatiko-io.
the class ProcessEventSupport method fireBeforeSLAViolated.
public void fireBeforeSLAViolated(final ProcessInstance instance, ProcessRuntime runtime) {
final Iterator<ProcessEventListener> iter = getEventListenersIterator();
final List<ProcessEventListener> delayedListeners = new ArrayList<ProcessEventListener>();
final SLAViolatedEvent event = new SLAViolatedEventImpl(instance, runtime);
if (iter.hasNext()) {
do {
ProcessEventListener listener = iter.next();
if (listener instanceof DelayedExecution) {
delayedListeners.add(listener);
} else {
listener.beforeSLAViolated(event);
}
} while (iter.hasNext());
}
unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
delayedListeners.forEach(l -> l.beforeSLAViolated(e));
}));
}
use of io.automatiko.engine.api.event.process.SLAViolatedEvent in project automatiko-engine by automatiko-io.
the class ProcessEventSupport method fireBeforeSLAViolated.
public void fireBeforeSLAViolated(final ProcessInstance instance, NodeInstance nodeInstance, ProcessRuntime runtime) {
final Iterator<ProcessEventListener> iter = getEventListenersIterator();
final List<ProcessEventListener> delayedListeners = new ArrayList<ProcessEventListener>();
final SLAViolatedEvent event = new SLAViolatedEventImpl(instance, nodeInstance, runtime);
if (iter.hasNext()) {
do {
ProcessEventListener listener = iter.next();
if (listener instanceof DelayedExecution) {
delayedListeners.add(listener);
} else {
listener.beforeSLAViolated(event);
}
} while (iter.hasNext());
}
unitOfWorkManager.currentUnitOfWork().intercept(WorkUnit.create(event, e -> {
delayedListeners.forEach(l -> l.beforeSLAViolated(e));
}));
}
Aggregations