if (activity.getOutgoingTransitions().size()==0) {
// TODO: double check if this is valid (I think in Activiti yes, since we need start events we will need an end event as well)
addError("Exclusive Gateway '" + activity.getId() + "' has no outgoing sequence flows.", null);
} else if (activity.getOutgoingTransitions().size()==1) {
PvmTransition flow = activity.getOutgoingTransitions().get(0);
Condition condition = (Condition) flow.getProperty(BpmnParse.PROPERTYNAME_CONDITION);
if (condition!=null) {
addError("Exclusive Gateway '" + activity.getId() + "' has only one outgoing sequence flow ('" + flow.getId() + "'). This is not allowed to have a condition.", null);
}
} else {
String defaultSequenceFlow = (String) activity.getProperty("default");
boolean hasDefaultFlow = defaultSequenceFlow!=null && defaultSequenceFlow.length()>0;
ArrayList<PvmTransition> flowsWithoutCondition = new ArrayList<PvmTransition>();
for (PvmTransition flow : activity.getOutgoingTransitions()) {
Condition condition = (Condition) flow.getProperty(BpmnParse.PROPERTYNAME_CONDITION);
boolean isDefaultFlow = flow.getId()!=null && flow.getId().equals(defaultSequenceFlow);
boolean hasConditon = condition!=null;
if (!hasConditon && !isDefaultFlow) {
flowsWithoutCondition.add(flow);