X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.simple%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fcore%2Fexecution%2FExecutionContext.java;h=d6b69af8485494dbd18cf66e693af489af1ce515;hb=2887de51b854588b4a60ab12124c179997e0a015;hp=97f7268b67cf91320158cd885902faa060f42450;hpb=1b19cac6a92c31d9119fc2986e7aaf3df98b2393;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/ExecutionContext.java b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/ExecutionContext.java index 97f7268b6..d6b69af84 100644 --- a/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/ExecutionContext.java +++ b/runtime/org.argeo.slc.support.simple/src/main/java/org/argeo/slc/core/execution/ExecutionContext.java @@ -30,6 +30,10 @@ public class ExecutionContext { return null; return executionContext.get().variables; } + + public void addVariables(Map variablesToAdd) { + variables.putAll(variablesToAdd); + } public static ExecutionContext getCurrent() { return executionContext.get(); @@ -47,6 +51,20 @@ public class ExecutionContext { + " already registered."); executionContext.set(context); } + + /** + * Unregisters the ExecutionContext for the current Thread + * @throws a SlcException if no ExecutionContext was registered for the Thread + * @return the unregistered ExecutionContext + */ + public static ExecutionContext unregisterExecutionContext() { + ExecutionContext current = executionContext.get(); + if(current == null) { + throw new SlcException("No Context registered."); + } + executionContext.remove(); + return current; + } public static void enterFlow(ExecutionFlow executionFlow) { Stack stack = executionContext.get().stack; @@ -61,8 +79,8 @@ public class ExecutionContext { Map specAttrs = executionFlow .getExecutionSpec().getAttributes(); for (String key : specAttrs.keySet()) { - ExecutionSpecAttribute esa = specAttrs.get(key); - if (esa.getIsParameter()) { + //ExecutionSpecAttribute esa = specAttrs.get(key); + if (executionFlow.isSetAsParameter(key)) { runtime.getLocalVariables().put(key, executionFlow.getParameter(key)); if (log.isTraceEnabled())