use of org.alien4cloud.tosca.model.workflow.WorkflowStep in project alien4cloud by alien4cloud.
the class CycleDetectionTest method testNoCycle.
/**
* <pre>
*
* a -- b
*
* </pre>
*/
@Test
public void testNoCycle() {
WorkflowStep a = wf.addStep(new SimpleStep("a"));
WorkflowStep b = wf.addStep(new SimpleStep("b"));
WorkflowUtils.linkSteps(a, b);
processValidation(false, 0);
}
use of org.alien4cloud.tosca.model.workflow.WorkflowStep in project alien4cloud by alien4cloud.
the class GraphPathsTest method test1.
/**
* a -- b
*/
@Test
public void test1() {
Workflow wf = new Workflow();
wf.setName(INSTALL);
WorkflowStep a = wf.addStep(new SimpleStep("a"));
WorkflowStep b = wf.addStep(new SimpleStep("b"));
WorkflowUtils.linkSteps(a, b);
List<Path> paths = WorkflowGraphUtils.getWorkflowGraphCycles(wf);
log.info(paths.toString());
}
use of org.alien4cloud.tosca.model.workflow.WorkflowStep in project alien4cloud by alien4cloud.
the class GraphPathsTest method test2.
/**
* -- a --
* -- b --
*/
@Test
public void test2() {
Workflow wf = new Workflow();
wf.setName(INSTALL);
WorkflowStep a = wf.addStep(new SimpleStep("a"));
WorkflowStep b = wf.addStep(new SimpleStep("b"));
List<Path> paths = WorkflowGraphUtils.getWorkflowGraphCycles(wf);
log.info(paths.toString());
}
use of org.alien4cloud.tosca.model.workflow.WorkflowStep in project alien4cloud by alien4cloud.
the class GraphPathsTest method testComplexe.
/**
* <pre>
* -- b -- -- e
* / \ /
* a d
* \ / \
* -- c -- -- f
* </pre>
*/
@Test
public void testComplexe() {
Workflow wf = new Workflow();
wf.setName(INSTALL);
WorkflowStep a = wf.addStep(new SimpleStep("a"));
WorkflowStep b = wf.addStep(new SimpleStep("b"));
WorkflowStep c = wf.addStep(new SimpleStep("c"));
WorkflowStep d = wf.addStep(new SimpleStep("d"));
WorkflowStep e = wf.addStep(new SimpleStep("e"));
WorkflowStep f = wf.addStep(new SimpleStep("f"));
WorkflowUtils.linkSteps(a, b);
WorkflowUtils.linkSteps(a, c);
WorkflowUtils.linkSteps(b, d);
WorkflowUtils.linkSteps(c, d);
WorkflowUtils.linkSteps(d, e);
WorkflowUtils.linkSteps(d, f);
List<Path> paths = WorkflowGraphUtils.getWorkflowGraphCycles(wf);
log.info(paths.toString());
}
use of org.alien4cloud.tosca.model.workflow.WorkflowStep in project alien4cloud by alien4cloud.
the class AbstractWorkflowBuilder method removeFollowers.
private List<WorkflowStep> removeFollowers(Workflow wf, WorkflowStep step) {
List<WorkflowStep> result = Lists.newArrayList();
if (step.getOnSuccess() == null || step.getOnSuccess().size() == 0) {
return result;
}
Object[] followings = step.getOnSuccess().toArray();
for (Object followingId : followings) {
WorkflowStep followingStep = wf.getSteps().get(followingId);
unlinkSteps(step, followingStep);
result.add(followingStep);
}
return result;
}
Aggregations