}
private void replaceInitialNodesWithConnectionPointsInRegion(TestCaseRegion in_oRegion) {
for(TCGNode oNode : in_oRegion.getNodes()) {
if(oNode instanceof TCGRealNode) {
TCGRealNode oRealNode = (TCGRealNode)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);
List<TCGIntermediateNode> colInitialNodes = TCGRegionHelperClass.findInitialNodes(oSubRegion);
if(!colInitialNodes.isEmpty()) {
// each region is allowed to have at most one initial node
TCGIntermediateNode oInitialNode = colInitialNodes.get(0);
// convert initial node into connection point
oInitialNode.setNodeType(TCGNodeType.ENTRY);
oInitialNode.setContainer(oRealNode);
oRealNode.getContainedConnectionPoints().add(oInitialNode);
oInitialNode.setOriginalNode(null);
oInitialNode.setUseAllTransitionsInParallel(true);
// outgoing transitions are the same ...
// change all incoming transitions of the composite state
for(TCGTransition oTransition : oRealNode.getIncomingTransitions()) {
oTransition.setTargetNode(oInitialNode);
oInitialNode.getIncomingTransitions().add(oTransition);
}
oRealNode.getIncomingTransitions().clear();
}
// recursion
replaceInitialNodesWithConnectionPointsInRegion(oSubRegion);
}
}