use of io.automatiko.engine.workflow.process.core.node.Trigger in project automatiko-engine by automatiko-io.
the class ProcessRuntimeImpl method initProcessEventListener.
private void initProcessEventListener(Process process) {
if (process instanceof ExecutableProcess) {
for (Node node : ((ExecutableProcess) process).getNodes()) {
if (node instanceof StartNode) {
StartNode startNode = (StartNode) node;
if (startNode != null) {
List<Trigger> triggers = startNode.getTriggers();
if (triggers != null) {
for (Trigger trigger : triggers) {
if (trigger instanceof EventTrigger) {
final List<EventFilter> filters = ((EventTrigger) trigger).getEventFilters();
String type = null;
for (EventFilter filter : filters) {
if (filter instanceof EventTypeFilter) {
type = ((EventTypeFilter) filter).getType();
}
}
StartProcessEventListener listener = new StartProcessEventListener(process.getId(), filters, trigger.getInMappings(), startNode.getEventTransformer());
signalManager.addEventListener(type, listener);
((ExecutableProcess) process).getRuntimeMetaData().put("StartProcessEventType", type);
((ExecutableProcess) process).getRuntimeMetaData().put("StartProcessEventListener", listener);
}
}
}
}
}
}
}
}
Aggregations