I have about 50,000 Idw's files that will need to be updated and checked into the vault. The sample working but it is slow. Can I batch the checking. if so how ( Code Sample )?
'My very slow loop check-in
Public Sub oVDFSample(ByVal oFileNameListWOEXT As List(Of String), connection As VDF.Vault.Currency.Connections.Connection)
For Each FileName As String In oFileNameListWOEXT
Dim oFileIteration As VDF.Vault.Currency.Entities.FileIteration = getFileIteration(FileName & ".idw", connection)
If oFileIteration Is Nothing Then
'VDF.Vault.Library.ConnectionManager.LogOut(connection)
MessageBox.Show("Unable to get FileIteration object, is the name of the file you are trying to check in correct?")
Return
End If
Dim fldrPath As Autodesk.DataManagement.Client.Framework.Currency.FolderPathAbsolute = connection.WorkingFoldersManager.GetWorkingFolder(oFileIteration)
Dim filePath As String = Path.Combine(fldrPath.ToString(), oFileIteration.EntityName)
Dim filePathAbs As VDF.Currency.FilePathAbsolute = New VDF.Currency.FilePathAbsolute(filePath)
Try
If oFileIteration.IsCheckedOut = True Then
Dim myFileRelationshipSettings As VDF.Vault.Settings.FileRelationshipGatheringSettings '.IFileRelationshipGatheringSettingsReadOnly
myFileRelationshipSettings = New VDF.Vault.Settings.FileRelationshipGatheringSettings
myFileRelationshipSettings.IncludeChildren = True
myFileRelationshipSettings.IncludeAttachments = True
Dim myColOfFileAssocLite As System.Collections.Generic.IEnumerable(Of ACW.FileAssocLite) = Nothing
myColOfFileAssocLite = connection.FileManager.GetFileAssociationLites(New Long() {oFileIteration.EntityIterationId}, myFileRelationshipSettings)
' Going to add new FileAssocParam object to this list
Dim fileAssocLiteParams As ArrayList = New ArrayList
' ArrayList to contain FileAssocParam objects
Dim fileAssocParams As ArrayList = New ArrayList
' Add FileAssocParam objects to the ArrayList
' using values from the collection of FileAssocLite in the
' collection returned from GetFileAssociationLites()
If Not myColOfFileAssocLite Is Nothing Then
Dim myFileAssocLite As FileAssocLite
' 'Go through each FileAssoc in the FilleAssocs in the collection of FileAssocLite
For Each myFileAssocLite In myColOfFileAssocLite
' This is a new FileAssocParam that is going to be added to the ArrayList
' getting the properties from the FileAssocLite
Dim par As FileAssocParam = New FileAssocParam()
par.CldFileId = myFileAssocLite.CldFileId
par.RefId = myFileAssocLite.RefId
par.Source = myFileAssocLite.Source
par.Typ = myFileAssocLite.Typ
par.ExpectedVaultPath = myFileAssocLite.ExpectedVaultPath
fileAssocParams.Add(par)
Next
End If
' and the new file
Dim myFileAssocParamArray As FileAssocParam() = DirectCast(fileAssocParams.ToArray(GetType(FileAssocParam)), FileAssocParam())
connection.FileManager.CheckinFile(oFileIteration, "CodeVauleUpdate", False, myFileAssocParamArray,
Nothing, False, Nothing,
ACW.FileClassification.None, False, filePathAbs)
End If
Catch ex As Exception
Debug.Print(ex.ToString)
connection.FileManager.UndoCheckoutFile(oFileIteration, filePathAbs)
End Try
Next
End Sub
Batch Check in's are painfully slow for all releases> Any time i have to deal with multiple files and checkout-checking I create automation and run it directly on the server.