I see no reliable way to document the source of a model that's been reverse engineered.
At minimum the server instance and database used in the merge operation need to be stored in the model but I can neither retrieve them directly from the MergeModelObject nor specify them explicitly TO the MergeModelObject. This leaves me with no reliable way to insure data in the model matches the values used in the merge operation without reading the .cmo file which I'm loathe to do using string operations.
The Microsoft DOM offers an easy way to do this. It works for VBA. Not sure if everyone tried to use it under ER Studio macros.
That does work. Naturally it's not terribly intuitive how to make it work though because this particular XML contains DTD and apparently DTDs pose a security risk and the docs don't make it obvious how to get around the roadblocks.
Nevertheless after adding the reference named "MicrosoftXML, v6.0 (6.0)" this code worked.
Dim XmlDoc As MSXML2.DOMDocument60
Dim Server As String
Dim DbName As String
Set XmlDoc = New MSXML2.DOMDocument60
If Not XmlDoc.load(CompareParamFullname) Then MsgBox XmlDoc.parseError.reason ReturnEnd IfServer = XmlDoc.selectSingleNode("/ERStudioCompareMergeWizard/CStringVariables/@m_DbServerString").Text DbName = XmlDoc.selectSingleNode("/ERStudioCompareMergeWizard/CStringVariables/@m_csDatabase").Text
Above, CompareParamFullname is the fully qualified filename of the .cmo file I will be passing to the compare and merge utility. This ensures my model comments can contain the actual values used when the model gets updated.