The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
adykes
2 years agoNew Contributor III
Issue With Referencing Global Variables in Connector Business Rules
Hi all,
I am facing an issue regarding my ability to reference global objects between two different business rules, one of which is a finance business rule and the other of which is a connector bu...
- 2 years ago
I haven't used the ExecuteMethodCommand, but it generally looks like it should work. It probably wants the Application Connection Info; BRApi.Database.CreateApplicationDbConnInfo(si).
Access the dataset: Dim dt as DataTable = dtDataSet.Tables(0) (its index based)
Import it: api.Parser.ProcessDataTable(...)
adykes
2 years agoNew Contributor III
Hey db, thanks for your response. Yes, the main goal here is to import data between two cubes. More specifically, I am trying to pull data from a datatable that is being generated by a function in the finance business rule. This function performs various logical checks on the source data in order to fill in additional columns in the datatable, so, while it might be possible to translate this code into another process, I'd rather not have to re-work all that code. Essentially, I need a way to grab that datatable and make it my source data in the connector BR. It's worth noting that the function that's generating the datatable is being called by a data adapter to bring that data into a BI Viewer component, so I tried executing the method command for the data adapter in the code as well:
Using DbConnApp As DbConnInfo = BRApi.Database.CreateFrameworkDbConnInfo(si)
Dim methodTypeId As XFCommandMethodTypeId = XFCommandMethodType.BusinessRule.Id
Dim methodQuery As String = "{USCG_RP_HelperQueries}{CostEstimateDetailReport}{WFTime=2026, WFScenario=RAP_FY26, WFCube=BudFm}"
Dim resultDataTableName As String = "BudFmData"
Dim dtDataSet As DataSet = BRApi.Database.ExecuteMethodCommand(DbConnApp, methodTypeId, methodQuery, resultDataTableName, Nothing)
BRApi.ErrorLog.LogMessage(si, "DataSet Info: " & dtDataSet.Tables.Count)
Return Nothing 'Because I don't know how to convert a DataSet to a DataTable yet
End Using
But I am getting this error on line 9: Unable to execute Business Rule 'BudFm_BudEx_Connector'. Method type 'BusinessRule' requires an open application. I'm not sure if you've seen this error before, but is this approach also not possible?
db_pdx
2 years agoValued Contributor
I haven't used the ExecuteMethodCommand, but it generally looks like it should work. It probably wants the Application Connection Info; BRApi.Database.CreateApplicationDbConnInfo(si).
Access the dataset: Dim dt as DataTable = dtDataSet.Tables(0) (its index based)
Import it: api.Parser.ProcessDataTable(...)
- adykes2 years agoNew Contributor III
Hey db,
I just tried this, and it worked! Thank you so much... I think this is the approach I'm going to go with for the time being. As far as I understand, this approach skirts the need to have global objects because it queries the method command and therefore retrieves the datatable from the dashboard as a temporary object rather than trying to retrieve it in the code itself. Appreciate the help 😀
Related Content
- 9 months ago
- 3 years ago