// handle state invariants
addStateInvariant((State)oVertex, oTCGRealNode,
Configuration.getSplitInequationsBeforeTestGoalDefinition());
// copy also states from composite states and submachine states
State oState = (State)oVertex;
if(!oState.getRegions().isEmpty())
{
oTCGRealNode.setSubGraph(GeneratedFactory.eINSTANCE.createTestCaseGraph());
oTCGRealNode.getSubGraph().setCompositeSuperState(oTCGRealNode);
for(Region oRegion : oState.getRegions())
{
copyAllStatesForRegion(oRegion, oTCGRealNode.getSubGraph().getRegions(),
io_colStateMachineRegions, io_colSubmachineMapping);
}
copyAllConnectionPointsAndReferences(oState, oTCGRealNode);
} else if(oState.getSubmachine() != null)
{
// was the submachine already copied? Then just reference it.
TestCaseGraph oReferencedTCG = io_colSubmachineMapping.get(oState.getSubmachine());
if(oReferencedTCG != null)
{
oTCGRealNode.setSubGraph(oReferencedTCG);
// oReferencedTCG.getSuperStates().add(oTCGNode);
oReferencedTCG.setCompositeSuperState(oTCGRealNode);
copyAllConnectionPointsAndReferences(oState, oTCGRealNode);
} else
{
oTCGRealNode.setSubGraph(GeneratedFactory.eINSTANCE.createTestCaseGraph());
// oTCGNode.getSubGraph().getSuperStates().add(oTCGNode);
oTCGRealNode.getSubGraph().setCompositeSuperState(oTCGRealNode);
io_colSubmachineMapping.put(oState.getSubmachine(), oTCGRealNode.getSubGraph());
copyAllConnectionPoints(oState.getSubmachine(), oTCGRealNode.getSubGraph());
copyAllConnectionPointsAndReferences(oState, oTCGRealNode);
for(Region oRegion : oState.getSubmachine().getRegions())
{
copyAllStatesForRegion(oRegion, oTCGRealNode.getSubGraph().getRegions(),
io_colStateMachineRegions, io_colSubmachineMapping);
}
}