remove transformation profile member by an import

Pawel
New Contributor II

Dear coleagues, 

when I need to change transformation group within multiple transformation profiles I wanted to export XML file, do the change and then reupload it. Unfortunatelly it add new group but does not remove the old one. I guess the merge approach it to blame. 

Do you know a way how to do this excersise in more sophisticated way than running a clicking derby?

Thanks for help!

4 REPLIES 4

JJones
New Contributor III

Pawel,

You should be able to modify an existing transformation rule group via XML and load it in without it creating a new group.  Within the GolfStream application as an example, I exported out the HoustonAccounts transformation rule group to XML and saved it to my desktop.  I then edited the XML in a text editor and added a new Mask rule to the file and saved it.  I then imported the XML back into the application and then went to Account Dimensions > HoustonAccounts Group > Mask and see the new transformation rule that was added to the group.  That change then flows to the profiles that the group is included within.  

JJones
New Contributor III

If you are looking to do multiple removals from the Rule Group via XML Load/Extract, it will not remove any rules with the import/export process, it is simply to add/modify rules that are in the group.

Pawel
New Contributor II

Hi JJ, 

What we have in our application is list of various Tranformation Groups of the same dimension for different purposes. And we also have more than a few transformation profiles specific for different purpose and subsidiary. The problem is, I need to swich one group for another in many profiles. I was hoping this can be done in some automated manner (I am not lazy, I want to be super efficient 😉 ).

I tried to play around with the XML file like using action="Delete" with no effect. I also found some procedures in BRApi.Import.Metadata but no description of how to work with that. So I was hoping somebody already know.

Best!

Pavel

Pawel
New Contributor II

It turned out it is not possible by an export/import but there is a way by stepping in the application database.

 

 

''' query to delete specific TR Group from TR Profiles

Dim trGroupName As String = "FW_1000_COMMON"
Dim trProfName 	As String = "___/_TB/_LOAD"

Dim querry As String = $"

	delete rpm
	
	from StageRuleProfiles rp
		join StageRuleProfileMembers rpm on rpm.[RuleProfileKey] = rp.[UniqueID]
		join StageRuleGroups rg on rpm.[RuleGroupKey] = rg.[UniqueID]
	
	where 1=1
		and rp.[RuleProfileName] like '{trProfName}' escape '/'
		and rg.[RuleGroupName] = '{trGroupName}'
"

'Return the DataTable
Using dbConnApp As DBConnInfo = BRAPi.Database.CreateApplicationDbConnInfo(si)
	Return BRAPi.Database.ExecuteSql(dbConnApp, querry, False)			
End Using