public Object parse(Element element, Parse parse, BpmnParser bpmnParser) {
ActivityImpl startActivity = parse.contextStackFind(ActivityImpl.class);
BpmnProcessDefinition processDefinition = parse.contextStackFind(BpmnProcessDefinition.class);
if (processDefinition.getInitial()==null) {
processDefinition.setInitial(startActivity);
} else if (startActivity.getParentActivity()==null) {
parse.addProblem("multiple start events not yet supported", element);
}
String id = XmlUtil.attribute(element, "id", parse);
Element eventDefinition = XmlUtil.element(element);
if (eventDefinition != null && "timerEventDefinition".equals(eventDefinition.getNodeName())) {
return createTimerStartEvent(processDefinition, eventDefinition, id, bpmnParser, parse);
} else if (eventDefinition != null){
parse.addProblem("Invalid eventDefinition type : " + eventDefinition.getNodeName());
}
return new NoneStartEventActivity();
}