MS V2.7 .Net Logger etc
This commit is contained in:
@@ -42,7 +42,7 @@ Public Class ClassImport_Windream
|
||||
idxvalue = idxvalue.ToString.Replace("@Dokart", Dokart)
|
||||
End Select
|
||||
End If
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Indexvalue: " & idxvalue.ToString, False)
|
||||
LOGGER.Debug("Indexvalue: " & idxvalue.ToString)
|
||||
Count += 1
|
||||
indexierung_erfolgreich = clsWD_SET.IndexFile(CURRENT_FILEIN_WD, indexname, idxvalue, clsWindream.MY_WDOBJECTTYPE)
|
||||
If indexierung_erfolgreich = False Then
|
||||
@@ -62,7 +62,7 @@ Public Class ClassImport_Windream
|
||||
' If dt.Rows.Count = 1 Then
|
||||
' Dim indexname = dt.Rows(0).Item("IDXNAME_ENTITYID").ToString
|
||||
' Dim idxvalue = CURRENT_ENTITY_ID
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Entity-ID: " & idxvalue.ToString, False)
|
||||
' LOGGER.Debug("Entity-ID: " & idxvalue.ToString)
|
||||
' indexierung_erfolgreich = clsWD_SET.IndexFile(CURRENT_FILEIN_WD, indexname, idxvalue, clsWindream.MY_WDOBJECTTYPE)
|
||||
' If indexierung_erfolgreich = False Then
|
||||
' err = True
|
||||
@@ -71,7 +71,7 @@ Public Class ClassImport_Windream
|
||||
' End If
|
||||
' indexname = dt.Rows(0).Item("IDXNAME_PARENTID").ToString
|
||||
' idxvalue = CURRENT_PARENT_ENTITY_ID
|
||||
' If LogErrorsOnly = False Then ClassLogger.Add(" >> Parent-ID: " & idxvalue.ToString, False)
|
||||
' LOGGER.Debug("Parent-ID: " & idxvalue.ToString)
|
||||
' indexierung_erfolgreich = clsWD_SET.IndexFile(CURRENT_FILEIN_WD, indexname, idxvalue, clsWindream.MY_WDOBJECTTYPE)
|
||||
' If indexierung_erfolgreich = False Then
|
||||
' err = True
|
||||
@@ -135,7 +135,7 @@ Public Class ClassImport_Windream
|
||||
oROOTWM_FOLDER = ""
|
||||
End Try
|
||||
If oROOTWM_FOLDER <> String.Empty Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add($">> oROOTWM_FOLDER '{oROOTWM_FOLDER}' will be used", False)
|
||||
LOGGER.Debug($"oROOTWM_FOLDER '{oROOTWM_FOLDER}' will be used")
|
||||
oWMTARGET_FOLDER = oROOTWM_FOLDER
|
||||
End If
|
||||
|
||||
@@ -143,11 +143,11 @@ Public Class ClassImport_Windream
|
||||
If Not IsDBNull(oDYNAMIC_FOLDER) Then
|
||||
If oDYNAMIC_FOLDER <> String.Empty Then
|
||||
If CREATE_FOLDER_INDEX(oDYNAMIC_FOLDER, DocTypeID) = True And CURRENT_VARIABLE_FOLDER <> "" Then
|
||||
If LogErrorsOnly = False Then
|
||||
ClassLogger.Add(" >> After CREATE_FOLDER_INDEX - oWMTARGET_FOLDER: " & oWMTARGET_FOLDER, False)
|
||||
ClassLogger.Add(" >> After CREATE_FOLDER_INDEX - CURRENT_VARIABLE_FOLDER: " & CURRENT_VARIABLE_FOLDER, False)
|
||||
End If
|
||||
If oWMTARGET_FOLDER <> CURRENT_VARIABLE_FOLDER Then
|
||||
|
||||
LOGGER.Debug("After CREATE_FOLDER_INDEX - oWMTARGET_FOLDER: " & oWMTARGET_FOLDER)
|
||||
LOGGER.Debug("After CREATE_FOLDER_INDEX - CURRENT_VARIABLE_FOLDER: " & CURRENT_VARIABLE_FOLDER)
|
||||
|
||||
If oWMTARGET_FOLDER <> CURRENT_VARIABLE_FOLDER Then
|
||||
oWMTARGET_FOLDER = oWMTARGET_FOLDER & "\" & CURRENT_VARIABLE_FOLDER.Replace(oWMTARGET_FOLDER, "")
|
||||
Else
|
||||
oWMTARGET_FOLDER = CURRENT_VARIABLE_FOLDER
|
||||
@@ -161,10 +161,10 @@ Public Class ClassImport_Windream
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
If LogErrorsOnly = False Then
|
||||
ClassLogger.Add(" >> oWMTARGET_FOLDER: " & oWMTARGET_FOLDER, False)
|
||||
ClassLogger.Add(" >> CURRENT_SUBFOLDER: " & CURRENT_SUBFOLDER, False)
|
||||
End If
|
||||
|
||||
LOGGER.Debug("oWMTARGET_FOLDER: " & oWMTARGET_FOLDER)
|
||||
LOGGER.Debug("CURRENT_SUBFOLDER: " & CURRENT_SUBFOLDER)
|
||||
|
||||
|
||||
'Untsserordner ja oder nein
|
||||
If CURRENT_CHECK_SUBFOLDER = True And CURRENT_SUBFOLDER <> "" Then
|
||||
@@ -172,7 +172,7 @@ Public Class ClassImport_Windream
|
||||
End If
|
||||
oWMTARGET_FOLDER = oWMTARGET_FOLDER.Replace("\\", "\")
|
||||
If oWMTARGET_FOLDER.Contains("/") Then
|
||||
ClassLogger.Add(String.Format(">> Targetpath contains /-sign. / will be replaced with _"))
|
||||
LOGGER.Info(String.Format("Targetpath contains /-sign. / will be replaced with _"))
|
||||
oWMTARGET_FOLDER = oWMTARGET_FOLDER.Replace("/", "_")
|
||||
End If
|
||||
|
||||
@@ -180,7 +180,7 @@ Public Class ClassImport_Windream
|
||||
Try
|
||||
Select Case clsWD_GET.WD_PATH_EXISTS(oWMTARGET_FOLDER.Substring(2))
|
||||
Case False
|
||||
ClassLogger.Add(String.Format(">> Targetpath ({0}) is not existing or result of WD_PATH_EXISTS was false.", oWMTARGET_FOLDER.Substring(2)), False)
|
||||
LOGGER.Info(String.Format("Targetpath ({0}) is not existing or result of WD_PATH_EXISTS was false.", oWMTARGET_FOLDER.Substring(2)))
|
||||
Dim split() As String = oWMTARGET_FOLDER.Split("\")
|
||||
Dim Path_Combined As String = ""
|
||||
For Each s As String In split
|
||||
@@ -194,18 +194,18 @@ Public Class ClassImport_Windream
|
||||
|
||||
Select Case clsWD_GET.WD_PATH_EXISTS(temppath)
|
||||
Case False
|
||||
If LogErrorsOnly = False Then
|
||||
ClassLogger.Add(" >> Trying to create folder-part: " & temppath, False)
|
||||
End If
|
||||
|
||||
LOGGER.Debug("Trying to create folder-part: " & temppath)
|
||||
|
||||
clsWindream.MY_WDSESSION.GetNewWMObjectFS(2, temppath, 0) 'WMEntityFolder,WMObjectEditModeNoEdit)
|
||||
Case -10
|
||||
ClassLogger.Add(">> WD_PATH_EXISTS returned -10 for: " & temppath, False)
|
||||
LOGGER.Warn("WD_PATH_EXISTS returned -10 for: " & temppath)
|
||||
Return False
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
If Not ex.Message.Contains("Filename exists!") Then
|
||||
ClassLogger.Add(String.Format(">> Could not create folder-part: {0} - Complete path is: ({1})", temppath, oWMTARGET_FOLDER.Substring(2)))
|
||||
ClassLogger.Add(String.Format(">> ErrorMessage: {0}: ", ex.Message))
|
||||
LOGGER.Warn(String.Format("Could not create folder-part: {0} - Complete path is: ({1})", temppath, oWMTARGET_FOLDER.Substring(2)))
|
||||
LOGGER.Warn(String.Format("ErrorMessage: {0}: ", ex.Message))
|
||||
Return False
|
||||
End If
|
||||
End Try
|
||||
@@ -217,7 +217,7 @@ Public Class ClassImport_Windream
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
If Not ex.Message.Contains("Filename exists!") Then
|
||||
ClassLogger.Add(String.Format(">> Could not create folder ({0}): " & ex.Message, oWMTARGET_FOLDER.Substring(2)), False)
|
||||
LOGGER.Warn(String.Format("Could not create folder ({0}): " & ex.Message, oWMTARGET_FOLDER.Substring(2)))
|
||||
Return False
|
||||
End If
|
||||
End Try
|
||||
@@ -227,15 +227,15 @@ Public Class ClassImport_Windream
|
||||
'Namenkonvention laden
|
||||
'Dim NameConv = ClassDatabase.Execute_Scalar("SELECT TOP 1 NAME_CONVENTION FROM TBPMO_WD_FORMVIEW_DOKTYPES WHERE DOCTYPE_ID = " & DocTypeID & " AND FORMVIEW_ID = " & CURRENT_FORMVIEW_ID, True)
|
||||
If IsDBNull(oNAME_CONVENTION) Then
|
||||
ClassLogger.Add(">> Achtung: Namenskonvention is DBNull", False)
|
||||
LOGGER.Warn("Achtung: Namenskonvention is DBNull")
|
||||
oNAME_CONVENTION = Path.GetFileNameWithoutExtension(CURRENT_FILENAME)
|
||||
ElseIf oNAME_CONVENTION = String.Empty Then
|
||||
ClassLogger.Add(">> Achtung: Namenskonvention is String empty", False)
|
||||
LOGGER.Warn("Achtung: Namenskonvention is String empty")
|
||||
oNAME_CONVENTION = Path.GetFileNameWithoutExtension(CURRENT_FILENAME)
|
||||
End If
|
||||
'schonmal den gesamten Pfad laden
|
||||
Dim oNewWM_Filename As String = oWMTARGET_FOLDER & "\" & oNAME_CONVENTION
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> oNewWM_Filename: " & oNewWM_Filename, False)
|
||||
LOGGER.Debug("oNewWM_Filename: " & oNewWM_Filename)
|
||||
|
||||
' einen Regulären Ausdruck laden
|
||||
Dim regulärerAusdruck As System.Text.RegularExpressions.Regex = New System.Text.RegularExpressions.Regex(preg)
|
||||
@@ -245,7 +245,7 @@ Public Class ClassImport_Windream
|
||||
' alle Vorkommen innerhalbd er Namenkonvention durchlaufen
|
||||
For Each element As System.Text.RegularExpressions.Match In elemente
|
||||
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> element in RegeX: " & element.Value, False)
|
||||
LOGGER.Debug("element in RegeX: " & element.Value)
|
||||
Select Case element.Value.Substring(2, 1).ToUpper
|
||||
'Nur automatische Indizes auswerten
|
||||
Case "A"
|
||||
@@ -269,7 +269,7 @@ Public Class ClassImport_Windream
|
||||
If IsNumeric(INDEX_ID) Then
|
||||
Dim sql_AUTOindexresult = ClassDatabase.Execute_Scalar("SELECT SQL_RESULT FROM TBDD_INDEX_AUTOM WHERE GUID = " & INDEX_ID, True)
|
||||
If IsNothing(sql_AUTOindexresult) Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> unexpected: sql_AUTOindexresult is nothing!!", False)
|
||||
LOGGER.Debug("unexpected: sql_AUTOindexresult is nothing!!")
|
||||
value = ""
|
||||
Else
|
||||
If IsDBNull(sql_AUTOindexresult) Then
|
||||
@@ -278,8 +278,8 @@ Public Class ClassImport_Windream
|
||||
sql_AUTOindexresult = sql_AUTOindexresult.ToString.ToUpper.Replace("@RECORD-ID", CURRENT_RECORD_ID)
|
||||
Dim AUTOindexresult = ClassDatabase.Execute_Scalar(sql_AUTOindexresult, True)
|
||||
If IsNothing(AUTOindexresult) Then
|
||||
ClassLogger.Add(">> ATTENTION: unexpected: AUTOindexresult is nothing!!", False)
|
||||
ClassLogger.Add(">> " & sql_AUTOindexresult, False)
|
||||
LOGGER.Warn("ATTENTION: unexpected: AUTOindexresult is nothing!!")
|
||||
LOGGER.Warn("" & sql_AUTOindexresult)
|
||||
value = ""
|
||||
Else
|
||||
If IsDBNull(AUTOindexresult) Then
|
||||
@@ -292,16 +292,16 @@ Public Class ClassImport_Windream
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
ClassLogger.Add(">> INDEX_ID is not numeric: " & INDEX_ID.ToString & "- APattern: " & APattern, False)
|
||||
LOGGER.Warn("INDEX_ID is not numeric: " & INDEX_ID.ToString & "- APattern: " & APattern)
|
||||
value = ""
|
||||
End If
|
||||
Else
|
||||
ClassLogger.Add(">> split.Length <> 2 - APattern: " & APattern, False)
|
||||
LOGGER.Warn("split.Length <> 2 - APattern: " & APattern)
|
||||
value = ""
|
||||
End If
|
||||
|
||||
ElseIf APattern.Contains("#") Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> element [" & APattern & "] filled with Record-Data...: ", False)
|
||||
LOGGER.Debug("element [" & APattern & "] filled with Record-Data...: ")
|
||||
Dim split() As String = APattern.Split("#")
|
||||
If split.Length = 2 Then
|
||||
Dim CONTROL_ID = split(1)
|
||||
@@ -316,24 +316,24 @@ Public Class ClassImport_Windream
|
||||
lblsql = lblsql.ToString.ToUpper.Replace("@RECORD-ID", CURRENT_RECORD_ID)
|
||||
lblsql = lblsql.ToString.ToUpper.Replace("@ENTITY-ID", CURRENT_ENTITY_ID)
|
||||
lblsql = lblsql.ToString.ToUpper.Replace("@ENTITY_ID", CURRENT_ENTITY_ID)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> variable sql will be used for convention", False)
|
||||
LOGGER.Debug("variable sql will be used for convention")
|
||||
Dim result = ClassDatabase.Execute_ScalarWithConnection(DTtype.Rows(0).Item(2), lblsql)
|
||||
If Not IsNothing(result) Then
|
||||
value = result.ToString
|
||||
Else
|
||||
ClassLogger.Add(">> variable sqlresult is nothing - " & lblsql, False)
|
||||
LOGGER.Warn("variable sqlresult is nothing - " & lblsql)
|
||||
value = ""
|
||||
End If
|
||||
Else
|
||||
ClassLogger.Add(">> NameConvention should be filled with value of Control-ID '" & CONTROL_ID & "', but result was nothing.", False)
|
||||
ClassLogger.Add(">> SQL-Command: " & CURRENT_LAST_SQL)
|
||||
LOGGER.Warn("NameConvention should be filled with value of Control-ID '" & CONTROL_ID & "', but result was nothing.")
|
||||
LOGGER.Warn("SQL-Command: " & CURRENT_LAST_SQL)
|
||||
value = ""
|
||||
End If
|
||||
|
||||
Else
|
||||
If IsDBNull(CONTROLVALUE) Then
|
||||
ClassLogger.Add(">> NameConvention should be filled with value of Control-ID '" & CONTROL_ID & "', but result was DBNULL.", False)
|
||||
ClassLogger.Add(">> SQL-Command: " & CURRENT_LAST_SQL)
|
||||
LOGGER.Warn("NameConvention should be filled with value of Control-ID '" & CONTROL_ID & "', but result was DBNULL.")
|
||||
LOGGER.Warn("SQL-Command: " & CURRENT_LAST_SQL)
|
||||
value = ""
|
||||
Else
|
||||
Dim sql1 = "SELECT * FROM TBPMO_WD_NAMECONVENTION_FORMAT WHERE ID = (SELECT TOP 1 GUID FROM TBPMO_WD_FORMVIEW_DOKTYPES WHERE DOCTYPE_ID = " & DocTypeID & " AND FORMVIEW_ID = " & CURRENT_FORMVIEW_ID & ")"
|
||||
@@ -378,7 +378,7 @@ Public Class ClassImport_Windream
|
||||
If value <> String.Empty Then
|
||||
oNewWM_Filename = oNewWM_Filename.Replace(element.Value, value)
|
||||
_NewFileString = oNewWM_Filename
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Actual NEWFILESTRING: " & _NewFileString, False)
|
||||
LOGGER.Debug("Actual NEWFILESTRING: " & _NewFileString)
|
||||
' sql_history_INSERT_INTO = sql_history_INSERT_INTO & ", INDEX" & AnzahlIndexe.ToString
|
||||
AnzahlIndexe += 1
|
||||
' sql_history_Index_Values = sql_history_Index_Values & ", '" & value & "'"
|
||||
@@ -444,7 +444,7 @@ Public Class ClassImport_Windream
|
||||
msg = "In nameconvention an element was defined which could not be replaced." & vbNewLine & "elementname: " & element.Value.ToUpper
|
||||
End If
|
||||
|
||||
ClassLogger.Add(msg)
|
||||
LOGGER.Warn(msg)
|
||||
MsgBox(msg, MsgBoxStyle.Exclamation, "Error in Name Convention:")
|
||||
End Select
|
||||
Next
|
||||
@@ -452,11 +452,11 @@ Public Class ClassImport_Windream
|
||||
'ungültige Zeichen entfernen
|
||||
oNewWM_Filename = ClassHelper.CleanFilename(oNewWM_Filename, "")
|
||||
If oNewWM_Filename.Contains("/") Then
|
||||
ClassLogger.Add(String.Format(">> DATEINAME contains /-sign. / will be replaced with _"))
|
||||
LOGGER.Info(String.Format("DATEINAME contains /-sign. / will be replaced with _"))
|
||||
oNewWM_Filename = oNewWM_Filename.Replace("/", "_")
|
||||
End If
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(" - Error in Versioning file - Error: " & vbNewLine & ex.Message)
|
||||
LOGGER.Warn(" - Error in Versioning file - Error: " & vbNewLine & ex.Message)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in Versioning file:")
|
||||
err = True
|
||||
End Try
|
||||
@@ -477,7 +477,7 @@ Public Class ClassImport_Windream
|
||||
End If
|
||||
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(" - Unexpected Error in FileName-Creating: " & vbNewLine & ex.Message)
|
||||
LOGGER.Warn(" - Unexpected Error in FileName-Creating: " & vbNewLine & ex.Message)
|
||||
MsgBox(" - Unexpected Error in FileName-Creating: " & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
Return False
|
||||
End Try
|
||||
@@ -497,9 +497,9 @@ Public Class ClassImport_Windream
|
||||
'####
|
||||
' alle Vorkommen innerhalb des Ordnerstrings durchlaufen
|
||||
For Each element As System.Text.RegularExpressions.Match In elemente
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Elementname in FolderString: '" & element.ToString & "'", False)
|
||||
LOGGER.Debug("Elementname in FolderString: '" & element.ToString & "'")
|
||||
Dim EL_SUBSTRING = element.Value.Substring(2, 1).ToUpper
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> EL_SUBSTRING is: '" & EL_SUBSTRING & "'", False)
|
||||
LOGGER.Debug("EL_SUBSTRING is: '" & EL_SUBSTRING & "'")
|
||||
Select Case EL_SUBSTRING
|
||||
'Manueller Indexwert
|
||||
Case "A"
|
||||
@@ -511,11 +511,11 @@ Public Class ClassImport_Windream
|
||||
Dim sql = "SELECT SQL_RESULT FROM TBDD_INDEX_AUTOM WHERE GUID = " & INDEX_ID
|
||||
Dim sql_command = ClassDatabase.Execute_Scalar(sql)
|
||||
If IsNothing(sql_command) Then
|
||||
ClassLogger.Add(" >> unexpected: SQL_RESULT is nothing!!", False)
|
||||
ClassLogger.Add(" >> " & sql, False)
|
||||
LOGGER.Warn("unexpected: SQL_RESULT is nothing!!")
|
||||
LOGGER.Warn("" & sql)
|
||||
Else
|
||||
If IsDBNull(sql_command) Then
|
||||
ClassLogger.Add(" >> unexpected: sql_command is DBNULL!!", False)
|
||||
LOGGER.Warn("unexpected: sql_command is DBNULL!!")
|
||||
Else
|
||||
sql_command = sql_command.ToString.ToUpper.Replace("@RECORD-ID", CURRENT_RECORD_ID)
|
||||
sql_command = sql_command.ToString.ToUpper.Replace("@RECORD_ID", CURRENT_RECORD_ID)
|
||||
@@ -523,13 +523,13 @@ Public Class ClassImport_Windream
|
||||
sql_command = sql_command.ToString.ToUpper.Replace("@ENTITY_ID", CURRENT_ENTITY_ID)
|
||||
Dim AUTOindexresult = ClassDatabase.Execute_Scalar(sql_command, True)
|
||||
If IsNothing(AUTOindexresult) Then
|
||||
ClassLogger.Add(">> unexpected: AUTOindexresult is nothing!!", False)
|
||||
ClassLogger.Add(">> " & sql_command, False)
|
||||
LOGGER.Warn("unexpected: AUTOindexresult is nothing!!")
|
||||
LOGGER.Warn("" & sql_command)
|
||||
Else
|
||||
If IsDBNull(AUTOindexresult) Then
|
||||
ClassLogger.Add(">> unexpected: AUTOindexresult is DBNULL - " & sql_command, False)
|
||||
LOGGER.Warn("unexpected: AUTOindexresult is DBNULL - " & sql_command)
|
||||
Else
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> AUTOindexresult is: '" & AUTOindexresult & "'", False)
|
||||
LOGGER.Debug("AUTOindexresult is: '" & AUTOindexresult & "'")
|
||||
FolderConvention = FolderConvention.Replace(element.ToString, AUTOindexresult)
|
||||
End If
|
||||
End If
|
||||
@@ -537,32 +537,32 @@ Public Class ClassImport_Windream
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
ClassLogger.Add(">> INDEX_ID is not numeric: " & INDEX_ID.ToString & "- APattern: " & element.Value, False)
|
||||
LOGGER.Warn("INDEX_ID is not numeric: " & INDEX_ID.ToString & "- APattern: " & element.Value)
|
||||
End If
|
||||
Else
|
||||
ClassLogger.Add(">> split.Length <> 2 - APattern: " & element.Value, False)
|
||||
LOGGER.Warn("split.Length <> 2 - APattern: " & element.Value)
|
||||
End If
|
||||
|
||||
Case "M"
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> Working on manual value......'", False)
|
||||
LOGGER.Debug("Working on manual value......'")
|
||||
Dim split() As String = element.Value.Substring(3, element.Value.Length - 4).Split("#")
|
||||
If split.Length = 2 Then
|
||||
'Die GUID des AutoIndex auslesen
|
||||
Dim INDEX_ID = split(1)
|
||||
If IsNumeric(INDEX_ID) Then
|
||||
If element.Value.ToUpper.Contains("FOLDERSELECT") Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> FOLDERSELECT......'", False)
|
||||
LOGGER.Debug("FOLDERSELECT......'")
|
||||
For Each row As DataRow In CURRENT_TBPMO_INDEX_MAN.Rows
|
||||
If row.Item("GUID") = INDEX_ID Then
|
||||
Dim manvalue = row.Item("MAN_VALUE")
|
||||
If manvalue <> String.Empty Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> folder value is: '" & manvalue & "'", False)
|
||||
LOGGER.Debug("folder value is: '" & manvalue & "'")
|
||||
CURRENT_VARIABLE_FOLDER_OVERRIDE = True
|
||||
CURRENT_VARIABLE_FOLDER = manvalue
|
||||
Return True
|
||||
|
||||
Else
|
||||
ClassLogger.Add(">> Attention: manvalue (from Input indexing is empty!!", False)
|
||||
LOGGER.Warn("Attention: manvalue (from Input indexing is empty!!")
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
@@ -573,21 +573,21 @@ Public Class ClassImport_Windream
|
||||
If row.Item("GUID") = INDEX_ID Then
|
||||
Dim manvalue = row.Item("MAN_VALUE")
|
||||
If manvalue <> String.Empty Then
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> manvalue is: '" & manvalue & "'", False)
|
||||
LOGGER.Debug("manvalue is: '" & manvalue & "'")
|
||||
FolderConvention = FolderConvention.Replace(element.ToString, manvalue)
|
||||
FolderConvention = FolderConvention.Replace("\\", "")
|
||||
Else
|
||||
ClassLogger.Add(">> Attention: manvalue (from Input indexing is empty!!", False)
|
||||
LOGGER.Warn("Attention: manvalue (from Input indexing is empty!!")
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
|
||||
End If
|
||||
Else
|
||||
ClassLogger.Add(">> INDEX_ID is not numeric: " & INDEX_ID.ToString & "- APattern: " & element.Value, False)
|
||||
LOGGER.Warn("INDEX_ID is not numeric: " & INDEX_ID.ToString & "- APattern: " & element.Value)
|
||||
End If
|
||||
Else
|
||||
ClassLogger.Add(">> split.Length <> 2 - APattern: " & element.Value, False)
|
||||
LOGGER.Warn("split.Length <> 2 - APattern: " & element.Value)
|
||||
End If
|
||||
|
||||
|
||||
@@ -596,7 +596,7 @@ Public Class ClassImport_Windream
|
||||
Dim split() As String = elmt
|
||||
If split.Length = 2 Then
|
||||
Dim VARTYPE = split(0)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> VARTYPE is: '" & VARTYPE & "'", False)
|
||||
LOGGER.Debug("VARTYPE is: '" & VARTYPE & "'")
|
||||
Select Case VARTYPE
|
||||
Case "ARDoctype"
|
||||
FolderConvention = FolderConvention.Replace(element.ToString, CURRENT_DOKARTSTRING)
|
||||
@@ -646,22 +646,22 @@ Public Class ClassImport_Windream
|
||||
lblsql = lblsql.ToString.ToUpper.Replace("@RECORD-ID", CURRENT_RECORD_ID)
|
||||
lblsql = lblsql.ToString.ToUpper.Replace("@ENTITY-ID", CURRENT_ENTITY_ID)
|
||||
lblsql = lblsql.ToString.ToUpper.Replace("@ENTITY_ID", CURRENT_ENTITY_ID)
|
||||
If LogErrorsOnly = False Then ClassLogger.Add(" >> variable sql will be used for convention", False)
|
||||
LOGGER.Debug("variable sql will be used for convention")
|
||||
Dim result = ClassDatabase.Execute_ScalarWithConnection(DTtype.Rows(0).Item(2), lblsql)
|
||||
If Not IsNothing(result) Then
|
||||
FolderConvention = FolderConvention.Replace(element.ToString, result.ToString)
|
||||
Else
|
||||
ClassLogger.Add(">> variable sqlresult is nothing - " & lblsql, False)
|
||||
LOGGER.Warn("variable sqlresult is nothing - " & lblsql)
|
||||
End If
|
||||
Else
|
||||
ClassLogger.Add(">> Variable folder should be filled with value of Control-ID '" & CONTROL_ID & "', but result was nothing.", False)
|
||||
ClassLogger.Add(">> SQL-Command: " & checktype)
|
||||
LOGGER.Warn("Variable folder should be filled with value of Control-ID '" & CONTROL_ID & "', but result was nothing.")
|
||||
LOGGER.Warn("SQL-Command: " & checktype)
|
||||
End If
|
||||
|
||||
Else
|
||||
If IsDBNull(CONTROLVALUE) Then
|
||||
ClassLogger.Add(">> Variable folder should be filled with value of Control-ID '" & CONTROL_ID & "', but result was DBNULL.", False)
|
||||
ClassLogger.Add(">> SQL-Command: " & CURRENT_LAST_SQL)
|
||||
LOGGER.Warn("Variable folder should be filled with value of Control-ID '" & CONTROL_ID & "', but result was DBNULL.")
|
||||
LOGGER.Warn("SQL-Command: " & CURRENT_LAST_SQL)
|
||||
Else
|
||||
Dim sql1 = "SELECT * FROM TBPMO_WD_NAMECONVENTION_FORMAT WHERE ID = (SELECT TOP 1 GUID FROM TBPMO_WD_FORMVIEW_DOKTYPES WHERE DOCTYPE_ID = " & DocTypeID & " AND FORMVIEW_ID = " & CURRENT_FORMVIEW_ID & ")"
|
||||
Dim DT_FORMAT As DataTable = ClassDatabase.Return_Datatable(sql1, True)
|
||||
@@ -697,17 +697,17 @@ Public Class ClassImport_Windream
|
||||
|
||||
|
||||
Case Else
|
||||
ClassLogger.Add(" -Undefined pattern found in folderconvention" & vbNewLine & "Elementname: " & element.Value.ToUpper)
|
||||
LOGGER.Warn(" -Undefined pattern found in folderconvention" & vbNewLine & "Elementname: " & element.Value.ToUpper)
|
||||
MsgBox("Achtung - in der Namenkonvention wurde ein Element gefunden welches nicht zugeordnet werden kann!" & vbNewLine & "Elementname: " & element.Value.ToUpper, MsgBoxStyle.Exclamation, "Unexpected error in Name generieren:")
|
||||
End Select
|
||||
If LogErrorsOnly = False Then ClassLogger.Add($" >> FolderConvention so far is: '{FolderConvention}'", False)
|
||||
LOGGER.Debug($"FolderConvention so far is: '{FolderConvention}'")
|
||||
Next
|
||||
CURRENT_VARIABLE_FOLDER = FolderConvention
|
||||
Return True
|
||||
|
||||
Catch ex As Exception
|
||||
MsgBox("Unexpected Error in CreateFolderforIndex-Method:" & vbNewLine & ex.Message, MsgBoxStyle.Critical)
|
||||
ClassLogger.Add(" >> Fehler in CrFolderForIndex: " & ex.Message, True)
|
||||
LOGGER.Warn("Fehler in CrFolderForIndex: " & ex.Message, True)
|
||||
Return False
|
||||
End Try
|
||||
End Function
|
||||
@@ -735,7 +735,7 @@ Public Class ClassImport_Windream
|
||||
CURRENT_NEWFILENAME = _NewFileString & extension
|
||||
Return True
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add(" - Error in versioning file - error: " & vbNewLine & ex.Message)
|
||||
LOGGER.Warn(" - Error in versioning file - error: " & vbNewLine & ex.Message)
|
||||
MsgBox(ex.Message, MsgBoxStyle.Critical, "Error in versioning file:")
|
||||
Return False
|
||||
End Try
|
||||
|
||||
Reference in New Issue
Block a user