X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=sandbox%2Fargeo.slc.executionflow%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fexecutionflow%2FExecutionParameterPostProcessor.java;h=bc41feac8bd6dd9ed8adca3a3d41b6abaf235a31;hb=f3797d5a7f833ecb183ce8d4a31a7897fbca4035;hp=adeddaafb9231198ea541024b6ebf4a6a6b0c788;hpb=5ae68ecbb5176b7924d279cd8d96a0b650abcf2c;p=gpl%2Fargeo-slc.git diff --git a/sandbox/argeo.slc.executionflow/src/main/java/org/argeo/slc/executionflow/ExecutionParameterPostProcessor.java b/sandbox/argeo.slc.executionflow/src/main/java/org/argeo/slc/executionflow/ExecutionParameterPostProcessor.java index adeddaafb..bc41feac8 100644 --- a/sandbox/argeo.slc.executionflow/src/main/java/org/argeo/slc/executionflow/ExecutionParameterPostProcessor.java +++ b/sandbox/argeo.slc.executionflow/src/main/java/org/argeo/slc/executionflow/ExecutionParameterPostProcessor.java @@ -28,10 +28,11 @@ public class ExecutionParameterPostProcessor extends public PropertyValues postProcessPropertyValues(PropertyValues pvs, PropertyDescriptor[] pds, Object bean, String beanName) throws BeansException { - ExecutionFlow currentFlow = ExecutionContext.getCurrentFlow(); - if (currentFlow == null) + if (!ExecutionContext.isExecuting()) return pvs; + ExecutionFlow currentFlow = ExecutionContext.getCurrentFlow(); + Properties props = new Properties(); Map attributes = currentFlow.getAttributes(); Map specAttributes = currentFlow @@ -45,8 +46,8 @@ public class ExecutionParameterPostProcessor extends + " is not set in " + currentFlow); props.setProperty(key, attributes.get(key).toString()); -// if (log.isTraceEnabled()) -// log.trace("Use attribute " + key); + // if (log.isTraceEnabled()) + // log.trace("Use attribute " + key); } } CustomPpc ppc = new CustomPpc(props); @@ -59,14 +60,14 @@ public class ExecutionParameterPostProcessor extends tsv.setValue(convertedValue); if (log.isTraceEnabled()) { if (!originalValue.equals(convertedValue)) - log.trace("Converted " + beanName + "[" + pv.getName() - + "]: " + originalValue + " to " - + convertedValue); + log.trace("Converted field '" + pv.getName() + "': '" + + originalValue + "' to '" + convertedValue + + "' in bean " + beanName); } } else { -// if (log.isTraceEnabled()) -// log.trace(beanName + "[" + pv.getName() + "]: " -// + pv.getValue().getClass()); + // if (log.isTraceEnabled()) + // log.trace(beanName + "[" + pv.getName() + "]: " + // + pv.getValue().getClass()); } } @@ -97,7 +98,8 @@ public class ExecutionParameterPostProcessor extends } public String process(String strVal) { - String value = parseStringValue(strVal, this.props, new HashSet()); + String value = parseStringValue(strVal, this.props, + new HashSet()); return (value.equals(nullValue) ? null : value); } }