// get the node type
Class<?> nodeType = NodeTypes.getNodeType(nodeName);
if (nodeType != null)
{
Node node = null;
try
{
// create a new instance
node = (Node)nodeType.newInstance();
}
catch (Exception e)
{
log.error("couldn't instantiate node '" + nodeName + "', of type '" + nodeType.getName() + "'", e);
continue;
}
node.setProcessDefinition(processDefinition);
// check for duplicate start-states
if ((node instanceof StartState) && (processDefinition.getStartState() != null))
{
addError("max one start-state allowed in a process");
}
else
{
// read the common node parts of the element
readNode(nodeElement, node, nodeCollection);
// if the node is parsable
// (meaning: if the node has special configuration to parse, other then the
// common node data)
node.read(nodeElement, this);
}
}
}
}