Business Rule Compile Error and Warnings
OneStream Platform releases will periodically include an update to the Business Rules compiler, which is noted in each version’s Release Notes. The enhancements typically make the compiler stricter in detecting syntax or other conditions, which are surfaced through Error or Warning messages.
Error messages must be resolved, as the Business Rules will not complete the compile process.
Warning messages are exposed to provide guidance to the Administrator. The displayed line items will still function but should be updated to support the latest compiler’s requirements. The method to resolve the Warning will vary. In some cases, a replacement function may be available, or there may be a change to a function’s properties.
Example
The above error message informs the Administrator of a Warning on the LookupRowFieldValue function having a property change. By reviewing the current rule, and by looking at the current Function Definition, the Administrator can determine that the property for “Criteria as a String” has been modified. The current Definition now defines the field as a dbWhere object.
Old Properties
LookupRowFieldValue(ByVal si As SessionInfo, ByVal dbLocation As String, ByVal tableName As String, ByVal criteriaExpression As String, ByVal fieldToReturn As String, ByVal defaultValue As String) As String
To correct the condition, the Administrator is required to apply the required change. In this example, a dbWhere object must be used to define the criteria against the target database table.
New Properties
LookupRowFieldValue(ByVal si As SessionInfo, ByVal dbLocation As String, ByVal tableName As String, ByVal dbWheres As List(Of DbWhere), ByVal fieldToReturn As String, ByVal defaultValue As String) As String
Other Compile Issues - Namespaces
The Vb.Net language in OneStream offers the designer flexibility to implement custom solutions using predefined libraries as well other compatible third-party libraries.
During a Business Rules compile, there are NameSpaces in OneStream that will be implicitly compiled:
- microsoft.visualbasic
- system.linq
- system.collections.generic
- system.collections
- system.text
OneStream also has predefined Namespaces in Business Rules, which if utilized, must not be removed from the rule to compile properly.
- Imports System
- Imports System.Data
- Imports System.Data.Common
- Imports System.IO
- Imports System.Collections.Generic
- Imports System.Globalization
- Imports System.Linq
- Imports Microsoft.VisualBasic
- Imports System.Windows.Forms
- Imports OneStream.Shared.Common
- Imports OneStream.Shared.Wcf
- Imports OneStream.Shared.Engine
- Imports OneStream.Shared.Database
- Imports OneStream.Stage.Engine
- Imports OneStream.Stage.Database
- Imports OneStream.Finance.Engine
- Imports OneStream.Finance.Database
The solution to resolving a Namespace issue will depend upon whether the rule exists in a Member Formula or as part of a Business Rule file.
When an unsupported Namespace is used in a Business Rule file, the Namespace can be added to the Imports to allow the Business Rules to compile.
Member Formulas do not allow access to modify the Import section of Business Rules. If the unsupported Namespace is part of a Member Formula, then the full Namespace must be added to the affected expression or variable.