- } catch (RepositoryException e) {
- throw new ArgeoException("Cannot process "
- + getJcrExecutionProcess().getNodePath(), e);
- } finally {
- JcrUtils.logoutQuietly(session);
- }
- }
-
- /** Configure the realized flows */
- protected void execute(Node realizedFlowNode) throws RepositoryException,
- InterruptedException {
- if (realizedFlowNode.hasNode(SLC_ADDRESS)) {
- String flowPath = realizedFlowNode.getNode(SLC_ADDRESS)
- .getProperty(Property.JCR_PATH).getString();
- // TODO: convert to local path if remote
-
- Node flowNode = realizedFlowNode.getSession().getNode(flowPath);
- String flowName = flowNode.getProperty(SLC_NAME).getString();
-
- Node executionModuleNode = flowNode.getSession().getNode(
- SlcJcrUtils.modulePath(flowPath));
- String executionModuleName = executionModuleNode.getProperty(
- SLC_NAME).getString();
- String executionModuleVersion = executionModuleNode.getProperty(
- SLC_VERSION).getString();
-
- RealizedFlow realizedFlow = new RealizedFlow();
- realizedFlow.setModuleName(executionModuleName);
- realizedFlow.setModuleVersion(executionModuleVersion);
-
- // retrieve execution spec
- DefaultExecutionSpec executionSpec = new DefaultExecutionSpec();
- Map<String, ExecutionSpecAttribute> attrs = readExecutionSpecAttributes(realizedFlowNode);
- executionSpec.setAttributes(attrs);
-
- // set execution spec name
- if (flowNode.hasProperty(SlcNames.SLC_SPEC)) {
- Node executionSpecNode = flowNode.getProperty(SLC_SPEC)
- .getNode();
- executionSpec.setBeanName(executionSpecNode.getProperty(
- SLC_NAME).getString());
- }
-
- // explicitly retrieve values
- 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);
- }
-
- ExecutionFlowDescriptor efd = new ExecutionFlowDescriptor(flowName,
- values, executionSpec);
- realizedFlow.setFlowDescriptor(efd);
-
- //
- // EXECUTE THE FLOW
- //
- execute(realizedFlow, true);
- //
- }