You are here: Using BML > Functions & Scripts > Arrays & Array Functions Overview

Array & Array Functions Overview


CPQ Cloud declares, initializes, populates, and manipulates arrays using BML. An array is an ordered collection of values, referenced by a single variable name. Think of an array as a table, with values in rows and columns. Another way to think of arrays is in relation to an x-y axis. If you recall, data sets are formatted as (x, y). Data in arrays is similar:

(row, column)

(x, y)

("color", "shape")

Closed1-D Array

The index indicates the position of the value within the array. So, if we were looking for Value 7 within the array, its location is Index 6. Indexes are zero-based in BML, meaning that the first element will always have an index of 0 and the last element will have an index of i(number of element). For more information, see 1-D Arrays.

Closed2-D Array

There are also 2-dimensional arrays. These arrays can be thought of as a grid or a table with multiple rows and columns. The convention for defining and accessing these arrays is [row, column]. For more information, see 2-D Arrays.


ClosedArray Attributes

What are array attributes? Array attributes are used to allow users to easily group multiple, scalar attributes using a single data structure and are available both for the selection and configuration process. Similar to other configurable attributes, you can create array attributes at all levels in the configuration hierarchy, but can delete them only at the level in which they were created. You can create array attributes for all the available data types (Float, Integer, String).

Example of an array attribute (user-side): In the example below, the user had selected that three floors needed to have their elevators configured. From this one screen, you can individually configure each elevator. As you can see, each one has a different combination of door type, door trim and buttons.

Control Attribute: This size of arrays are defined by the control attribute. When creating a control attribute, the attribute itself must have a Data Type of integer and you must make sure that the Array Type box is NOT checked. In the case below, the user wants to configure 27 floors. Number Of Floors is the control attribute.

Before You Begin:

Here is some general information regarding arrays that you should know before you get started. Another way to think of an array is as a 1-D or 2-D table.

Closed1-D table of an array attribute

Closed 2-D table of an array attribute

ClosedBML Array Syntax


ClosedIndex values in a 1-D array

Closed Index values in a 2-D array

ClosedPopulating Arrays

Examples of how to populate 1-D and 2-D arrays using a for...loop.

Closed1-D Arrays

Closed2-D Arrays


    BML size limits have default settings. The default row size is 5000. The default column size is 50.

    To increase the default row and column size, open a ticket on My Oracle Support.
    NULL and blank Integer values are treated as separate values.

    - NULL= 0
    - Blank = ""

    If you use logic that tests for NULL values in rule conditions or BML, this logic should be updated.

    Using "null" as an attribute value is strongly discouraged.


Related Topics Link IconSee Also