I used the following code to import an XMI file as a Baseline. The used ZIP file is the result of the extracting the bin data of t_document.
But know I have the same behavior as Arshad posted.
Does someone managed to import XMI programmatically?
Sub createBaseline()
Dim eaConn As New EAConnector
Dim baselinePackGUID As String
Dim docGUID As String
Dim baselineVersion As String
Dim baselineName As String
Dim baselineNotes As String
Dim baselineContent() As Byte
Dim insertSql As String
Dim strFilePath As String
Dim objStream As New ADODB.Stream
Const adTypeBinary = 1
baselinePackGUID = "{CFABA5B2-D733-4b80-B761-EECDCA09BB45}"
baselineVersion = "1.0.1"
baselineName = "Merge Test"
baselineNotes = "Notes of the Baseline"
strFilePath = "C:\temp\zip\txt.zip" 'This is the path to the file on disk.
'Set objStream = CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeBinary
objStream.LoadFromFile strFilePath
baselineContent = objStream.Read
docGUID = generateEA_GUID
insertSql = "INSERT INTO t_document " & _
"(DocID, DocName, ElementID, Version, Notes, BinContent, DocDate, ElementType, DocType,Style,isActive)" & _
" VALUES ('" & docGUID & "','" & _
baselineName & "','" & _
baselinePackGUID & "','" & _
baselineVersion & "','" & _
baselineNotes & "','" & _
EncodeBase64(baselineContent) & "'," & _
"Now(),'" & _
"Package','Baseline','Zip=1;',0)"
Debug.Print (insertSql)
Call eaConn.getRepository.Execute(insertSql)
objStream.Close
End Sub 'createBaseline