X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;ds=sidebyside;f=runtime%2Forg.argeo.slc.support.simple%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2FAbstractSpringExecutionModule.java;h=51ca2f159f8c08db9d48b226620e86c21efbe380;hb=63b5eb0bd0b282844093950ba05d77b1fcd0f664;hp=5da729a5df043a5535d6f8661370db8fc600dc4e;hpb=c83e59caa846134d0a2d5eff2485d994255c12cc;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/AbstractSpringExecutionModule.java b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/AbstractSpringExecutionModule.java index 5da729a5d..51ca2f159 100644 --- a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/AbstractSpringExecutionModule.java +++ b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/AbstractSpringExecutionModule.java @@ -1,6 +1,5 @@ package org.argeo.slc.core.execution; -import java.util.HashMap; import java.util.Map; import java.util.TreeMap; @@ -8,11 +7,11 @@ import org.argeo.slc.SlcException; import org.argeo.slc.execution.ExecutionContext; import org.argeo.slc.execution.ExecutionFlow; import org.argeo.slc.execution.ExecutionFlowDescriptor; +import org.argeo.slc.execution.ExecutionFlowDescriptorConverter; import org.argeo.slc.execution.ExecutionModule; import org.argeo.slc.execution.ExecutionModuleDescriptor; import org.argeo.slc.execution.ExecutionSpec; import org.argeo.slc.execution.ExecutionSpecAttribute; -import org.argeo.slc.process.SlcExecution; import org.springframework.aop.scope.ScopedObject; import org.springframework.beans.BeansException; import org.springframework.beans.factory.generic.GenericBeanFactoryAccessor; @@ -27,13 +26,7 @@ public abstract class AbstractSpringExecutionModule implements ExecutionModule, private ExecutionContext executionContext; - public ExecutionContext getExecutionContext() { - return executionContext; - } - - public void setExecutionContext(ExecutionContext executionContext) { - this.executionContext = executionContext; - } + private ExecutionFlowDescriptorConverter descriptorConverter = new DefaultDescriptorConverter(); public ExecutionModuleDescriptor getDescriptor() { ExecutionModuleDescriptor md = new ExecutionModuleDescriptor(); @@ -89,6 +82,8 @@ public abstract class AbstractSpringExecutionModule implements ExecutionModule, ExecutionFlowDescriptor efd = new ExecutionFlowDescriptor(name, values, executionSpec); + if (executionFlow.getPath() != null) + efd.setPath(executionFlow.getPath()); // Add execution spec if necessary if (!md.getExecutionSpecs().contains(executionSpec)) @@ -101,9 +96,12 @@ public abstract class AbstractSpringExecutionModule implements ExecutionModule, return md; } - public void execute(ExecutionFlowDescriptor descriptor) { + public void execute(ExecutionFlowDescriptor executionFlowDescriptor) { + if (descriptorConverter != null) + executionContext.addVariables(descriptorConverter + .convertValues(executionFlowDescriptor)); ExecutionFlow flow = (ExecutionFlow) applicationContext.getBean( - descriptor.getName(), ExecutionFlow.class); + executionFlowDescriptor.getName(), ExecutionFlow.class); flow.execute(); } @@ -112,4 +110,13 @@ public abstract class AbstractSpringExecutionModule implements ExecutionModule, this.applicationContext = applicationContext; } + public void setExecutionContext(ExecutionContext executionContext) { + this.executionContext = executionContext; + } + + public void setDescriptorConverter( + ExecutionFlowDescriptorConverter descriptorConverter) { + this.descriptorConverter = descriptorConverter; + } + }