// create all the node copies for each compound transition
for(List<TCGTransition> compoundTransition : colCompoundTransitions) {
Map<TCGNode, TCGNode> colOriginalToCopy = new LinkedHashMap<TCGNode, TCGNode>();
for(TCGTransition oCurrentTransition : compoundTransition) {
TCGNode oNodeToDuplicate = oCurrentTransition.getTargetNode();
// mark the visited target node
colDispensableNodes.add(oNodeToDuplicate);
// create a copy of the referenced target node
TCGNode oCopy = TCGNodeHelperClass.copyNodeWithoutTransitions(
m_oTCGHelper, oNodeToDuplicate);
colOriginalToCopy.put(oNodeToDuplicate, oCopy);
if(!oNodeToDuplicate.equals(in_oIntNode) &&
in_colOtherDecisionNodes.contains(oNodeToDuplicate) &&
oCopy instanceof TCGIntermediateNode) {
in_colOtherDecisionNodes.add((TCGIntermediateNode)oCopy);
}
}
colCompoundTransitionNodeCopies.add(colOriginalToCopy);
// collect all the transitions to create copies for
List<TCGTransition> colMarkedTransitions = new ArrayList<TCGTransition>();
colTransitionsMarkedToCopy.put(colOriginalToCopy, colMarkedTransitions);
// mark all transitions of the compound transition
colTransitionsMarkedToCopy.get(colOriginalToCopy).addAll(compoundTransition);
// if the set of incoming transitions does not contain a transition of the
// found compound transition - then add all outgoing transitions
for(TCGNode oOriginalNode : colOriginalToCopy.keySet()) {
boolean bContainsElementOfCompound = false;
for(TCGTransition oOutgoingTransition : oOriginalNode.getOutgoingTransitions()) {
if(compoundTransition.contains(oOutgoingTransition))
bContainsElementOfCompound = true;
}
if(bContainsElementOfCompound == false)
colTransitionsMarkedToCopy.get(colOriginalToCopy).addAll(
oOriginalNode.getOutgoingTransitions());
// for(TCGTransition oIncomingTransition : oOriginalNode.getIncomingTransitions()) {
// colTransitionsMarkedToCopy.get(colOriginalToCopy).add(oIncomingTransition);
// }
}
}
// create the transition copies
for(Map<TCGNode, TCGNode> colOriginalToCopy : colCompoundTransitionNodeCopies) {
for(TCGNode oOriginalNode : colOriginalToCopy.keySet()) {
// copy all outgoing transitions
for(TCGTransition oOutgoingTransition : oOriginalNode.getOutgoingTransitions()) {
if(colTransitionsMarkedToCopy.get(colOriginalToCopy).contains(oOutgoingTransition)) {
TCGNode oTargetNode = colOriginalToCopy.get(oOutgoingTransition.getTargetNode());
if(oTargetNode == null)
oTargetNode = oOutgoingTransition.getTargetNode();
TCGTransitionHelperClass.copyTransitionValuesToNewTransition(
m_oTCGHelper, oOutgoingTransition,
colOriginalToCopy.get(oOriginalNode), oTargetNode);