Other Functions
System Configuration Functions
The following BML functions are used to retrieve System Configuration attribute values from other configured models within the system. These BML functions are available in configuration context only and not available in commerce.
Note: These functions should only be used with System Configurations. System Configurations are BOM hierarchies that contain one or more nested child models.
getsystemdata
Returns a JSON object containing the entire representation of the System Configuration Data.
Syntax:
getsystemdata()
Response Parameters:
id
|
String |
The identifier for this item |
documentNumber
|
Integer |
The document number of the Oracle CPQ Commerce line item for this item.
Value of -1 when this item has not yet been saved to Oracle CPQ Commerce.
|
configAttributes
|
JSON |
If this item identifies a model:
|
children
|
Array |
If the item has children, contains an array of children items. |
conditionIndex
|
Integer |
Index of the innermost containing the Configuration array where this item is found.
Value of 0 if this item is not found in an array.
|
Example:
systemJson = json();
systemJson = getsystemdata();
getsystemattrvalues
This function returns a string containing a single attribute's values from a System Configuration.
Syntax:
getsystemattrvalues(String jsonPath)
Parameters:
jsonPath
|
String |
A string containing the JSON path |
Example
modelValue = String[];
modelValue = getsystemattrvalues("$.configAttributes.attributeVarname");
getsystemmultipleattrvalues
This function returns dictionary key and value string arrays containing attribute values from a System Configuration.
Syntax:
getsystemmultipleattrvalues(Dictionary<String>)
Parameters:
Dictionary with String keys and String values. The values are expected to be JsonPath Expressions.
-
The key should be an identifier for the attributes identified in the associated value.
-
The values are expected to be JSON Path expressions that identify the location of the attribute in the fully expanded system definition (BOM).
Response Parameters:
Returns a Dictionary (key: String, value: String[]) containing attribute values from a System Configuration.
- The keys will be the identifiers provided in the input Dictionary.
- The values will be the configured attribute values of the attribute(s) at the JSON Path expressions associated with the input key.
Example
jsonPaths = dict("string");
put(jsonPaths, "attributeVarname", "$.configAttributes.attributeVarname");
put(jsonPaths, "childAttributeVarname", "$.children[*].configAttributes.childAttributeVarname");
interModelValues = dict("string[]");
interModelValues = getsystemmultipleattrvalues(jsonPaths);
values = String[];
values = get(interModelValues, "attributeVarname");
Notes
- NULL and blank Integer values are treated as separate values:
- Using NULL as an attribute value is strongly discouraged.
- If you use logic that tests for NULL values in rule conditions or BML, confirm that the logic takes this difference into account.
Related Topics
See Also