public class MapExecutionContext implements ExecutionContext {
private final static Log log = LogFactory.getLog(MapExecutionContext.class);
public class MapExecutionContext implements ExecutionContext {
private final static Log log = LogFactory.getLog(MapExecutionContext.class);
private final Stack<ExecutionFlowRuntime> stack = new Stack<ExecutionFlowRuntime>();
// TODO: make it thread safe?
private final Map<String, Object> variables = new HashMap<String, Object>();
private final String uuid = UUID.randomUUID().toString();
private final Stack<ExecutionFlowRuntime> stack = new Stack<ExecutionFlowRuntime>();
// TODO: make it thread safe?
private final Map<String, Object> variables = new HashMap<String, Object>();
private final String uuid = UUID.randomUUID().toString();
-
- public void addVariables(Map<? extends String, ? extends Object> variablesToAdd) {
+
+ private final Date creationDate = new Date();
+
+ public void addVariables(
+ Map<? extends String, ? extends Object> variablesToAdd) {
Map<String, ExecutionSpecAttribute> specAttrs = executionFlow
.getExecutionSpec().getAttributes();
for (String key : specAttrs.keySet()) {
Map<String, ExecutionSpecAttribute> specAttrs = executionFlow
.getExecutionSpec().getAttributes();
for (String key : specAttrs.keySet()) {
if (executionFlow.isSetAsParameter(key)) {
runtime.getLocalVariables().put(key,
executionFlow.getParameter(key));
if (executionFlow.isSetAsParameter(key)) {
runtime.getLocalVariables().put(key,
executionFlow.getParameter(key));
// Look if the variable is set in the global execution variables
// (i.e. the variable was overridden)
if (variables.containsKey(key))
// Look if the variable is set in the global execution variables
// (i.e. the variable was overridden)
if (variables.containsKey(key))
private static class ExecutionFlowRuntime {
private final ExecutionFlow executionFlow;
private final Map<String, Object> scopedObjects = new HashMap<String, Object>();
private static class ExecutionFlowRuntime {
private final ExecutionFlow executionFlow;
private final Map<String, Object> scopedObjects = new HashMap<String, Object>();