From: Mathieu Baudier Date: Fri, 22 Mar 2013 16:12:34 +0000 (+0000) Subject: Fix regression when adding flow nodes X-Git-Tag: argeo-slc-2.1.7~376 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=5bb40a1eed56ef11c90aa3a86274af12efe3a41f;p=gpl%2Fargeo-slc.git Fix regression when adding flow nodes git-svn-id: https://svn.argeo.org/slc/trunk@6208 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionModulesListener.java b/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionModulesListener.java index 9e866dfc7..ea734a8bb 100644 --- a/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionModulesListener.java +++ b/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrExecutionModulesListener.java @@ -296,16 +296,14 @@ public class JcrExecutionModulesListener implements ExecutionModulesListener, flowNode.setProperty(SLC_SPEC, executionSpecNode); } - // values + // flow values for (String attr : efd.getValues().keySet()) { ExecutionSpecAttribute esa = executionSpec.getAttributes() .get(attr); - if (!flowNode.hasNode(attr)) - throw new SlcException("No spec node for attribute '" + attr - + "' in flow " + flowNode.getPath()); if (esa instanceof PrimitiveSpecAttribute) { PrimitiveSpecAttribute psa = (PrimitiveSpecAttribute) esa; - Node valueNode = flowNode.getNode(attr); + // if spec reference there will be no node at this stage + Node valueNode = JcrUtils.getOrAdd(flowNode, attr); valueNode.setProperty(SLC_TYPE, psa.getType()); SlcJcrUtils.setPrimitiveAsProperty(valueNode, SLC_VALUE, (PrimitiveValue) efd.getValues().get(attr));