BML Overview

Overview

BML (BigMachines Extensible Language) is a scripting tool that is used to capture a company's complex business logic within Oracle CPQ Configuration and Commerce. BML is based of many different programming languages.

You will see syntax that is familiar in Java, Basic, Python, and C++, but they aren’t exactly the same. After reading the section on BML, you should have a good understanding of what programming language is and how it’s used and structured. You should also understand the syntax of BML and have generated some very basic and functional code.

ClosedWhat is a function?

A function is usually defined as a rule that relates one variable value to another. In programming, it also represents a series of commands that perform an action or calculate a value depending upon certain parameters. Parameters are the values that the function uses. But, not all functions require parameters. For more information, see the topic Function Editor Basics.


ClosedWhat is a variable?

Variables are placeholders for the data, which a program may use or manipulate. They are given unique names so that they can be assigned values and referred to throughout the source code. In order to use a variable, you must declare it by giving it a unique name. In many programming languages, once a variable is declared, it must be initialized. However, in BML, these two steps occur simultaneously.

Variables can be used for Column names, Table names, and WHERE clauses. For more information, see the topic Dynamic BMQL Variables.


Administration

ClosedProgramming Language

A programming language is an artificial language that is used to write instructions that a computer can understand. Programming languages can be broken down into two groups:

1. Compiled programming: this is a language that must be converted into machine language, after it’s been written by the programmer, so that a computer can understand and execute the instructions. These languages require the use of special software (called a compiler) prior to being executed.

Compiled programming

2. Interpretive programming: this language do not have to be compiled. The computer understands and executes the instructions while the program is running. See examples below.

Interpretive programming


ClosedProgramming Structure

BML follows the Structured computer programming model (not Object-Oriented model). Structured programming uses blocks of code that are executed one after the other. They include control statements which dictate the flow, or when these statements are executed. Almost all structured programming, including BML, shares a similar overall structure. They include:


ClosedBasic Data Types

Almost all programming languages include the use of data types. A data type determines the values that a variable can contain and how it is executed. A data type also represents a constraint placed on the interpretation of data. There are four basic data types:


ClosedCommon Statement Elements

You may also see the element return "";. This will return an empty String if there isn’t anything to return. It will only return a String (signified by double quotation marks), not an Integer, Float, Boolean, or Array.


ClosedBasic BML Syntax

The basic structure includes statements that comprise the source code and ends with a return statement. The example below shows variables, print statements, and a return statement.

Basic BML syntax

NOTES

Beginning in Oracle CPQ 20A, the BML script compiler is enhanced to automatically utilize StringBuilders during the internal processing of BML functions. This can result in a larger compiled script size. During internal processing, a BML script size limit is enforced. This may affect users attempting to update functions depending on the implementation of their site. If you want to learn more or disable the BML complier optimization enhancement, submit a Service Request (SR) on My Oracle Support
HTML attributes are not able to be set using a BML function.

Related Topics

Related Topics Link IconSee Also