Skip to main content

Access Batch History from a Workflow Agent


QAID # 8318 Published

Question / Problem:

How can I access the Batch History from a Workflow Agent?

Answer / Solution:

This can be performed by traversing the Batch XML as exposed by the Ascent Capture Document Access API. For example:

  '*** Extract the Batch ACDataElement

    Dim oBatchElement As ACDataElement
    Set oBatchElement = oRuntimeRootElement.FindChildElementByName("Batch")

    Dim oBatchHistoryEntries As ACDataElement
    Set oBatchHistoryEntries = oBatchElement.FindChildElementByName("BatchHistoryEntries")

    Dim iFile As Integer

iFile = FreeFile
Open "c:\testlog.txt" For Append As #iFile

Print #iFile, "WFAgent Test Values " & Now

Dim oBatchHistoryEntry As ACDataElement
For Each oBatchHistoryEntry In oBatchHistoryEntries.FindChildElementsByName("BatchHistoryEntry")

    Print #iFile, vbTab & "ModuleID: " & oBatchHistoryEntry.AttributeValue("ModuleID")
    Print #iFile, vbTab & "StartDateTime: " & oBatchHistoryEntry.AttributeValue("StartDateTime")
    Print #iFile, vbTab & "EndDateTime: " & oBatchHistoryEntry.AttributeValue("EndDateTime")
    Print #iFile, vbTab & "State: " & oBatchHistoryEntry.AttributeValue("State")
    Print #iFile, ""

Next oBatchHistoryEntry

Close #iFile 

Applies to:

Product Version Category
CAPTURE 6.0 Workflow Agent
CAPTURE 6.1 Workflow Agent
CAPTURE 7.0 Workflow Agent
CAPTURE 7.5 Workflow Agent
CAPTURE 8.0 Workflow Agent
CAPTURE 9.0 Workflow Agent