Forum Discussion
KH1
1 year agoContributor III
Service Factory - Data Management Step
We're moving most of the Business Rules to Workspaces Assemblies under PV 8.4. - We have several Extensibility Rules that are run by multiple Data Management (DM) Jobs like you. - Hence, we include...
- 1 year ago
In addition to Daniel's response, I think it is good practice to use the service factory only as the initial router to point to a single service (file). In that service file I would apply the conditional logic.
In the below example, I call only Data Set and Component Service files from the SF and then apply all the conditional logic in those two files. The actual different data set and component code is then in files in my HelperFiles folder.
KH1
1 year agoContributor III
Namespace Workspace.__WsNamespacePrefix.__WsAssemblyName
Public Class _0_01_SF
Implements IWsAssemblyServiceFactory
Public Function CreateWsAssemblyServiceInstance(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal workspace As DashboardWorkspace, ByVal wsasType As WsAssemblyServiceType, ByVal itemName As String) As IWsAssemblyServiceBase Implements IWsAssemblyServiceFactory.CreateWsAssemblyServiceInstance
Try
Select Case wsasType
Case Is = WsAssemblyServiceType.Component
'Return New WsasComponent()
Case Is = WsAssemblyServiceType.Dashboard
'Return New WsasDashboard()
Case Is = WsAssemblyServiceType.DataManagementStep
Return New Delete_Batch_Folders_Ex_S()
Return New Delete_Dim_Members_Ex_S()
Return New Direct_WF_Cube_Ex_S()
Case Is = WsAssemblyServiceType.FinanceCustomCalculate
Return New Act_Copy_Scenario_Fin()
Case Else
Return Nothing
End Select
Return Nothing
Catch ex As Exception
Throw New XFException(si, ex)
End Try
End Function
End Class
End Namespace
DanielWillis
1 year agoValued Contributor
I would expect that to do/return "Delete_Batch_Folders_Ex_S()" every time and neither Delete_Dim_Members_Ex_S() nor Direct_WF_Cube_Ex_S() would ever be reached.
Every time your logic gets here it will get to "Return New Delete_Batch_Folders_Ex_S()" and then no further lines in this class will be processed as execution is returned to whatever called the step service.
I actually think your core problem is a bit of a lack of understanding of how the language works rather than the service factory complexity (although service factories doesn't help.. sounds like you jumped in the deep end!). You really need some conditional logic here to determine which of these 3 things to execute and when. This would reside in your DMSS class and I would guess the (if or select) condition would be based on something like args.Step.Name (i just made args.Step.Name up). This is the same as you would find in any factory or non factory XFBR or dashboard extender business rule.
Hope that helps. I don't have OneStream in front of me to give more detail and I hope I'm not completely off track!
- Henning1 year ago
OneStream Employee
In addition to Daniel's response, I think it is good practice to use the service factory only as the initial router to point to a single service (file). In that service file I would apply the conditional logic.
In the below example, I call only Data Set and Component Service files from the SF and then apply all the conditional logic in those two files. The actual different data set and component code is then in files in my HelperFiles folder.
Related Content
- 1 year ago
- 13 days ago