@@ -548,9 +548,8 @@ public static List<string> ValidateLogicalGroup(List<DataRow> dataRows, DataTabl
548
548
List < string > resultList = new List < string > ( ) ;
549
549
550
550
#region Retrieving the Integration Layer tables
551
-
552
551
// Informing the user.
553
- resultList . Add ( "\r \n --> Commencing the validation to check if the functional dependencies (logical group / unit of work) are present.\r \n " ) ;
552
+ resultList . Add ( "\r \n --> Commencing the validation to check if the functional dependencies (logical group / unit of work) are present.\r \n \r \n " ) ;
554
553
555
554
// Creating a list of tables which are dependent on other tables being present
556
555
var objectList = new List < Tuple < string , string , string , string > > ( ) ; // Source Name, Target Name, Business Key, FilterCriterion
@@ -620,21 +619,19 @@ public static List<string> ValidateLogicalGroup(List<DataRow> dataRows, DataTabl
620
619
}
621
620
}
622
621
}
623
-
624
622
#endregion
625
623
626
624
// Return the results back to the user
627
625
if ( resultDictionary . Count > 0 )
628
626
{
629
627
foreach ( var sourceObjectResult in resultDictionary )
630
628
{
631
- resultList . Add ( " " + sourceObjectResult . Key + " is tested with this outcome: " + sourceObjectResult . Value + "." +
632
- "\r \n This means there is a Link or Satellite without it's supporting Hub(s) defined." +
633
- "\r \n If a source loads a Link or Satellite, this source should also load a Hub that relates to the Link or Satellite.\r \n " ) ;
629
+ resultList . Add ( " " + sourceObjectResult . Key + " has validation issues.\r \n " ) ;
634
630
metadataValidations . ValidationIssues ++ ;
635
631
}
636
632
637
- resultList . Add ( "\r \n " ) ;
633
+ resultList . Add ( "\r \n This means there is a Link or Satellite without it's supporting Hub(s) defined." +
634
+ "\r \n If a source loads a Link or Satellite, this source should also load a Hub that relates to the Link or Satellite.\r \n " ) ;
638
635
}
639
636
else
640
637
{
@@ -688,7 +685,8 @@ internal static Dictionary<string, bool> ValidateLogicalGroup(Tuple<string, stri
688
685
689
686
// Unfortunately, there is a separate process for Links and Satellites
690
687
// Iterate through the various keys (mainly for the purpose of evaluating Links)
691
- int numberOfDependents = 0 ;
688
+ List < string > dependents = new List < string > ( ) ;
689
+
692
690
if ( tableClassification == teamConfiguration . SatTablePrefixValue || tableClassification == "LNK" )
693
691
{
694
692
foreach ( string businessKeyComponent in hubBusinessKeys )
@@ -721,11 +719,11 @@ internal static Dictionary<string, bool> ValidateLogicalGroup(Tuple<string, stri
721
719
sourceFullyQualifiedName . Key + '.' + sourceFullyQualifiedName . Value == validationObject . Item1 &&
722
720
( string ) dataObjectMappingRow [ DataObjectMappingGridColumns . BusinessKeyDefinition . ToString ( ) ] == businessKeyComponent . Trim ( ) &&
723
721
targetFullyQualifiedName . Key + '.' + targetFullyQualifiedName . Value != validationObject . Item2 && // Exclude itself
724
- filterCriterion == validationObject . Item4 && // Adding filtercriterion for uniquification of join (see https://github.com/RoelantVos/TEAM/issues/87);
722
+ // filterCriterion == validationObject.Item4 && // Adding filtercriterion for uniquification of join (see https://github.com/RoelantVos/TEAM/issues/87);
725
723
targetFullyQualifiedName . Value . StartsWith ( tableInclusionFilterCriterion )
726
724
)
727
725
{
728
- numberOfDependents ++ ;
726
+ dependents . Add ( validationTargetDataObject . Name ) ;
729
727
}
730
728
}
731
729
}
@@ -755,7 +753,7 @@ internal static Dictionary<string, bool> ValidateLogicalGroup(Tuple<string, stri
755
753
targetFullyQualifiedName . Value . StartsWith ( tableInclusionFilterCriterion )
756
754
)
757
755
{
758
- numberOfDependents ++ ;
756
+ dependents . Add ( validationTargetDataObject . Name ) ;
759
757
}
760
758
}
761
759
catch ( Exception )
@@ -768,11 +766,11 @@ internal static Dictionary<string, bool> ValidateLogicalGroup(Tuple<string, stri
768
766
// Run the comparison
769
767
// Test for equality.
770
768
bool equal ;
771
- if ( ( tableClassification == teamConfiguration . SatTablePrefixValue || tableClassification == "LNK" ) && businessKeyCount == numberOfDependents ) // For Sats and Links we can count the keys and rows
769
+ if ( ( tableClassification == teamConfiguration . SatTablePrefixValue || tableClassification == "LNK" ) && businessKeyCount <= dependents . Count ) // For Sats and Links we can count the keys and rows
772
770
{
773
771
equal = true ;
774
772
}
775
- else if ( tableClassification == "LSAT" && numberOfDependents == 1 )
773
+ else if ( tableClassification == "LSAT" && dependents . Count == 1 )
776
774
{
777
775
equal = true ;
778
776
}
@@ -783,7 +781,8 @@ internal static Dictionary<string, bool> ValidateLogicalGroup(Tuple<string, stri
783
781
784
782
// return the result of the test;
785
783
Dictionary < string , bool > result = new Dictionary < string , bool > ( ) ;
786
- result . Add ( validationObject . Item2 , equal ) ;
784
+ var concatenatedObject = $ "{ validationObject . Item2 } - ({ validationObject . Item1 } { validationObject . Item2 } { validationObject . Item3 } { validationObject . Item4 } )";
785
+ result . Add ( concatenatedObject , equal ) ;
787
786
return result ;
788
787
}
789
788
0 commit comments