import org.argeo.slc.SlcException;
import org.argeo.slc.execution.ExecutionContext;
+import org.argeo.slc.execution.ExecutionFlow;
+import org.argeo.slc.execution.ExecutionStack;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import org.springframework.beans.BeansException;
private final String uuid;
private ApplicationContext applicationContext;
+ private ExecutionStack executionStack;
public MapExecutionContext() {
uuid = UUID.randomUUID().toString();
// try system property in last resort
if (value == null)
value = System.getProperty(key);
+
+ // if the variable was not found, look in the stack starting at the
+ // upper flows
+ if (value == null) {
+ value = executionStack.findLocalVariable(key);
+ }
return value;
}
return uuid;
}
+ @Override
+ public void beforeFlow(ExecutionFlow executionFlow) {
+ // getUuid();
+ executionStack.enterFlow(executionFlow);
+ setVariable(ExecutionContext.VAR_FLOW_ID,
+ executionStack.getCurrentStackLevelUuid());
+ setVariable(ExecutionContext.VAR_FLOW_NAME, executionFlow.getName());
+ }
+
+ @Override
+ public void afterFlow(ExecutionFlow executionFlow) {
+ executionStack.leaveFlow(executionFlow);
+ }
+
@Override
public boolean equals(Object obj) {
if (obj instanceof ExecutionContext)
this.applicationContext = applicationContext;
}
+ public void setExecutionStack(ExecutionStack executionStack) {
+ this.executionStack = executionStack;
+ }
+
}