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(...)
DanielWillis
2 years agoValued Contributor
adykes wrote:
Interestingly enough, the error doesn't happen when I get the global object (i.e. step #3 above) - it happens when I try to reference properties of the datatable, ex.
I think getObject returns nothing rather than generating an error when a variable isn't set so that would be expected.
What I guess is happening is your Finance rule executes the connector rule, your connector rule creates the global var and populates it, your connector rule ends and destroys the global var, then your finance rule tries to access it and its not there. (Why that's different if you use extender rule rather than connector I'm not sure.
Could you try the following?
- In your finance BR create the global variable
- In your connector BR try and set the global variable which you created in your finance BR
- See if you can now see the value of the global var
So hopefully the global var will exist until the finance BR completes and they both have access to it.
adykes
2 years agoNew Contributor III
Hey Daniel,
Thanks for your response. Actually, the role of the rules is the reverse of what you said - I'm creating and setting the global variable in the finance BR, and trying to retrieve it in the connector BR. I tried what you suggested by creating and setting the global variable initially in the connector BR, then overwriting it in the finance BR, then retrieving it in the connector BR. However, this did not work because I still received the same error as in my original post. Thank you anyways! I thought your solution would work.
Related Content
- 9 months ago
- 3 years ago