parent.setDone(true);
}
if (parent != null && parent.isRegion()) {
//3.4 we got a region, which is finalized
//let's check its siblings too
Parallel p = (Parallel) parent.getParent();
int finCount = 0;
int pCount = p.getStates().size();
for (Iterator regions = p.getStates().iterator();
regions.hasNext();) {
State reg = (State) regions.next();
if (reg.isDone()) {
finCount++;
}
}
if (finCount == pCount) {
te = new TriggerEvent(p.getId() + ".done",
TriggerEvent.CHANGE_EVENT);
internalEvents.add(te);
te = new TriggerEvent(p.getParent().getId()
+ ".done", TriggerEvent.CHANGE_EVENT);
internalEvents.add(te);
//this is not in the specs, but is makes sense
p.getParentState().setDone(true);
}
}
}
}
}