]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Workaround to issue with inner beans / frozen parameters
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 9 Jul 2009 19:22:55 +0000 (19:22 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 9 Jul 2009 19:22:55 +0000 (19:22 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@2717 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlowDescriptorConverter.java

index 8f13609dc8054fc88f26e3969594cb58a888b679..d8429d192d1d9675516d47a6365e0e199426f887 100644 (file)
@@ -27,6 +27,9 @@ public class DefaultExecutionFlowDescriptorConverter implements
                ExecutionFlowDescriptorConverter, ApplicationContextAware {
        public final static String REF_VALUE_TYPE_BEAN_NAME = "beanName";
 
+       /** Workaround for https://www.spartadn.com/bugzilla/show_bug.cgi?id=206 */
+       private final static String REF_VALUE_IS_FROZEN = "__frozen";
+
        private final static Log log = LogFactory
                        .getLog(DefaultExecutionFlowDescriptorConverter.class);
 
@@ -38,7 +41,13 @@ public class DefaultExecutionFlowDescriptorConverter implements
                Map<String, Object> convertedValues = new HashMap<String, Object>();
 
                if (values != null) {
-                       for (String key : values.keySet()) {
+                       values: for (String key : values.keySet()) {
+                               ExecutionSpecAttribute attribute = executionFlowDescriptor
+                                               .getExecutionSpec().getAttributes().get(key);
+
+                               if (attribute.getIsFrozen())
+                                       continue values;
+
                                Object value = values.get(key);
                                if (value instanceof PrimitiveValue) {
                                        PrimitiveValue primitiveValue = (PrimitiveValue) value;
@@ -77,7 +86,7 @@ public class DefaultExecutionFlowDescriptorConverter implements
                        Assert.notNull(executionSpec.getName());
 
                        Map<String, Object> values = new TreeMap<String, Object>();
-                       for (String key : executionSpec.getAttributes().keySet()) {
+                       attrs: for (String key : executionSpec.getAttributes().keySet()) {
                                ExecutionSpecAttribute attribute = executionSpec
                                                .getAttributes().get(key);
 
@@ -95,8 +104,12 @@ public class DefaultExecutionFlowDescriptorConverter implements
                                                // all necessary information is in the spec
                                        }
                                } else if (attribute instanceof RefSpecAttribute) {
-                                       values.put(key, buildRefValue((RefSpecAttribute) attribute,
-                                                       executionFlow, key));
+                                       if (attribute.getIsFrozen()) {
+                                               values.put(key, new RefValue(REF_VALUE_IS_FROZEN));
+                                       } else
+                                               values.put(key, buildRefValue(
+                                                               (RefSpecAttribute) attribute, executionFlow,
+                                                               key));
                                } else {
                                        throw new SlcException("Unkown spec attribute type "
                                                        + attribute.getClass());