- RealizedFlow realizedFlow = new RealizedFlow();
- realizedFlow.setModuleName(executionModuleName);
- realizedFlow.setModuleVersion(executionModuleVersion);
-
- DefaultExecutionSpec executionSpec = null;
- if (flowNode.hasProperty(SlcNames.SLC_SPEC)) {
- Node executionSpecNode = flowNode.getProperty(SLC_SPEC)
- .getNode();
- executionSpec = new DefaultExecutionSpec();
- executionSpec.setBeanName(executionSpecNode.getProperty(
- SLC_NAME).getString());
- executionSpec
- .setAttributes(readExecutionSpecAttributes(executionSpecNode));
- }
- // TODO: will with original attr
- Map<String, ExecutionSpecAttribute> attrs = readExecutionSpecAttributes(realizedFlowNode);
- Map<String, Object> values = new HashMap<String, Object>();
- for (String attrName : attrs.keySet()) {
- ExecutionSpecAttribute attr = attrs.get(attrName);
- Object value = attr.getValue();
- values.put(attrName,value);
- }
-
-// if(executionSpec!=null)
-// executionSpec.setAttributes(attrs);
- ExecutionFlowDescriptor efd = new ExecutionFlowDescriptor(flowName,
- values, executionSpec);
- realizedFlow.setFlowDescriptor(efd);
-
- execute(realizedFlow, true);
- }
- }
-
- protected Map<String, ExecutionSpecAttribute> readExecutionSpecAttributes(
- Node node) {
- try {
- Map<String, ExecutionSpecAttribute> attrs = new HashMap<String, ExecutionSpecAttribute>();
- for (NodeIterator nit = node.getNodes(); nit.hasNext();) {
- Node specAttrNode = nit.nextNode();
- if (specAttrNode
- .isNodeType(SlcTypes.SLC_PRIMITIVE_SPEC_ATTRIBUTE)) {
- String type = specAttrNode.getProperty(SLC_TYPE)
- .getString();
- 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);
+ setFlowStatus(realizedFlowNode,
+ ExecutionProcess.COMPLETED);
+ } catch (RepositoryException e) {
+ throw e;
+ } catch (InterruptedException e) {
+ setFlowStatus(realizedFlowNode, ExecutionProcess.KILLED);
+ throw e;
+ } catch (RuntimeException e) {
+ setFlowStatus(realizedFlowNode, ExecutionProcess.ERROR);
+ throw e;