WINDREAM CheckFileExistsinWM falsches Log

This commit is contained in:
SchreiberM 2024-01-05 08:23:04 +01:00
parent 8da8bd18a7
commit 0810983f86
2 changed files with 18 additions and 10 deletions

View File

@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' übernehmen, indem Sie "*" eingeben: ' übernehmen, indem Sie "*" eingeben:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("1.9.3.0")> <Assembly: AssemblyVersion("1.9.4.0")>
<Assembly: AssemblyFileVersion("1.9.3.0")> <Assembly: AssemblyFileVersion("1.9.4.0")>

View File

@ -116,6 +116,7 @@ Public Class Windream
Public ReadOnly Property UsesDriveLetter As Boolean = True Public ReadOnly Property UsesDriveLetter As Boolean = True
Public Property NewDocumentID As Int32 = 0 Public Property NewDocumentID As Int32 = 0
Public Property CurrentWMObject As IWMObject6
''' <returns>A list of object types that are available</returns> ''' <returns>A list of object types that are available</returns>
Public ReadOnly Property ObjectTypes As List(Of String) Public ReadOnly Property ObjectTypes As List(Of String)
@ -256,7 +257,7 @@ Public Class Windream
oWMObject = Session.GetWMObjectByPath(WMEntityDocument, pPath) oWMObject = Session.GetWMObjectByPath(WMEntityDocument, pPath)
Return True Return True
Catch ex As Exception Catch ex As Exception
_logger.Info($"Unexpected Error in windream.GetFileByPath: {ex.Message}") _logger.Info($"Unexpected Error in windream.CheckFileExistsinWM: {ex.Message}")
_logger.Error(ex) _logger.Error(ex)
Return False Return False
End Try End Try
@ -303,6 +304,7 @@ Public Class Windream
Dim oType = oAttribute.GetVariableValue("dwAttrType") Dim oType = oAttribute.GetVariableValue("dwAttrType")
Return oType Return oType
Catch ex As Exception Catch ex As Exception
_logger.Warn($"Error in Windream.GetIndexType for Indexname [{IndexName}]")
_logger.Error(ex) _logger.Error(ex)
Return Nothing Return Nothing
End Try End Try
@ -785,10 +787,11 @@ Public Class Windream
Return False Return False
End Try End Try
_logger.Info($"File '{FilenameTarget}' was streamed.") _logger.Info($"File '{FilenameTarget}' has been streamde successfully!")
Dim oDocid = GetIndexValue(FilenameTarget, "Dokument-ID") Dim oDocid = GetIndexValue(FilenameTarget, "Dokument-ID")
If Not IsNothing(oDocid) Then If Not IsNothing(oDocid) Then
NewDocumentID = oDocid(0) NewDocumentID = oDocid(0)
CurrentWMObject = oWMObject
End If End If
Return True Return True
@ -1240,16 +1243,21 @@ Public Class Windream
Try Try
Dim oType As Integer = GetIndexType(IndexName) Dim oType As Integer = GetIndexType(IndexName)
Dim oConvertedValue As Object = Helpers.ConvertIndexValue(oType, Value) If Not IsNothing(oType) Then
Dim oConvertedValue As Object = Helpers.ConvertIndexValue(oType, Value)
oWMObject.SetVariableValue(IndexName, oConvertedValue) oWMObject.SetVariableValue(IndexName, oConvertedValue)
oWMObject.Save() oWMObject.Save()
If UnlockObject(oWMObject) = False Then If UnlockObject(oWMObject) = False Then
_logger.Warn("File {0} could not be unlocked", Path) _logger.Warn("File {0} could not be unlocked", Path)
End If
Return True
Else
Return False
End If End If
Return True
Catch ex As Exception Catch ex As Exception
_logger.Error(ex) _logger.Error(ex)
UnlockObject(oWMObject) UnlockObject(oWMObject)