Business Rule Compile Error and Warnings

JosephChimbolo
New Contributor III

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

JosephChimbolo_0-1644527113050.png

 

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

JosephChimbolo_1-1644527113053.png

 

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

JosephChimbolo_2-1644527113062.png

 

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.

JosephChimbolo_3-1644527113066.png

 

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.

JosephChimbolo_4-1644527113069.png

 

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.

JosephChimbolo_5-1644527113073.png

 

OneStream Product Advocate
0 REPLIES 0