}
//find tChildObject
EObjectTraceLinkReturnContainer tChildETLRC = findTObject(tiChild);
EObject tChild =tChildETLRC.getTObject();
IContext tChildContext = tChildETLRC.getTraceLink().getStaticContext();
// Remove trace link
modelCorrespondence.remove(tChildETLRC.getTraceLink());
List<EObject> tParentChildren = template.getChildrenFrom(tParent, tParent2ChildRef, tChildContext);
//Element in Element
if(tParentChildren.contains(tChild)){
template.removeChildFrom(tParent, tParent2ChildRef, tChild, tChildContext);
log.debug("Removed element "+Util.getFullName(tChild)+" from element " + Util.getFullName(tParent));
// checkWhetherAnIfBecameValidAgain(tParent,tObjectETLRC.getTraceLink().getStaticContext());
return;
}
//Sometimes tObject is NOT parent of tChild! (for and if)
ReferenceFromParent tChildParent2tChildRef = template.getParentFrom(tChild, tChildContext);
EObject tChildParent = tChildParent2tChildRef.getParent();
//FOR-LOOP
if(TForLoop.isTForLoop(tChildParent)){
TForLoop forLoop = new TForLoop(tChildParent, tChildContext, template);
List<EObject> loopBody= template.getChildrenFrom(
forLoop.getTElement(), forLoop.getOLReference(), tChildContext);
//TODO implement the following
// if(decisionMaker.onlyFilterOutInputElementAndDoNotDelete(tChild)){
// throw new SynchronizingException("Handle filter out - Not yet implemented.");
// }
if(loopBody.size()>1){
//Remove element when more elements are in bodyVersion
template.removeChildFrom(
forLoop.getTElement(), forLoop.getOLReference(), tChild, tChildContext);
log.debug("Removed tChild "+Util.getFullName(tChild)+
" from for-Loop body: " + Util.getFullName(forLoop.getTElement()));
} else if(loopBody.size()==1){
//Remove parameter element when only one element is in bodyVersion
EObject inputModelElement = tChildContext.getVariableValue(forLoop.getName());
parameterModelHandler.removeElement(inputModelElement,
forLoop.getSetToBeIterated().getReferenceFromParent());
log.debug("Removed parameterElement in for-Loop: " + Util.getFullName(forLoop.getTElement()) + " Element: " + Util.getFullName(inputModelElement));