private void replaceFinalStatesWithConnectionPointsInRegion(
TestCaseRegion in_oRegion) {
for(TCGNode oNode : in_oRegion.getNodes()) {
if(oNode instanceof TCGRealNode) {
TCGRealNode oRealNode = (TCGRealNode)oNode;
List<TCGTransition> colSuperTransitions =
TCGTransitionHelperClass.getDefaultTriggeredOutgoingTransitions(oNode);
TestCaseGraph oSubGraph = oRealNode.getSubGraph();
if(oSubGraph != null) {
// check all sub-regions
// TODO parallel sub-regions!!!
if(!oSubGraph.getRegions().isEmpty()) {
TestCaseRegion oSubRegion = oSubGraph.getRegions().get(0);
if(!colSuperTransitions.isEmpty()) {
List<TCGNode> colEndNodes = TCGRegionHelperClass.findNodesWithOutOutgoingTransitions(oSubRegion);
// create outgoing connection point
TCGIntermediateNode oOutNode = GeneratedFactory.eINSTANCE.createTCGIntermediateNode();
oOutNode.setOriginalNode(null);
oOutNode.setUseAllTransitionsInParallel(true);
oRealNode.getContainedConnectionPoints().add(oOutNode);
oOutNode.setContainer(oRealNode);
// create additional connection to outgoing node
for(TCGNode oEndNode : colEndNodes) {
try {
addTransition(oEndNode, oOutNode);
} catch (Exception e) {
Configuration.handleException(e);
}
}
// redirect outgoing transitions of super node without triggers
for(TCGTransition oSuperTransition : colSuperTransitions) {
oSuperTransition.setSourceNode(oOutNode);
oRealNode.getOutgoingTransitions().remove(oSuperTransition);
}
}
// recursion
replaceFinalStatesWithConnectionPointsInRegion(oSubRegion);
}