Return to main navigation Page
BML (BigMachines Extensible Language) is a scripting tool that is used to capture a company's complex business logic within CPQ Cloud 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.
What 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 Function Editor Basics.
What 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 Dynamic BMQL Variables.
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.
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.
BML has characteristics of both languages. It’s a Java based mark-up language, so it does need to be compiled, but that is done within the application.
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:
Basic 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:
Common Statement Elements
|;||Represents and end statement. This is required on each line of code.|
|//||Indicates a comment line.|
|return||This is the beginning of the return statement which is required at the end of your code. BML will not process instructions without it.|
|This function displays all data types in the console to make debugging easier. You can give it direct inputs or have it print variables and results from other functions. It displays as purple in the Debugger|
You may also see the element
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.
Basic 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.