if (activityBinding == null) {
log.debug("unrecognized activity: " + tagName);
continue;
}
ActivityImpl activity = compositeElement.createActivity();
parse.pushObject(activity);
try {
activity.setType(activityBinding.getTagName());
activityBinding.parseName(nestedElement, activity, parse);
parseTransitions(nestedElement, activity, parse);
Element descriptionElement = XmlUtil.element(documentElement, "description");
if (descriptionElement!=null) {
String description = XmlUtil.getContentText(descriptionElement);
activity.setDescription(description);
}
String continuationText = XmlUtil.attribute(nestedElement, "continue");
if (continuationText!=null) {
if ("async".equals(continuationText)) {
activity.setContinuation(Continuation.ASYNCHRONOUS);
} else if ("exclusive".equals(continuationText)) {
activity.setContinuation(Continuation.EXCLUSIVE);
}
}
ActivityBehaviour activityBehaviour = (ActivityBehaviour) activityBinding.parse(nestedElement, parse, this);
activity.setBehaviour(activityBehaviour);
parseOnEvents(nestedElement, parse, activity);
String g = XmlUtil.attribute(nestedElement, "g");
if (g == null) continue;
StringTokenizer stringTokenizer = new StringTokenizer(g, ",");
ActivityCoordinatesImpl coordinates = null;
if (stringTokenizer.countTokens() == 4) {
try {
int x = Integer.parseInt(stringTokenizer.nextToken());
int y = Integer.parseInt(stringTokenizer.nextToken());
int width = Integer.parseInt(stringTokenizer.nextToken());
int height = Integer.parseInt(stringTokenizer.nextToken());
coordinates = new ActivityCoordinatesImpl(x, y, width, height);
} catch (NumberFormatException e) {
coordinates = null;
}
}
if (coordinates != null) {
activity.setCoordinates(coordinates);
} else {
parse.addProblem("invalid coordinates g=\"" + g + "\" in " + activity, nestedElement);
}
} finally {
parse.popObject();