To tag a result file as a source file
An audit test can have 1 or 0 primary input files and 0 or many additional (secondary) input files.
In order to tag the result of an audit test as a source file (primary or additional) for another audit test, you have to define some settings at macro level or at project (SDK) level.
Example
In the ABC audit test's macro tag IDs have to be assigned to a result of ABC to make it an input file for audit test XYZ:
'Assign tag IDs to field names
Dim oMC As Object
Dim oTM As Object
Dim oHelper As Object
Dim sResult_ABC As String'Result file name of ABC audit test
Dim TagIDs_Arr() As Variant'Tag IDs
Dim Cols_Arr() As Variant'Field names of sResult_ABC to be tagged by tag IDs
TagIDs_Arr = Array(tagID1, tagID2, tagID3, tagID4)
Cols_Arr = Array(colName1, colName2, colName3, colName4) 'Field names in sResult_ABC
Set oMC = SmartContext.MacroCommands
Set oTM = oMC.TagManagement()
Set oHelper = oTM.AssociatingTagging(oSC.GetFullFileName(sResult_ABC))
For i = LBound(TagIDs_Arr) to UBound(TagIDs_Arr)
oHelper.SetTag TagIDs_Arr(i), Cols_Arr(i)
Next
'Set test filter to create test filter associations
Dim oEquationBuilder As Object
Dim oTestFilter As Object
Set oEquationBuilder = oMC.ContentEquationBuilder()
'Note: "GoBD" will be specified in the "Content Area" property of XYZ's SDK project
Set oTestFilter = oEquationBuilder.GetStandardTestFilter("GoBD")
'Save the effect of the associations
oHelper.SaveWithTestFilter oTestFilter
'Designate the tagged sResult_ABC as primary or additional(secondary) database for another test (XYZ)
Dim bIsPrimary As Boolean
bIsPrimary = True 'bIsPrimary = True for tagging sResult_ABC as primary database for XYZ
'bIsPrimary = False for tagging sResult_ABC as additional database for XYZ
If bIsPrimary Then
oHelper.AssociatePrimary oTestFilter
Else
Dim sAlias As String
sAlias = "EmployeeMaster" 'To be used in XYZ macro to identify the database name tagged as additional(secondary) database in ABC
oHelper.AssociateSecondary oTestFilter, sAlias
End If
In the XYZ audit test the following has to be done, in order to access the database tagged in ABC as additional database for XYZ:
a) in XYZ audit test's SDK project, set property "Content Area" to "GoBD"
b) in XYZ audit test's macro:
'Find the database's name tagged in ABC as primary database for XYZ
Dim sPrimary_in_XYZ As String
sPrimary_in_XYZ = SmartContext.PrimaryInputFile
'Find the database's name tagged in ABC as additional(secondary) database for XYZ'based on the Alias value set in ABC's macro
Dim sAdditional_in_XYZ As String
Dim sAlias As String
sAlias = "EmployeeMaster"
If SmartContext.InputFilesContainsAlias(sAlias) Then
sFileName_XYZ = SmartContext.InputFileByAlias(sAlias)
End If