Info

Method name: Attribute Update

This step saves attribute values in line item fields (both V1 and V2 attributes are supported). Use this step when:

  • any Attribute Based Pricing step is setting attribute values
  • for any reason Product Validation interface is not used for saving attributes when adding to cart

This step does not take any input parameters.

Calculation Matrix Step

Sample attribute vlues data structure

[
    {
        "hierarchyPath": "01tDn0000014DSjIAM",
        "attributes": [
            {
                "code": "VEPC_ATTR_DOWNLOAD_SPEED",
                "value": "250 Mbps"
            },
            {
                "code": "VEPC_ATTR_UPLOAD_SPEED",
                "value": "250 Mbps"
            },
            {
                "code": "VEPC_ATTR_MONTHLY_DATA_CAP",
                "value": "1 TB"
            },
            {
                "code": "VEPC_ATTR_CONTRACT_TERM",
                "value": "Month-to-Month"
            }
        ]
    },
    {
        "hierarchyPath": "01tDn0000014DSjIAM<01tDn0000014DS6IAM",
        "attributes": [
            {
                "code": "VEPC_ATTR_NUMBER_OF_STATIC_IP_ADDRESSES",
                "value": "2"
            }
        ]
    }
]

Sample code to set attribute values for update

List<Map<String,Object>> attributeValuesList = getAttributeOverrideList( input, itemList );

if( !attributeValuesList.isEmpty() ){
    Map<String,Object> pvwInput = new Map<String,Object>{ 'AttributeValues' => attributeValuesList };
    Map<String,Object> pvwOutput = new Map<String,Object>();

    ProductValidationWrapper pvw = new ProductValidationWrapper();
    pvw.invokeMethod( 'setAttributes', pvwInput, pvwOutput, null );
}