]> git.argeo.org Git - gpl/argeo-slc.git/commitdiff
Fix unregistered attribute
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 19 May 2011 17:09:08 +0000 (17:09 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 19 May 2011 17:09:08 +0000 (17:09 +0000)
git-svn-id: https://svn.argeo.org/slc/trunk@4526 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

runtime/org.argeo.slc.core/src/main/java/org/argeo/slc/core/execution/DefaultExecutionFlowDescriptorConverter.java
runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionModulesListener.java
runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrProcessThread.java

index b940f74018c1e68d4500ba3d9832cf3d57d3ffd0..8e096075147b778e2dd9547163b04bb61a7877b5 100644 (file)
@@ -74,6 +74,10 @@ public class DefaultExecutionFlowDescriptorConverter implements
                                ExecutionSpecAttribute attribute = executionSpec
                                                .getAttributes().get(key);
 
+                               if (attribute == null)
+                                       throw new SlcException("No spec attribute defined for '"
+                                                       + key + "'");
+
                                if (attribute.getIsFrozen())
                                        continue values;
 
@@ -130,7 +134,7 @@ public class DefaultExecutionFlowDescriptorConverter implements
                                                throw new UnsupportedException("Ref value type",
                                                                refValue.getType());
                                        }
-                               }else{
+                               } else {
                                        convertedValues.put(key, value);
                                }
                        }
index 8543689294323ff8e0c3f24c59b7fea830b6b0d3..f2fc602130f4948646abc8a6b96640523ecee1ff 100644 (file)
@@ -242,8 +242,6 @@ public class JcrExecutionModulesListener implements ExecutionModulesListener,
 
                // values
                for (String attr : efd.getValues().keySet()) {
-                       if (log.isDebugEnabled())
-                               log.debug(attr + "=" + efd.getValues().get(attr));
                        ExecutionSpecAttribute esa = executionSpec.getAttributes()
                                        .get(attr);
                        if (esa instanceof PrimitiveSpecAttribute) {
index 26e3737b0be824d3cd0f257a7595ab1629024c5f..1c97322bda6f344b49db5f2fd4ceb5a1dce8b14b 100644 (file)
@@ -87,20 +87,6 @@ public class JcrProcessThread extends ProcessThread implements SlcNames {
                                                        .getString();
                                        Object value = PrimitiveUtils.convert(type, valueStr);
                                        values.put(attrName, value);
-                                       // Property prop = flowNode.getNode(attrName).getProperty(
-                                       // SLC_VALUE);
-                                       // // yes, this could be a switch... (patches welcome)
-                                       // if (prop.getType() == PropertyType.STRING)
-                                       // values.put(attrName, prop.getString());
-                                       // else if (prop.getType() == PropertyType.LONG)
-                                       // values.put(attrName, prop.getLong());
-                                       // else if (prop.getType() == PropertyType.DOUBLE)
-                                       // values.put(attrName, prop.getDouble());
-                                       // else if (prop.getType() == PropertyType.BOOLEAN)
-                                       // values.put(attrName, prop.getBoolean());
-                                       // else
-                                       // throw new SlcException("Unsupported value type "
-                                       // + PropertyType.nameFromValue(prop.getType()));
                                } else {
                                        ExecutionSpecAttribute attr = attrs.get(attrName);
                                        Object value = attr.getValue();
@@ -128,14 +114,15 @@ public class JcrProcessThread extends ProcessThread implements SlcNames {
                                                .isNodeType(SlcTypes.SLC_PRIMITIVE_SPEC_ATTRIBUTE)) {
                                        String type = specAttrNode.getProperty(SLC_TYPE)
                                                        .getString();
+                                       Object value = null;
                                        if (specAttrNode.hasProperty(SLC_VALUE)) {
                                                String valueStr = specAttrNode.getProperty(SLC_VALUE)
                                                                .getString();
-                                               Object value = PrimitiveUtils.convert(type, valueStr);
-                                               PrimitiveSpecAttribute specAttr = new PrimitiveSpecAttribute(
-                                                               type, value);
-                                               attrs.put(specAttrNode.getName(), specAttr);
+                                               value = PrimitiveUtils.convert(type, valueStr);
                                        }
+                                       PrimitiveSpecAttribute specAttr = new PrimitiveSpecAttribute(
+                                                       type, value);
+                                       attrs.put(specAttrNode.getName(), specAttr);
                                }
 
                        }