Forum Discussion
Oscar
2 years agoContributor
hello
Yes, as a new business rule. OneStream will automatically save it under Extensibility Rules folder as WcfEventHandler. Do not chance the name or try to move the business rule. The code below is originally provided by OneStream at the time of creation
Imports System
Imports System.Collections.Generic
Imports System.Data
Imports System.Data.Common
Imports System.Globalization
Imports System.IO
Imports System.Linq
Imports System.Windows.Forms
Imports Microsoft.VisualBasic
Imports OneStream.Finance.Database
Imports OneStream.Finance.Engine
Imports OneStream.Shared.Common
Imports OneStream.Shared.Database
Imports OneStream.Shared.Engine
Imports OneStream.Shared.Wcf
Imports OneStream.Stage.Database
Imports OneStream.Stage.Engine
Namespace OneStream.BusinessRule.WcfEventHandler.WcfEventHandler
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As WcfEventHandlerArgs) As Object
Try
Dim returnValue As Object = args.DefaultReturnValue
args.UseReturnValueFromBusinessRule = False
args.Cancel = False
Dim wfScenarioName As String = ScenarioDimHelper.GetNameFromID(si, si.WorkflowClusterPk.ScenarioKey)
BRApi.ErrorLog.LogMessage(si, $"DMx: {wfScenarioName}")
If (args.WcfServiceType = WcfServiceType.Calculate) Then
If args.OperationName.XFEqualsIgnoreCase("CalculateChartLogic") Then
If args.IsBeforeEvent Then
'Dim insertFailed as Boolean
'ErrorHandler.InsertErrorLogItem(si, XFErrorLevel.Information, "Before " + args.OperationName, XFTier.AppServer, String.Empty, String.Empty, String.Empty, insertFailed)
Else
'Dim insertFailed as Boolean
'ErrorHandler.InsertErrorLogItem(si, XFErrorLevel.Information, "After " + args.OperationName, XFTier.AppServer, String.Empty, String.Empty, String.Empty, insertFailed)
End If
End If
End If
Return returnValue
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
End Class
End Namespace
Related Content
- 6 months ago
- 11 months ago