use of org.onosproject.workflow.api.WorkflowData in project onos by opennetworkinglab.
the class WorkFlowEngine method post.
@Override
protected void post(WorkflowDataEvent event) {
if (event.subject() == null || !isRelevant(event.subject())) {
log.debug("ignore event {}", event);
return;
}
// trigger next worklet selection
WorkflowData dataModelContainer = event.subject();
switch(event.type()) {
case INSERT:
case UPDATE:
if (dataModelContainer.triggerNext()) {
log.debug("workflowAccumulator.add: {}", dataModelContainer);
workflowAccumulator.add(dataModelContainer);
} else {
log.debug("pass-workflowAccumulator.add: {}", dataModelContainer);
}
break;
case REMOVE:
break;
default:
}
// trigger EventTask for WorkflowDataEvent
eventMapTriggerExecutor.submit(() -> eventMapTrigger(event, // event hint supplier
(ev) -> {
if (ev == null || ev.subject() == null) {
return null;
}
if (ev.subject() instanceof WorkflowData) {
return ((WorkflowData) ev.subject()).name();
} else {
return null;
}
}));
}
Aggregations