*/
public void parseEndEvents(Element parentElement, ScopeImpl scope) {
for (Element endEventElement : parentElement.elements("endEvent")) {
ActivityImpl activity = createActivityOnScope(endEventElement, scope);
Element errorEventDefinition = endEventElement.element("errorEventDefinition");
Element cancelEventDefinition = endEventElement.element("cancelEventDefinition");
Element terminateEventDefinition = endEventElement.element("terminateEventDefinition");
Element messageEventDefinitionElement = endEventElement.element("messageEventDefinition");
Element signalEventDefinition = endEventElement.element("signalEventDefinition");
if (errorEventDefinition != null) { // error end event
String errorRef = errorEventDefinition.attribute("errorRef");
if (errorRef == null || "".equals(errorRef)) {
addError("'errorRef' attribute is mandatory on error end event", errorEventDefinition);
} else {