Search in sources :

Example 1 with WorkflowTask

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;
}
Also used : Workflow(org.alien4cloud.tosca.model.workflow.Workflow) WorkflowTask(alien4cloud.topology.task.WorkflowTask)

Aggregations

WorkflowTask (alien4cloud.topology.task.WorkflowTask)1 Workflow (org.alien4cloud.tosca.model.workflow.Workflow)1