use of org.alien4cloud.tosca.editor.operations.workflow.RemoveWorkflowOperation in project alien4cloud by alien4cloud.
the class RemoveWorkflowProcessor method processWorkflowOperation.
@Override
protected void processWorkflowOperation(Csar csar, Topology topology, RemoveWorkflowOperation operation, Workflow workflow) {
ensureNotStandard(workflow, "standard workflow <" + workflow.getName() + "> can not be removed");
log.debug("removing workflow [ {} ] from topology [ {} ]", operation.getWorkflowName(), topology.getId());
topology.getWorkflows().remove(operation.getWorkflowName());
topology.getWorkflows().values().forEach(wf -> wf.getSteps().values().forEach(step -> {
if (step.getActivity() instanceof InlineWorkflowActivity) {
InlineWorkflowActivity inlineWorkflowActivity = (InlineWorkflowActivity) step.getActivity();
if (inlineWorkflowActivity.getInline().equals(workflow.getName())) {
throw new BadWorkflowOperationException("Workflow " + inlineWorkflowActivity.getInline() + " is inlined in workflow " + wf.getName() + " in step " + step.getName());
}
}
}));
}
Aggregations