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 Jack, thanks a ton for your response, it was very informative, especially regarding global variables and their shortcomings. Based on the responses I've received I now understand that using a global variable is not a good option for accomplishing what I'm trying to accomplish.
I understand what you are saying about using a referenced assembly to call functions in the finance BR from the connector BR. I did in fact try this, but we are using the finance rules api in the function, so I am not able to pass in the correct api since connector BRs use a different type of api. Unless there's a way to use the finance rules api in the function without passing it in via the parameter, I don't think it will be possible to implement your suggestion.
Finally, we are actually using the finance BR in conjunction with a data adapter - the data adapter calls a DDS BR that calls the finance BR function. Again, I believe this is because we need to use api functions in the generation of the datatable, which is not possible with the api object provided with a DDS BR (as far as I know). I mentioned in another reply my issues with trying to query the method command of the data adapter, but I believe that approach would be more closely aligned with what you are saying.
Anyways, thanks for your response (and your helpful presence in the community). Final question - is "thang" official OneStream syntax? ๐
JackLacava
OneStream Employee
2 years agoYes, in a DDS you won't be able to use an api object of the same type as in a Finance rule (without contortions we don't want to go into).
I've read your other response, which mentions not having to rewrite the datatable-generating code, and I understand (although I'm pretty sure that, whatever it is that code does, it can be done without the Finance Api in one way or another. BRApi.Finance has pretty much everything you'd ever need...)
My suggestion then would be: in your Finance rule, you can dump your DataTable to an actual custom database table, which you can then read from elsewhere:
BRApi.Database.SaveCustomDataTable(si, dbLocation, tableName, dt, useBulkInsert)
You will have to manage the lifecycle yourself, though (checking if it exists already, and deciding when it's time to delete it or recreate it) - definitely not as quick as doing it in memory, but not too hard.
Worst of the worst: you can write it to a file, but it might be very slow (then again, it might be fast enough).
adykes wrote:Final question - is "thang" official OneStream syntax? ๐
Ain't nuthin' but a Jack thang ๐ it's like this and like that and like this and uh...
- adykes2 years agoNew Contributor III
Yes, I'm aware that I could probably re-write whatever's in that finance rule with BRApis instead of apis, but I will gladly take the more simple approach of creating a custom database table, if it's possible (unsure yet if the application security settings will allow it). Do you know what functions I can use to delete it? I checked the BRApi available functions and am only seeing functions for saving the datatable.
Again, thank you so much for your guidance, and your lyrical genius :microphone:
Related Content
- 9 months ago
- 3 years ago