NodeList stateChilds = node.getChildNodes();
for (int j = 0; j < stateChilds.getLength(); j++) {
Node stateNodeChild = stateChilds.item(j);
if (TASK_NODE.equals(stateNodeChild.getNodeName())) {
String swimlaneName = getAttribute(stateNodeChild, SWIMLANE_NODE);
Swimlane swimlane = definition.getSwimlaneByName(swimlaneName);
startState.setSwimlane(swimlane);
}
}
}
NodeList actionNodeNodes = document.getElementsByTagName(ACTION_NODE_NODE);
for (int i = 0; i < actionNodeNodes.getLength(); i++) {
Node node = actionNodeNodes.item(i);
ActionNode actionNode = create(node, definition);
NodeList aaa = node.getChildNodes();
for (int k = 0; k < aaa.getLength(); k++) {
Node a = aaa.item(k);
if (EVENT_NODE.equals(a.getNodeName())) {
String eventType = getAttribute(a, "type");
NodeList actionNodes = a.getChildNodes();
for (int l = 0; l < actionNodes.getLength(); l++) {
Node aa = actionNodes.item(l);
if (ACTION_NODE.equals(aa.getNodeName())) {
parseAction(aa, actionNode, eventType);
}
}
}
}
}
NodeList states = document.getElementsByTagName(TASK_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);
}
// TODO use SAX parser instead
NodeList stateChilds = node.getChildNodes();
for (int j = 0; j < stateChilds.getLength(); j++) {
Node stateNodeChild = stateChilds.item(j);
if (TASK_NODE.equals(stateNodeChild.getNodeName())) {
String swimlaneName = getAttribute(stateNodeChild, SWIMLANE_NODE);
if (swimlaneName != null && state instanceof SwimlanedNode) {
Swimlane swimlane = definition.getSwimlaneByName(swimlaneName);
((SwimlanedNode) state).setSwimlane(swimlane);
String reassign = getAttribute(stateNodeChild, REASSIGN_ATTR);
if (reassign != null) {
boolean forceReassign = Boolean.parseBoolean(reassign);
((State) state).setReassignmentEnabled(forceReassign);