obsolete functions

vnareny
New Contributor II

Hi, All

Any insights or suggestions on how to resolve these obsolete functions after update (we are currently 7.4.2) would be greatly appreciated.

Dashboard Extender:

  • Public Overloads Function GetBusinessRules(si As SessionInfo, brType As BusinessRuleType) As List(Of BusinessRuleSummaryInfo)' is obsolete: 'This is a temporary function used by Marketplace Solutions for backwards compatibility with old XF versions. Please change your code to use supported functionality.'.
  • Public Shared Overloads Sub SetCultureInfoForUserToThread(si As SessionInfo, thread As Thread)' is obsolete: 'This is a temporary function used by Marketplace Solutions for backwards compatibility with old XF versions. Please change your code to use supported functionality.'.

Connector: 

  • Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.

 

Thank you in advance! 

8 REPLIES 8

Krishna
Valued Contributor

Hi @vnareny  - It is part of marketplace if so, you have to update your OS Marketplace solution as well.

Thanks
Krishna

sameburn
Contributor

MarcusH
Contributor III

I am not sure what is going on with these 2 functions. Certainly in the V8 compatible MarketPlace apps where GetBusinessRules is used (and the Rules are not encrypted), they still use the deprecated functions (I checked RCM and RPTA). It looks like the GetBusinessRule function is only used to delete BRs associated with a solution. If you want to get rid of that annoying warning message I think you will have to execute direct SQL calls on the BusinessRule table. It's a simple table so it should not be difficult. I don't know about the others.

RobbSalzmann
Valued Contributor

The first two are deprication/obsolecence  warnings written by OneStream on internal API functions, probably displayed while you are compiling a Dashboard Extender business rule. 

The message is confusing because whether or not the business rule is part of a MarketPlace solution is irrelevant to compiling it. 

The message is text the developer who wrote the message used in a tag somewhere in the source code.  Its unfortunate the important information such as what function to use instead is not also part of the message. 

It would help if it said: GetBusinessRules(SessionInfo si, BusinessRuleType brType) is obsolete.  It is replaced by NewFunction(new parameters)

The third message is also a compiler warning, written by Microsoft.  You are probably compiling VB.net because the code this warning refers to would throw an error in C#. 
This usually happens when assigning a new instance of something that is "shared" to a variable: This is because shared (static) objects are only instantiated once (using New) and shared by all other objects.  So declaring it as a new object is redundant since you're still pointing at the shared instance.


Post the code that is giving the error and we can help you correct it to eliminate the warning.

JackLacava
Community Manager
Community Manager

Both those methods are technically internal, you should not have been using them in the first place... 😁

SetCultureInforForUserToThread, in particular, really should not be used and I can't imagine what sort of use-case one would have for that. Code should respect the choice of Culture expressed in Security, not override it.

As for GetBusinessRules, it's probably a victim of the ongoing move to Workspaces, since it assumes the old architecture. At the moment I can't say if there is an equivalent supported interface (did you try passing a Workspace ID...?); I would expect there might be ways to query the new WsAssemblyService machinery (which can be discovered from objects representing Workspaces and Maintenance Units in the public api) to fetch those, but right now I don't know the correct answer. Looking stuff up in the database is probably the safer approach for now.

If these messages are generated by supported Marketplace Solutions, they will be addressed in future releases. As @sameburn mentioned, there is documentation on which solutions are actually compatible with v8.

The last message, as @RobbSalzmann said, is just a compilation issue. Robb himself addressed it in this thread: https://community.onestreamsoftware.com/t5/Rules/Referencing-C-Workspace-Assemblies-from-VB-Net-Warn...

Krishna
Valued Contributor

@JackLacava  Thanks and it was helpful. Is there a documentation for the same. Not just for this scenario other scenarios if there are any.

Thanks
Krishna

vnareny
New Contributor II

True. Thanks for the information, JackLacava. The compiling error for GetBusinessRules are coming from the RPTA, SNE, and XLI rules after the update. SetCultureInforForUserToThread  it's from the OSD rule and just wanted to get more information about the compiling messages. 

MarcusH
Contributor III
  • Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.

I found that you get this error when a variable is called the same thing as a function or object. A simple example is resizing an array of strings using the Array command:

Array.Resize(array, array.Length + 1)

The variable is called array and the function is called Array. Change the name of the variable to for example myarray and the warning goes away.