String definingDocumentId = "";
if (null != definingDocumentIdList && 1 == definingDocumentIdList.getLength()) {
definingDocumentId = definingDocumentIdList.item(0).getNodeValue().trim();
}
FlowCallBuilder flowCallBuilder = flowBuilder.flowCallNode(flowCallId);
flowCallBuilder.flowReference(definingDocumentId, destinationId);
NodeList outboundParameters = (NodeList) xpath.evaluate(".//ns1:outbound-parameter",
flowDefinition, XPathConstants.NODESET);
if (null != outboundParameters) {
for (int i_outbound = 0; i_outbound < outboundParameters.getLength(); i_outbound++) {
Node outboundParamNode = outboundParameters.item(i_outbound);
NodeList nameList = (NodeList)
xpath.evaluate(".//ns1:name/text()", outboundParamNode, XPathConstants.NODESET);
if (1 < nameList.getLength()) {
throw new XPathExpressionException("Within <outbound-parameter> only one <name> child is allowed");
}
String nameStr = nameList.item(0).getNodeValue().trim();
NodeList valueList = (NodeList)
xpath.evaluate(".//ns1:value/text()", outboundParamNode, XPathConstants.NODESET);
if (1 < valueList.getLength()) {
throw new XPathExpressionException("Within <inbound-parameter> only one <value> child is allowed");
}
String valueStr = valueList.item(0).getNodeValue().trim();
flowCallBuilder.outboundParameter(nameStr, valueStr);
}
}
}
// </editor-fold>