Hi Jérémy,
I believe there is a standard data source method type “ConfirmationForWorkflowUnit” which might be close to what you are loooking for.
Assuming you are looking for something more tailored, I have included below an example business rule that returns specific confirmation rule details all the way down to the entity results.
The trick is to loop all the way down from ConfirmInstanceInfo → List(Of ConfirmGroupInstanceInfo) → List(Of ConfirmRuleInstanceInfo) → KeyValuePair(Of String, ConfirmEntityInstanceInfo).
Dim wfProfileName As String = args.NameValuePairs.XFGetValue("WFProfile")
Dim scenarioName As String = args.NameValuePairs.XFGetValue("Scenario")
Dim timeName As String = args.NameValuePairs.XFGetValue("Time")
Dim wfClusterPk As WorkflowUnitClusterPk =
BRApi.Workflow.General.GetWorkflowUnitClusterPk(
si,
wfProfileName,
scenarioName,
timeName
)
Dim confInstance As ConfirmInstanceInfo =
BRApi.DataQuality.Process.GetConfirmation(
si,
wfClusterPk,
True
)
Dim resultDt As New DataTable
With resultDt.Columns
.Add("WFProfile", GetType(String))
.Add("Scenario", GetType(String))
.Add("Time", GetType(String))
.Add("RuleGroup", GetType(String))
.Add("RuleName", GetType(String))
.Add("Entity", GetType(String))
.Add("Result", GetType(Boolean))
.Add("Amount", GetType(Decimal))
.Add("Info1", GetType(String))
.Add("Info2", GetType(String))
.Add("Info3", GetType(String))
.Add("Info4", GetType(String))
End With
For Each confGroup As ConfirmGroupInstanceInfo In confInstance.Groups
For Each confRule As ConfirmRuleInstanceInfo In confGroup.Rules
For Each confEntity As KeyValuePair(Of String, ConfirmEntityInstanceInfo) In confRule.EntityInstances
Dim dr As DataRow = resultDt.NewRow()
dr("WFProfile") = wfProfileName
dr("Scenario") = scenarioName
dr("Time") = timeName
dr("RuleGroup") = confGroup.Name
dr("RuleName") = confRule.RuleName
dr("Entity") = confEntity.Value.EntityName
dr("Result") = confEntity.Value.Result
dr("Amount") = confEntity.Value.DisplayResult
dr("Info1") = confEntity.Value.Custom1
dr("Info2") = confEntity.Value.Custom2
dr("Info3") = confEntity.Value.Custom3
dr("Info4") = confEntity.Value.Custom4
resultDt.Rows.Add(dr)
Next
Next
Next
Return resultDt
You would obviously need to tweak the columns you want to expose, and I have not incorporated any filtering of the data returned that you mentioned. Happy to assist further if needed.
Thanks,
Stuart