package alien4cloud.paas.wf;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import alien4cloud.paas.wf.validation.AbstractWorkflowError;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Workflow {

    public static final String INSTALL_WF = "install";

    public static final String UNINSTALL_WF = "uninstall";

    private String name;
    private String description;
    private boolean isStandard;

    private Map<String, AbstractStep> steps = new HashMap<String, AbstractStep>();

    private Set<String> hosts = new HashSet<String>();
    
    public <S extends AbstractStep> S addStep(S step) {
        steps.put(step.getName(), step);
        return step;
    }

    private List<AbstractWorkflowError> errors;

    public void clearErrors() {
        errors = new ArrayList<AbstractWorkflowError>();
    }

    public boolean hasErrors() {
        return errors != null && errors.size() > 0;
    }

    public void addErrors(List<AbstractWorkflowError> errorsToAdd) {
        if (errors == null) {
            errors = new ArrayList<AbstractWorkflowError>(errorsToAdd);
        } else {
            errors.addAll(errorsToAdd);
        }
    }

}

@@ -72,19 +72,19 @@
 til.Hash
-Map
+Set
 ;%0Aimport
@@ -86,39 +86,45 @@
 mport java.util.
+Linked
 Hash
-Set
+Map
 ;%0Aimport java.ut
@@ -177,16 +177,60 @@
 l.Set;%0A%0A
+import lombok.Getter;%0Aimport lombok.Setter;%0A
 import a
@@ -285,52 +285,8 @@
 ror;
-%0Aimport lombok.Getter;%0Aimport lombok.Setter;
 %0A%0A@G
@@ -530,16 +530,138 @@
 ndard;%0A%0A
+    /**%0A     * FIXME: Here we use a %7B@link LinkedHashMap%7D just to pass cfy3 provider generation plueprint tests !%0A     */%0A
     priv
@@ -698,24 +698,30 @@
 steps = new 
+Linked
 HashMap%3CStri

fix blueprint generation tests