#**##parse( "jmi/default:storyPattern/link/import.vm" )
#**#
#**###reference
#**##set( $linkClassName = $link.InstanceOf.Class.Name)
#**#
#**###ordered
#**##if($range)
#*   *##set( $rangeIsInteger = $mofutility.isInteger($range))
#**##end
#**#
#**###---------
#**###QUALIFIER
#**##if($role.Qualifier)
#*   *##set($qualifier = $role.Qualifier)
#*   *##set($name = $targetName)
#*   *##set($testOrdered = $mofutility.isOrdered($role))
#**##else
#*   *##set($qualifier = $partnerRole.Qualifier)
#*   *##set($name = $sourceName)
#*   *##set($testOrdered = $mofutility.isOrdered($partnerRole))
#**##end
#**##if( $qualifier && $range)
#*   *##if( $testOrdered && $rangeIsInteger)
#*      *##set( $removeQualified = false)
#*   *##else
#*      *##set( $removeQualified = true)
#*      *##set( $valueOfQualifier = $range)
#*      *##set( $attrName = $mofutility.upFirstChar($qualifier.Name))
#*   *##end
#**##end
#**###--------------
#**#
#**#// destroy link
#**###----------
#**### TO ONE
#**##if ($toOne)
#*   *#
#*   *#	## REFERENCE TO ONE
#*   *#	#if($linkClassName.equals("de.tu_darmstadt.fujaba.mof.adapter.FMAOpposite"))
#*      *#		${sourceName}.set${targetRoleName}(null);
#*   *#	#else
#*      *#	
#*      *#	## ASSOCIATION TO ONE
#*      *#		#if($ref)
#*         *#			#set( $targetName = "null" )
#*         *#			${sourceName}.set${targetRoleName}($targetName);
#*      *#		#else
#*         *#			#if($role == $role.Assoc.RightRole)
#*            *#				${getX1}"${getXparameter}"))).remove($sourceName, $targetName);
#*         *#			#else
#*            *#				${getX1}"${getXparameter}"))).remove($targetName, $sourceName);
#*         *#			#end
#*      *#		#end
#*   *#	#end
#**##else
#*   *###--------
#*   *### TO MANY
#*   *#
#*   *#	## REFERENCE TO MANY
#*   *#	#if($linkClassName.equals("de.tu_darmstadt.fujaba.mof.adapter.FMAOpposite"))
#*      *#	// reference to many
#*      *#		${sourceName}.get${targetRoleName}().remove(${targetName});
#*   *#	#else
#*      *#	
#*      *#	## ASSOCIATION TO MANY
#*      *#		#if($rangeIsInteger && $ordered)
#*         *#			try{
#*      *#			if(#if($ref)${getX}#else${getX1}"${getXparameter}"${getX2}#end.get($range) == $targetName){
#*      *#		#end
#*      *#		#if($qualifier)
#*         *#		${getX1}"${getXparameter}"))).remove##
#*         *#			#if($role == $role.Assoc.RightRole)
#*            *#				($sourceName, $targetName);
#*         *#			#else
#*            *#				($targetName, $sourceName);
#*         *#			#end
#*         *#			
#*         *#		
#*         *#		
#*      *#		#else
#*      *#		${getX1}"${getXparameter}"${getX2}.remove(#if($rangeIsInteger && $ordered)$range #else $targetName #end);
#*      *#		#end
#*      *#		#if($rangeIsInteger && $ordered)
#*         *#			}
#*         *#			}
#*         *#			catch(IndexOutOfBoundsException e){}
#*      *#		#end		
#*   *#	#end
#**##end