private Map<String, Object> parameters = new HashMap<String, Object>();
private List<Executable> executables = new ArrayList<Executable>();
- private final String uuid = UUID.randomUUID().toString();
+ public SimpleExecutionFlow() {
+
+ }
+
+ public SimpleExecutionFlow(Map<String, Object> parameters) {
+ this.parameters.putAll(parameters);
+ }
public void execute() {
for (Executable executable : executables) {
return;
MapBindingResult errors = new MapBindingResult(parameters, "execution#"
- + getUuid());
+ + getName());
for (String key : executionSpec.getAttributes().keySet()) {
ExecutionSpecAttribute executionSpecAttr = executionSpec
.getAttributes().get(key);
Object obj = parameters.get(key);
if (executionSpecAttr instanceof RefSpecAttribute) {
RefSpecAttribute rsa = (RefSpecAttribute) executionSpecAttr;
+ // TODO: make sure this will not cause pb with OSGi
Class targetClass = rsa.getTargetClass();
if (!targetClass.isAssignableFrom(obj.getClass())) {
errors.reject(key
this.parameters = attributes;
}
- public String getUuid() {
- return uuid;
+ public String getName() {
+ return name;
}
public ExecutionSpec getExecutionSpec() {
return esa.getValue();
} else {
throw new SlcException("Key " + name
- + " is not define in the specifications of "
+ + " is not defined in the specifications of "
+ toString());
}
}
}
public String toString() {
- return new StringBuffer("Flow ").append(name).toString();// .append(" [#")
- // .append(uuid).append(']').toString();
+ return new StringBuffer("Flow ").append(name).toString();
+ }
+
+ public boolean equals(Object obj) {
+ return ((ExecutionFlow) obj).getName().equals(name);
}
}