use of alien4cloud.topology.task.WorkflowTask in project alien4cloud by alien4cloud.
the class WorkflowsBuilderService method validateWorkflows.
public List<WorkflowTask> validateWorkflows(Topology topology) {
List<WorkflowTask> tasks = Lists.newArrayList();
if (topology.getWorkflows() != null) {
TopologyContext topologyContext = buildTopologyContext(topology);
for (Workflow workflow : topology.getWorkflows().values()) {
int errorCount = validateWorkflow(topologyContext, workflow);
if (errorCount > 0) {
WorkflowTask workflowTask = new WorkflowTask();
workflowTask.setCode(TaskCode.WORKFLOW_INVALID);
workflowTask.setWorkflowName(workflow.getName());
workflowTask.setErrorCount(errorCount);
tasks.add(workflowTask);
}
}
}
return tasks;
}
Aggregations