Calculation Definitions Filter -Data Quality Event Handler
Hello,
I setup a filter on a workflow profile calculation to run a data management job as long as the no calculate is the selected option.
We have a Data Quality Event Handler Business rule to run this; however when I click on process cube, it's running the job twice at the same time.
This is the example of what it's doing when I say it's running twice:
Here it the code from the event handler:
Namespace OneStream.BusinessRule.DataQualityEventHandler.DataQualityEventHandler
Public Class MainClass
'------------------------------------------------------------------------------------------------------------
'Reference Code: DataQualityEventHandler
'
'Description: Event handler method that provides an opertunity to supplement a normal data quality
' action with your own custom functionality.
' (Example: email after ProcessCube or publish report to sharepoint after failed Confirmation).
'
'Usage: Executes when a Data Quality action is run and fires this business rule. If you have written
' code in that handles the specified event operation the code will be executed.
'
'Created By: Tom Shea
'Date Created: 1-30-2013
'------------------------------------------------------------------------------------------------------------
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DataQualityEventHandlerArgs) As Object
Try
'Define a switch to control event processing, since many of these are reference examples we do not want them to run all the time
Dim processEvents As Boolean = False
'Set the default return values
Dim returnValue As Object = args.DefaultReturnValue
args.UseReturnValueFromBusinessRule = False
args.Cancel = False
'Evaluate the operation type in order to determine which subroutine to process
Select Case args.OperationName
Case Is = BREventOperationType.DataQuality.ProcessCube.NoCalculate
'Execute a Data Management job after process cube runs
Me.XFR_HandleProcessCubeNoCalculate(si, globals, api, args)
'Case Is = BREventOperationType.DataQuality.Certify.FinalizeSetCertifyState
'Send an email after a workflow profile executes its certification
'Me.XFR_HandleFinalizeSetCertifyState(si, globals, api, args)
End Select
Return returnValue
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
#Region "ProcessCube.NoCalculate Helpers"
Private Sub XFR_HandleProcessCubeNoCalculate(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As DataQualityEventHandlerArgs)
'------------------------------------------------------------------------------------------------------------
'Reference Code: XFR_HandleProcessCubeNoCalculate
'
'Description: Run a DataMgmt Sequence after the workflow process cube task is run.
' Note: the DataMgmt sequence name is assigned to a Workflow Profile CalcDef filter field
' so this event does not have to be modified, the user can simply edit the CalcDef grid
' for a workflow profile and this business rule will execucte the specified sequence.
'
'Usage: Used to supplement the standard "ProcessCube" functionality associated with a
' workflow profile by allowing a DataManagement sequence to be executed for the workflow profile
' as well.
'
'Created By: Tom Shea
'Date Created: 1-30-2013
'------------------------------------------------------------------------------------------------------------
Try
'Get the DataUnitInfo from the Event arguaments so that we can get the name of the DataManagement sequence to process.
Dim calcInfo As DataUnitInfo = DirectCast(args.Inputs(2), DataUnitInfo)
If Not calcInfo Is Nothing Then
'Make sure that a Sequence name as assigned to the filter value of the Calc Definition of the executing Workflow Profile
If calcInfo.FilterValue <> String.Empty Then
'Now, execute the DataMgmt Sequence that was specified in the FilterValue (In a background thread)
BRApi.Utilities.StartDataMgmtSequence(si, calcInfo.FilterValue, Nothing)
End If
End If
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Sub
#End Region
End Class
End Namespace
This is the first time I am setting up an event like this and I am not very good at business rules, so any suggestions or help would be much appreciated! Thank you
