processInitializerFinalizer(xpath, flowDefinition, flowBuilder);
String startNodeId = processStartNode(xpath, flowDefinition, flowBuilder);
if (null != startNodeId) {
FlowImpl toAdd = flowBuilder._getFlow();
FlowNode startNode = toAdd.getNode(startNodeId);
if (null == startNode) {
throw new XPathExpressionException("Unable to find flow node with id " + startNodeId + " to mark as start node");
} else {
toAdd.setStartNodeId(startNodeId);
}
} else {
flowBuilder.viewNode(flowId, "/" + flowId + "/" + flowId + ".xhtml").markAsStartNode();
}
flowHandler.addFlow(context, flowBuilder.getFlow());