TriggerEvent te = new TriggerEvent(tt.getId() + ".entry",
TriggerEvent.CHANGE_EVENT);
internalEvents.add(te);
//3.2.1 and 3.4 (.done events)
if (tt instanceof State) {
State ts = (State) tt;
if (ts.getIsFinal()) {
State parent = (State) ts.getParent();
String prefix = "";
if (parent != null) {
prefix = parent.getId();
}
te = new TriggerEvent(prefix + ".done",
TriggerEvent.CHANGE_EVENT);
internalEvents.add(te);
if (parent != null) {
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",