private void loadAllProperties() throws IOException { // First load all the properties for (FlowProps fprops : flow.getFlowProps()) { String source = fprops.getSource(); File propsPath = new File(execDir, source); Props props = new Props(null, propsPath); sharedProps.put(source, props); } // Resolve parents for (FlowProps fprops : flow.getFlowProps()) { if (fprops.getInheritedSource() != null) { String source = fprops.getSource(); String inherit = fprops.getInheritedSource(); Props props = sharedProps.get(source); Props inherits = sharedProps.get(inherit); props.setParent(inherits); } else { String source = fprops.getSource(); Props props = sharedProps.get(source); props.setParent(globalProps); } } }
public Map<String, Object> toObject() { HashMap<String, Object> flowObj = new HashMap<String, Object>(); flowObj.put("type", "executableflow"); flowObj.put("executionId", executionId); flowObj.put("executionPath", executionPath); flowObj.put("flowId", flowId); flowObj.put("projectId", projectId); flowObj.put("submitTime", submitTime); flowObj.put("startTime", startTime); flowObj.put("endTime", endTime); flowObj.put("status", flowStatus.toString()); flowObj.put("submitUser", submitUser); flowObj.put("flowParameters", this.flowParameters); flowObj.put("notifyOnFirstFailure", this.notifyOnFirstFailure); flowObj.put("notifyOnLastFailure", this.notifyOnLastFailure); flowObj.put("successEmails", successEmails); flowObj.put("failureEmails", failureEmails); flowObj.put("failureAction", failureAction.toString()); flowObj.put("pipelineLevel", pipelineLevel); flowObj.put("version", version); ArrayList<Object> props = new ArrayList<Object>(); for (FlowProps fprop : flowProps.values()) { HashMap<String, Object> propObj = new HashMap<String, Object>(); String source = fprop.getSource(); String inheritedSource = fprop.getInheritedSource(); propObj.put("source", source); if (inheritedSource != null) { propObj.put("inherited", inheritedSource); } props.add(propObj); } flowObj.put("properties", props); ArrayList<Object> nodes = new ArrayList<Object>(); for (ExecutableNode node : executableNodes.values()) { nodes.add(node.toObject()); } flowObj.put("nodes", nodes); ArrayList<String> proxyUserList = new ArrayList<String>(proxyUsers); flowObj.put("proxyUsers", proxyUserList); return flowObj; }