scInstance.setDone(parent, 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.getChildren().size();
for (Iterator regions = p.getChildren().iterator();
regions.hasNext();) {
State reg = (State) regions.next();
if (scInstance.isDone(reg)) {
finCount++;
}
}
if (finCount == pCount) {
te = new TriggerEvent(p.getId() + ".done",
TriggerEvent.CHANGE_EVENT);
internalEvents.add(te);
scInstance.setDone(p, true);
if (stateMachine.isLegacy()) {
te = new TriggerEvent(p.getParent().getId()
+ ".done", TriggerEvent.CHANGE_EVENT);
internalEvents.add(te);
//this is not in the specs, but is makes sense
scInstance.setDone(p.getParentState(), true);
}
}
}
}
}