]> git.argeo.org Git - gpl/argeo-slc.git/blobdiff - runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlow.java
Simplify minimal configs for execution
[gpl/argeo-slc.git] / runtime / org.argeo.slc.core / src / main / java / org / argeo / slc / core / execution / DefaultExecutionFlow.java
index 7fd07fe770ff32c1d28a94be1c21500cd067be4d..a25034e347a3e4dee381b9a2f0819102e91212f7 100644 (file)
@@ -18,7 +18,7 @@ import org.springframework.beans.factory.InitializingBean;
 import org.springframework.validation.MapBindingResult;
 
 public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
-               BeanNameAware, StructureAware<TreeSPath> {
+               BeanNameAware {
 
        private final ExecutionSpec executionSpec;
        private String name = null;
@@ -95,6 +95,11 @@ public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
                                if (executable instanceof StructureAware) {
                                        ((StructureAware<TreeSPath>) executable).notifyCurrentPath(
                                                        registry, new TreeSPath(path));
+                               } else if (executable instanceof DefaultExecutionFlow) {
+                                       // so we don't need to have DefaultExecutionFlow
+                                       // implementing StructureAware
+                                       DefaultExecutionFlow flow = (DefaultExecutionFlow) executable;
+                                       flow.setPath(path + '/' + flow.getName());
                                }
                        }
                }
@@ -168,11 +173,4 @@ public class DefaultExecutionFlow implements ExecutionFlow, InitializingBean,
                this.registry = registry;
        }
 
-       public void notifyCurrentPath(StructureRegistry<TreeSPath> registry,
-                       TreeSPath path) {
-               if (this.path == null) {
-                       this.path = path.toString();
-               }
-       }
-
 }