You are here: Using BML > Library Functions

Library Functions

OVERVIEW

The BML Function Library enables the user to write efficient and reusable custom BML functions. The user can write and store BML functions in a central library and call these functions from different areas in CPQ Cloud.

ADMINISTRATION

ClosedUsing Library Functions in Configuration BML

Once a Util Library Function has been defined, it's available for use in the Library Function(s) tab within the Function Editor.

  1. Click Add Functionsto choose from a list of Util Functions. A pop-up dialog will open.

  2. Click one or multiple Util Functions.

  3. Return to the Util functions area and make sure you've deployed your function(s) if desired function does not appear.

ClosedUsing Library Functions in Commerce BML

When you click Define Function in Commerce, a window will appear asking you to select attributes. You can select System Variable Name, Variable Name for (Quote), Variable Name for (Line), and Library Function(s).


ClosedAdding a Library Function

  1. Click Add Function.
  2. Choose desired function from the drop-down.
  3. Select the square icon to preview the function in the pane to the right.
  4. Select the blue arrow to insert the function into the Script Definition Area.


ClosedAdding a Commerce Library F(x)

  1. Navigate from: Process Definition > Process > Document > Library Functions > List.
  2. Select Add to create a new commerce library function.
  3. Create a Name, Variable Name, Description and choose a Return Type.
  4. SelectAdd in the Parameter(s) section if the function requires parameters. Pick a parameter name and choose a data type.
  5. Reference the parameter in the library function with the name that you specify here.

  6. Select Add Attributes to access the main document attributes in the Main Document Attribute section.

  7. Select Add Attributes to access the sub-document and the system attributes in the Sub-Document Attribute and System Attributes sections.
    1. The Main Document, Sub-Document and System Attributes sections are only available in the Commerce Library Editor. They are not available in the Util Library Function.

ClosedAdding a Util Library F(x)

Navigation: Admin Home Page > Data Tables & Global Functions > BML Library

  1. Create a Name, Variable Name, Description and choose a Return Type.
  2. Add the necessary parameters.

  3. Create your script, adding attributes as necessary.

  4. Select Add to make your new library function available for use.

ClosedFunction to Function Calls

Util and Commerce Library Function Editors use Function to Function calls. Function to Function calls allow admins to compartmentalize BML when dealing with complicated configuration or quoting scenarios. This feature will assist with the organization of BML and provides a solution to the compiled Java class size-limit issue. Function to function calls mimic the behavior of a Modify function calling a Library function.

ClosedAdding a Function to Function Call


ClosedCopy BML Library Function

A “Copy” action button is available in Util and Commerce Libraries so that BML Library Functions can be copied and renamed. This allows admins to manage versions and build new functions based on existing ones.

  1. Navigate from: Admin > Developer Tools > Library.
  2. Select a Util or Commerce Library.
  3. Select the BML function you wish to copy by clicking its corresponding checkbox.

  4. Click Copy at the bottom of the page.

  5. Rename the function.
    1. Changes can be made to the copied function, since it is a new and independent function.

NOTES

RELATED TOPICS

Related Topics Link IconSee Also