NodeList startStates = document.getElementsByTagName(START_STATE_NODE);
if (startStates.getLength() == 1) {
Node node = startStates.item(0);
StartState startState = create(node, definition);
String swimlaneName = getAttribute(node, SWIMLANE_NODE);
Swimlane swimlane = definition.getSwimlaneByName(swimlaneName);
startState.setSwimlane(swimlane);
}
NodeList states = document.getElementsByTagName(STATE_NODE);
for (int i = 0; i < states.getLength(); i++) {
Node node = states.item(i);
NodeList nodeList = node.getChildNodes();
int transitionsCount = 0;
boolean hasTimeOutTransition = false;
for (int j = 0; j < nodeList.getLength(); j++) {
Node childNode = nodeList.item(j);
if (TRANSITION_NODE.equals(childNode.getNodeName())) {
String transitionName = getAttribute(childNode, NAME_ATTR);
if (PluginConstants.TIMER_TRANSITION_NAME.equals(transitionName)) {
hasTimeOutTransition = true;
}
transitionsCount++;
}
}
GraphElement state;
if (transitionsCount == 1 && hasTimeOutTransition) {
state = create(node, definition, "waitState");
} else {
state = create(node, definition);
}
for (int j = 0; j < nodeList.getLength(); j++) {
Node childNode = nodeList.item(j);
if (ASSIGNMENT_NODE.equals(childNode.getNodeName()) && state instanceof TimerState) {
String swimlaneName = getAttribute(childNode, SWIMLANE_NODE);
Swimlane swimlane = definition.getSwimlaneByName(swimlaneName);
((TimerState) state).setSwimlane(swimlane);
String assignmentType = getAttribute(childNode, ASSIGNMENT_NODE);
((TimerState) state).setReassignmentEnabled(assignmentType != null && "reassign".equals(assignmentType));
}
if (TIMER_NODE.equals(childNode.getNodeName())) {