Does anyone have any sample code they can share to see how to trap errors during an automated dataload process? Currently, all I can see is that the dataload process executed and completed but it do...
Here's an example that executes a direct connect import and captures the status. If the status of wfUC_Import contains an error, the code logs the message, sends out an e-mail, and exits the rule. If no error is found, it logs a successful completion and moves on to the next step.
Here's the actual code:
'Define the Workflow unit cluster Dim wfUC As WorkflowUnitClusterPk = BRApi.Workflow.General.GetWorkflowUnitClusterPk(si, wfChannelName, ScenarioName, TimeName)
'Execute Data management load to process the workflow channels
'Excecute direct connection load method Dim wfUC_Import As LoadTransformProcessInfo = BRApi.Import.Process.ExecuteParseAndTransform(si, wfUC ,"NA", Nothing, LoadMethod, directConnection, False) logMsg = "Import: " & wfUC_Import.LogMessage & vbCrLf If wfUC_Import.HasError 'Update the log message and Send e-mail on error logMessage += ">>> " & wfUC_Import.LogMessage & vbCrLf logMessage += "Import step has errors. Click the [Refresh Application] button in the top right corner to proceed." Me.SendNewMemEmail(si, globals, api, args, timeName, wfChannelName, harvestFilePath, "Error", logMsg) GoTo GetOut Else logMessage += ">>> Import step " & wfUC_Import.Status.ToString & ". Row count=" & wfUC_Import.RowCount & ". Duration=" & wfUC_Import.FullProcessDuration & " Milliseconds." & vbCrLf & vbCrLf
End If '********* debug info ********* If debugSwitch = True Then brapi.ErrorLog.LogMessage(si,"Import: " & wfUC_Import.LogMessage) '******************************