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=26e3737b0be824d3cd0f257a7595ab1629024c5f;hb=26cd9f658531888bfa9ba69ea5c034839b4c4149;hp=9d838b39f03ee93eccad654f1eaa84954aa70f80;hpb=b26f6f65dd1da46a675c618c39194ae534e040bb;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 9d838b39f..26e3737b0 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 @@ -63,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) @@ -77,13 +78,38 @@ 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); + // 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(); + 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);