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=9332826084b29bdd972162b39960745961f2816f;hb=01b5a7894ada9c5ef16770e6ce962a7fd9d45276;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..933282608 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 @@ -47,6 +47,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 +75,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())