# WBTS17 to SBTS17 migration: MRBTS product

#NIDD_VER: SBTS17_1701_002_00
# History
# v0.1 14.12.2016 Iosif SMEU: first draft for new CUTool

# define global constants
define "operation" "create"
define "version" "SBTS17_1701_002"
define "adaptation" "com.nokia.srbts"

# abort rule-set in case of unexpected SCF version

if ( objects_count "WBTS/MRBTS" ) == 0 abort_file

for_objects "WBTS/MRBTS"
	define "oldMrbtsDn" $current_dist_name
if not ( get_version oldMrbtsDn ) == "WBTS17" 
	abort_file

# new MRBTS MOI set-up based on old MRBTS MOI
for_objects "WBTS/MRBTS"
	begin
		# create new MOI by copy from the old one
		define "newMrbtsId" $current_MRBTS
		for_objects "MRBTS/BTSSCW"
			if ( param_exist $current_dist_name "btsConfiguration" )
				if ( get_param $current_dist_name "btsConfiguration" ) >= 0 && ( get_param $current_dist_name "btsConfiguration" ) <= 1048575
					define "newMrbtsId" get_param $current_dist_name "btsConfiguration"
		define "newMrbtsDn" "MRBTS-" JOIN newMrbtsId
		copy_object oldMrbtsDn newMrbtsDn
		set_operation newMrbtsDn operation
		set_version newMrbtsDn version
		set_adaptation newMrbtsDn adaptation
		# add new (mandatory) parameters
		for_objects "BTSSCW"
			add_param newMrbtsDn "btsName" get_param $current_dist_name "btsName"
		# remove not applicable parameters
		if param_exist newMrbtsDn "actCoreDumpFileCollection" del_param newMrbtsDn "actCoreDumpFileCollection"
		if param_exist newMrbtsDn "actSwMonitoring" del_param newMrbtsDn "actSwMonitoring"
		if param_exist newMrbtsDn "enAutoLicReq" del_param newMrbtsDn "enAutoLicReq"
		if param_exist newMrbtsDn "passUnitList" del_param newMrbtsDn "passUnitList"
		if param_exist newMrbtsDn "resetToTestDedicated" del_param newMrbtsDn "resetToTestDedicated"
		if param_exist newMrbtsDn "sharedRfTechnologies" del_param newMrbtsDn "sharedRfTechnologies"
		if param_exist newMrbtsDn "symptomDataTriggerL" del_param newMrbtsDn "symptomDataTriggerL"
		if param_exist newMrbtsDn "timeZone" del_param newMrbtsDn "timeZone"
		if param_exist newMrbtsDn "troubleshootingDataCollectionTrigger" del_param newMrbtsDn "troubleshootingDataCollectionTrigger"
		if param_exist newMrbtsDn "unitList" del_param newMrbtsDn "unitList"
		# remove set-by-system parameters
		if param_exist newMrbtsDn "autoConfBlocked" del_param newMrbtsDn "autoConfBlocked"
		if param_exist newMrbtsDn "commissioningRequired" del_param newMrbtsDn "commissioningRequired"
	end
