No Calculate Rule running on all workflow steps
- 7 months ago
Hi Richard_Mayo,
You'll hopefully find the answer to your question on the above options given by aformenti.
However, if that's not the case, or you need something a little bit more dynamic / custom, here is another option you could explore:
As you probably know OS does not trigger sequences on No Calculate by default, that sequence is triggered via a custom function defined as part of the DataQualityEventHandler.
Having said that, you could update this custom function (that triggers the sequences defined on the No Calculate) to only trigger it if a certain criteria is met. The criteria could be for example: if the Workflow step is a base step or of a certain type, if there's a specific Text property defined, if it follows a specific naming convention, if the name matches the one passed on as a parameter, etc, etc.
- 7 months ago
That's a good idea Fred,
See below a screenshot of an slide explaining what Fred means:
The code would be something like this:
#Region "ProcessCube.NoCalculate Helpers" Private Sub OSB_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. ' *******Note******** This is designed to prevent a DM job from triggering more than ' once for range scenarios that span multiple years. ' 'Usage: Used to kick off a DM job specified in a No Calculate calculation definition and pass the entity filter ' specified on the calculation defintion to the entity filter in the data mgmt job. '------------------------------------------------------------------------------------------------------------ Try 'Get the DataUnitInfo from the Event arguments so that we can get the name of the DataManagement sequence to process. Dim calcInfo As DataUnitInfo = DirectCast(args.Inputs(2), DataUnitInfo) Dim WfUnitPK As WorkflowUnitPk = DirectCast(args.Inputs(0), WorkflowUnitPk) If Not Brapi.Workflow.Metadata.GetProfile(si,WfUnitPK.ProfileKey).IsInputChild If Not calcInfo Is Nothing Then 'Make sure that a Sequence name is assigned to the filter value of the Calc Definition of the executing Workflow Profile If calcInfo.FilterValue <> String.Empty Then 'set the passEntityCalcDef variable to true if there is a need to pass the calculation definition entity value to the DM job Dim passEntityCalcDef As Boolean = False 'dictionary of DM job params Dim dmParams As New Dictionary(Of String, String) 'if we want to pass the entity from the calc def to the DM job, specify a parameter on the DM job called ParamEntity If passEntityCalcDef Then 'pass the entity from the calc def to the ParamEntity parameter on the DM job. Swap ParamEntity with your custom parameter name dmParams.Add("ParamEntity", calcInfo.DataUnitNames.EntityName) End If Dim varScenarioID As String = calcInfo.DataUnitIds.ScenarioId Dim wfTracking As WorkflowTrackingFrequency = BRApi.Finance.Scenario.GetWorkflowTrackingFrequency(si, varScenarioID) 'if the workflow tracking frequency is range, ensure we are only executing a DM sequence for the first year in the range If wfTracking = WorkflowTrackingFrequency.Range Then Dim processedYear As Integer = BRApi.Finance.Time.GetYearFromId(si, calcInfo.DataUnitIds.TimeId) Dim wfStartTime As Integer = BRApi.Finance.Scenario.GetWorkflowStartTime(si, varScenarioID) Dim firstWFStartYear As Integer = BRApi.Finance.Time.GetYearFromId(si, wfStartTime) If processedYear = firstWFStartYear Then 'Now, execute the DataMgmt Sequence that was specified in the FilterValue (In a background thread) BRApi.Utilities.StartDataMgmtSequence(si, calcInfo.FilterValue, dmParams) End If 'non range scenarios Else 'Now, start the DataMgmt Sequence that was specified in the FilterValue (In a background thread) BRApi.Utilities.StartDataMgmtSequence(si, calcInfo.FilterValue, dmParams) End If End If End If End If Catch ex As Exception Throw ErrorHandler.LogWrite(si, New XFException(si, ex)) End Try End Sub #End Region