Skip to content

Commit 16b1aca

Browse files
committed
#2227 fix missing default values after refactor for mutli sources -> targets list
1 parent 9ecdb35 commit 16b1aca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Modules/DIM/BExIS.Dim.Helper/Mappings/MappingUtils.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1413,7 +1413,9 @@ public static XmlDocument GetConceptOutput(long metadataStructureId, long concep
14131413
foreach (var source in sources)
14141414
{
14151415
string sourcePath = source;
1416-
var currentComplexMappings = complexMappings.Where(m => m.Target.Id.Equals(currentCompexTarget) && m.Source.XPath.Contains(source)).ToList();
1416+
var currentComplexMappings = complexMappings.Where(m => m.Target.Id.Equals(currentCompexTarget)
1417+
&& (!string.IsNullOrEmpty(m.Source.XPath) && m.Source.XPath.Contains(source)) // belong to the current source scope
1418+
|| string.IsNullOrEmpty(m.Source.XPath)).ToList(); // all mappings without xpath, means default
14171419

14181420

14191421
int j = 1;
@@ -1502,6 +1504,7 @@ public static XmlDocument GetConceptOutput(long metadataStructureId, long concep
15021504
//var simpleElements = metadata.SelectNodes(t);
15031505
if ((simpleElements == null || simpleElements.Count() == 0) && string.IsNullOrEmpty(complexMapping.Source.XPath) && complexMapping.Source.Name.ToLower().Equals("default")) // DEFAULT
15041506
{
1507+
index = 1;
15051508
string simpleTargetPath = mergeXPaths(complexTargetPath, cTargetLinkElement.XPath, sTargetLinkElement.XPath + "[" + index + "]");
15061509

15071510
if (xTarget == null)

0 commit comments

Comments
 (0)