private void processInitializerFinalizer(XPath xpath, Node flowDefinition, FlowBuilder flowBuilder) throws XPathExpressionException {
// <editor-fold defaultstate="collapsed">
NodeList initializerNodeList = (NodeList)
xpath.evaluate(".//ns1:initializer/text()", flowDefinition, XPathConstants.NODESET);
if (1 < initializerNodeList.getLength()) {
throw new XPathExpressionException("At most one <initializer> is allowed.");
}
if (1 == initializerNodeList.getLength()) {
String initializerStr = initializerNodeList.item(0).getNodeValue().trim();
flowBuilder.initializer(initializerStr);
}
NodeList finalizerNodeList = (NodeList)
xpath.evaluate(".//ns1:finalizer/text()", flowDefinition, XPathConstants.NODESET);
if (1 < finalizerNodeList.getLength()) {
throw new XPathExpressionException("At most one <finalizer> is allowed.");
}
if (1 == finalizerNodeList.getLength()) {
String finalizerStr = finalizerNodeList.item(0).getNodeValue().trim();
flowBuilder.finalizer(finalizerStr);