X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=runtime%2Forg.argeo.slc.support.jcr%2Fsrc%2Fmain%2Fjava%2Forg%2Fargeo%2Fslc%2Fjcr%2Fexecution%2FJcrProcessThread.java;h=1c97322bda6f344b49db5f2fd4ceb5a1dce8b14b;hb=e1dc41316d19aedd4d03e459f143b8fddf0e7d75;hp=de023cefa1ed1f3b42e829a003bb8655125e9959;hpb=86c47402780f41526382267ff1597d2f3a0d0dd7;p=gpl%2Fargeo-slc.git diff --git a/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrProcessThread.java b/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrProcessThread.java index de023cefa..1c97322bd 100644 --- a/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrProcessThread.java +++ b/runtime/org.argeo.slc.support.jcr/src/main/java/org/argeo/slc/jcr/execution/JcrProcessThread.java @@ -13,7 +13,6 @@ import org.argeo.slc.SlcException; import org.argeo.slc.core.execution.DefaultExecutionSpec; import org.argeo.slc.core.execution.PrimitiveSpecAttribute; import org.argeo.slc.core.execution.PrimitiveUtils; -import org.argeo.slc.core.execution.PrimitiveValue; import org.argeo.slc.core.execution.ProcessThread; import org.argeo.slc.execution.ExecutionFlowDescriptor; import org.argeo.slc.execution.ExecutionModulesManager; @@ -64,6 +63,7 @@ public class JcrProcessThread extends ProcessThread implements SlcNames { realizedFlow.setModuleName(executionModuleName); realizedFlow.setModuleVersion(executionModuleVersion); + // retrieve execution spec DefaultExecutionSpec executionSpec = null; if (flowNode.hasProperty(SlcNames.SLC_SPEC)) { Node executionSpecNode = flowNode.getProperty(SLC_SPEC) @@ -78,13 +78,24 @@ public class JcrProcessThread extends ProcessThread implements SlcNames { Map attrs = readExecutionSpecAttributes(realizedFlowNode); Map values = new HashMap(); for (String attrName : attrs.keySet()) { - ExecutionSpecAttribute attr = attrs.get(attrName); - Object value = attr.getValue(); - values.put(attrName,value); + if (flowNode.hasNode(attrName)) { + // we assume this is a primitive + // since ref are not yet implemented + Node valueNode = flowNode.getNode(attrName); + String type = valueNode.getProperty(SLC_TYPE).getString(); + String valueStr = valueNode.getProperty(SLC_VALUE) + .getString(); + Object value = PrimitiveUtils.convert(type, valueStr); + values.put(attrName, value); + } else { + ExecutionSpecAttribute attr = attrs.get(attrName); + Object value = attr.getValue(); + values.put(attrName, value); + } } - -// if(executionSpec!=null) -// executionSpec.setAttributes(attrs); + + // if(executionSpec!=null) + // executionSpec.setAttributes(attrs); ExecutionFlowDescriptor efd = new ExecutionFlowDescriptor(flowName, values, executionSpec); realizedFlow.setFlowDescriptor(efd); @@ -103,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); } }