[genmodel.fsm] Fix computation of hierarchical outgoing links

Bug 571591

Change-Id: I2b93f5bac92b6e03ab90b2afc75fb31ef9aeff49
diff --git a/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenExtensions.xtend b/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenExtensions.xtend
index 7fa9718..f561eee 100644
--- a/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenExtensions.xtend
+++ b/plugins/org.eclipse.etrice.core.genmodel.fsm/src/org/eclipse/etrice/core/genmodel/fsm/FsmGenExtensions.xtend
@@ -193,10 +193,10 @@
 		var current = s
 		while (current!==null) {
 			// outgoing transitions of the state
-			result.addAll(s.outgoing)
+			result.addAll(current.outgoing)
 			
 			// outgoing transitions of the transition points of the same level
-			result.addAll(s.graph.transitionPointNodes.map[outgoing].flatten)
+			result.addAll(current.graph.transitionPointNodes.map[outgoing].flatten)
 			
 			// ascend to the parent state (iff)
 			current = current.getParentState