EDMIService: Fix internal Placeholders

This commit is contained in:
Jonathan Jenne
2022-03-15 16:34:54 +01:00
parent 65ef8ccbc7
commit 1b5e724750
3 changed files with 15 additions and 13 deletions

View File

@@ -28,22 +28,24 @@ Namespace Modules.Globix
While ContainsPattern(oResult, PatternIdentifier)
Try
Dim oIndexName As String = GetNextPattern(oResult, PatternIdentifier).Value
Logger.Info("Replacing value for Index {0}", oIndexName)
If pIndexes.ContainsKey(oIndexName) = False Then
Logger.Warn("Value for Index [{0}] does not exist and will not be used for replacing. Skipping.", oIndexName)
Else
' TODO: If Index contains multiple values, only the first value will be used as value
Dim oIndexValues As List(Of String) = pIndexes.Item(oIndexName)
Dim oFirstValue As String = oIndexValues.FirstOrDefault()
If oFirstValue Is Nothing Then
Logger.Warn("Value for Index [{0}] is empty and will not be used for replacing. Skipping.")
Return oResult
End If
oResult = ReplacePattern(oResult, PatternIdentifier, oFirstValue)
End If
' TODO: If Index contains multiple values, only the first value will be used as value
Dim oIndexValues As List(Of String) = pIndexes.Item(oIndexName)
Dim oFirstValue As String = oIndexValues.FirstOrDefault()
If oFirstValue Is Nothing Then
Logger.Warn("Value for Index [{0}] is empty and will not be used for replacing. Skipping.")
Return oResult
End If
oResult = ReplacePattern(oResult, PatternIdentifier, oFirstValue)
Catch ex As Exception
Logger.Error(ex)
Return oResult