use of org.apache.inlong.manager.workflow.processor.SkipableElementProcessor in project incubator-inlong by apache.
the class ProcessorExecutorImpl method executeSkipAndNext.
private void executeSkipAndNext(Element element, WorkflowContext context) {
if (!(element instanceof SkippableElement)) {
throw new WorkflowException("element not instance of skip element " + element.getDisplayName());
}
if (!(element instanceof NextableElement)) {
throw new WorkflowException("element not instance of nextable element " + element.getDisplayName());
}
ElementProcessor processor = this.getProcessor(element.getClass());
if (!(processor instanceof SkipableElementProcessor)) {
throw new WorkflowException("element processor not instance of skip processor " + element.getDisplayName());
}
// Execute skip logic
SkipableElementProcessor skipableProcessor = (SkipableElementProcessor) processor;
skipableProcessor.skip(element, context);
// Execute next
context.getActionContext().setAction(((NextableElement) element).defaultNextAction());
List<Element> nextElements = processor.next(element, context);
nextElements.forEach(next -> executeStart(next, context));
}
Aggregations