Business Rules

Business Rules contain calculation logic configured to run against different parts of an application. These rules are compiled with VB.NET or C# code and are created within a rich integrated development environment, or IDE.

Download the OneStream API Overview Guide and OneStream API Details and Database Documentation from MarketPlace for detailed Business Rule engine background, an API guide and information on each database related to OneStream.

There are several areas in the product using the exact same rule syntax and applying it to how data is imported, how the Cubes are calculated, and other operations.  Once this syntax is understood, logic can be written. 

There are three ways to write this calculation logic:

Business Rules

Business Rules are found under the Application Tab|Tools. There are nine types of Business Rules as shown below. These can be stored, secured, and then assigned to multiple areas of the product with the ability to re-use them.

Complex Expression

This logic can be created as a Business Rule or as a Complex Expression from within an application artifact such as a Data Source. The syntax is the same with the only difference being that a Business Rule can be shared across multiple application artifacts where a Complex Expression is contained within the artifact.

Member Formula

The same Business Rule syntax can be applied to Member Formulas as well. This logic stays with the Member and cannot be shared.

There are also three utility groups available when writing Business Rules:  

BRAPI

BRAPI provides application programming interface to commonly used functions involving all areas of the product where a Business Rule can be used.

API

The more specific API provided as a Parameter to a Business Rule provides functions specific to the type of Business Rule being written. For example, when implementing a Business Rule for a finance-oriented task, API refers to the functions used for processing calculation logic and other capabilities related to processing a Cube's data and metadata.

ARGS

An argument represents the value passed to a Business Rule when the procedure is called and the calling code supplies the arguments.  For example, if a Parser Business Rule is assigned to the Account Dimension, args will supply the Account Dimension data as well as a set of functions available to use against that data. Different args will be provided depending on the type of Business Rule used.

Business Rule Encryption (Decryption)

There is also functionality to Encrypt and Decrypt Business Rules with password protection when writing and saving Business Rules.  

The authorized user can Encrypt Business Rule by clicking the encrypt button.

Once clicked, an Encrypt Business Rule dialog will display prompting the user for a password. The user will create and enter the password and then Re-Enter the password in the box below and click OK. The system encrypts the Business Rule, displays “Business Rule Is Encrypted” message text in the editor and the editor is in read only mode.

NOTE: It is important to remember and record the password being used for each Business Rule being encrypted or the Business Rule will not be able to be decrypted for further changes without the assistance of OneStream Support.

To Decrypt a Business Rule, an authorized user can Decrypt Business Rule by clicking the Decrypt button . At this time, the Decrypt Business Rule dialog box will display prompting the user for a password. User will enter the password and click OK. The system will decrypt the Business Rule, display the Business Rule text editor and then return to read/write mode again.

Set the proper access to Encrypt Business Rules to allow an authorized user to Encrypt and Decrypt a rule from the Business Rule screen in the Application tab, if the user is in the role.

Next advance to the Business Rules section (Application Tab>>Tools>>Business Rules) and Refresh the screen and the Encrypt Business Rule button will appear in the menu.

Select the Business Rule to be encrypted, then select the Encrypt Business Rule button. 

At this time, an Encrypt Business Rule dialog will display prompting the user for a password.

The user will create and enter the password, then Re-Enter the password in the box below and click OK.

The system encrypts the Business Rule, displays “Business Rule Is Encrypted” message text in the editor and the editor is in read only mode and the Decrypt Business Rule button is now displayed in the menu bar.

To Decrypt a Business Rule, an authorized user can Decrypt Business Rule by clicking the Decrypt button . At this time, the Decrypt Business Rule dialog box will display prompting the user for a password.

User will enter the password and click OK.

The system Decrypts the Business Rule displays the Business Rule text editor and the Business Rule is in read/write mode again.

Business Rule Search

Find a business rule quickly by performing a search instead of scrolling through business rules.

  1. Select the Application tab.

  2. From Tools, select Business Rules.

A screenshot of a cell phone  Description automatically generated

  1. Click Business Rule Search. The Object Lookup dialog box opens.

  2. Start typing the start of the business rule name. All business rules that match your text display in the list.

A screenshot of a cell phone  Description automatically generated

  1. Select the business rule from the list and click OK.

Business Rule Toolbar and Hotkeys

Compile Business Rule to Check Syntax

Use this to compile a selected Business Rule in order to check its syntax.

Compile All Business Rules and Formulas to Check Syntax

Use this to compile all Business Rules and Formulas in order to check syntax. This is most commonly used after installing a software upgrade where some Rule or Formula syntax may have changed. This feature is only available for application administrators.

Execute Extender

Use this to run the selected Extender Business Rule

 

Encrypt Business Rule

Use this to Encrypt the Business Rule formula. Clicking this button will be prompt the user to enter a password in the Encrypt Business Rule dialog box to complete the encryption process.

Decrypt Business Rule

Use this to Decrypt the Business Rule formula. Clicking this button will be prompt the user to enter a password in the Decrypt Business Rule dialog box to complete the encryption process.

Ctrl+M

Expand /Collapse all regions and methods. Click in the script after selecting the Business Rule in order to use the hotkey.

Business Rule Client Image Types

Client images are specified via a XFClientImageType Class in a Business Rule. These images can display on certain Dashboard Parameter Components such as Buttons, Maps, SQL Table Editors, Grid Views, etc. 

The Image Types are as follows:

  • StatusGrayBall

  • StatusWhiteBall

  • StatusOrangeBall

  • StatusBlueBall

  • StatusRedBall

  • StatusLightGreenBall

  • StatusGreenBall

  • StatusGrayCheckMark

  • StatusGreenCheckMark

  • StatusLockedWithCheckMark

  • StatusLockedWithFolder