use of org.alien4cloud.tosca.model.workflow.Workflow in project alien4cloud by alien4cloud.
the class WorkflowsBuilderService method connectStepFrom.
public Workflow connectStepFrom(Topology topology, Csar csar, String workflowName, String stepId, String[] stepNames) {
TopologyContext topologyContext = buildTopologyContext(topology, csar);
Workflow wf = topology.getWorkflows().get(workflowName);
if (wf == null) {
throw new NotFoundException(String.format("The workflow '%s' can not be found", workflowName));
}
AbstractWorkflowBuilder builder = getWorkflowBuilder(topologyContext.getDSLVersion(), wf);
builder.connectStepFrom(wf, stepId, stepNames);
workflowValidator.validate(topologyContext, wf);
return wf;
}
use of org.alien4cloud.tosca.model.workflow.Workflow in project alien4cloud by alien4cloud.
the class WorkflowsBuilderService method renameNode.
public void renameNode(Topology topology, Csar csar, String nodeTemplateName, String newNodeTemplateName) {
if (topology.getWorkflows() == null) {
return;
}
TopologyContext topologyContext = buildTopologyContext(topology, csar);
for (Workflow wf : topology.getWorkflows().values()) {
AbstractWorkflowBuilder builder = getWorkflowBuilder(topologyContext.getDSLVersion(), wf);
builder.renameNode(wf, nodeTemplateName, newNodeTemplateName);
if (topology.getUnprocessedWorkflows().containsKey(wf.getName())) {
builder.renameNode(topology.getUnprocessedWorkflows().get(wf.getName()), nodeTemplateName, newNodeTemplateName);
}
WorkflowUtils.fillHostId(wf, topologyContext);
workflowValidator.validate(topologyContext, wf);
}
}
use of org.alien4cloud.tosca.model.workflow.Workflow in project alien4cloud by alien4cloud.
the class WorkflowsBuilderService method addNode.
public void addNode(TopologyContext topologyContext, String nodeName) {
boolean forceOperation = WorkflowUtils.isComputeOrNetwork(nodeName, topologyContext);
// Use the unprocessed workflow to perform add node as we know that every steps / links will be present as it's defined in declarative workflow
topologyContext.getTopology().getWorkflows().putAll(topologyContext.getTopology().getUnprocessedWorkflows());
for (Workflow wf : topologyContext.getTopology().getWorkflows().values()) {
AbstractWorkflowBuilder builder = getWorkflowBuilder(topologyContext.getDSLVersion(), wf);
builder.addNode(wf, nodeName, topologyContext, forceOperation);
WorkflowUtils.fillHostId(wf, topologyContext);
}
postProcessTopologyWorkflows(topologyContext);
}
use of org.alien4cloud.tosca.model.workflow.Workflow in project alien4cloud by alien4cloud.
the class WorkflowsBuilderService method removeNode.
public void removeNode(Topology topology, Csar csar, String nodeName) {
TopologyContext topologyContext = buildTopologyContext(topology, csar);
topologyContext.getTopology().getWorkflows().putAll(topologyContext.getTopology().getUnprocessedWorkflows());
for (Workflow wf : topology.getWorkflows().values()) {
AbstractWorkflowBuilder builder = getWorkflowBuilder(topologyContext.getDSLVersion(), wf);
builder.removeNode(wf, nodeName);
WorkflowUtils.fillHostId(wf, topologyContext);
}
postProcessTopologyWorkflows(topologyContext);
debugWorkflow(topology);
}
use of org.alien4cloud.tosca.model.workflow.Workflow in project alien4cloud by alien4cloud.
the class WorkflowsBuilderService method initStandardWorkflow.
private void initStandardWorkflow(String name, TopologyContext topologyContext) {
Workflow workflow = new Workflow();
workflow.setName(name);
workflow.setStandard(true);
workflow.setHasCustomModifications(false);
topologyContext.getTopology().getWorkflows().put(name, workflow);
reinitWorkflow(name, topologyContext, false);
}
Aggregations