Rule Set Combinations API

The Rule Set Combinations API generates a string representation of a boolean expression created by entity filters involved in the passed rule set. When this expression is parsed by substituting the values of context dimensions, the rule set evaluates to true or false and eligibility of offers is determined for a context.

The Rule Set Combinations API call is required if you have rule sets associated with your catalog. If you do not have any rule sets linked to your catalog, you do not need to perform this API call. If this is the case, the CatalogCodeToRuleAssignments node from the response of the Catalog Profile API will be empty.

You can obtain the rulesetId required in the URI of this API from the values of the hash map in the apiResponse.data.catalogCodeToRuleAssignments node in the response body of the Catalog Profile API.

Precondition

You must first run the Catalog Profile API to obtain the rulesetId required in the request body of this API.

URI

/services/apexrest/{namespace}/v3/admin/ruleset/{rulesetId}/rulesetcombinations

HTTP Method

GET

URI Parameters

If you specify just one of these two parameters, it follows the behavior described in the table below and accepts your defined time for the parameter you specified. If you are using one or both parameters, you must specify them with the same values for all of the Populate Cache APIs in this sequence.

Parameter Example Default Optional/Required Notes
effectiveStartTime 2001-07-04T12:08:56 Current date and time Optional effectiveStartTime is the time that you want your cached catalog entries to be effective. It should be in the UTC date-time format. Your effectiveStartTime must occur after the current time for which you are executing the Populate Cache APIs or you will receive an error message.
expirationTime 2001-07-04T12:08:56 effectiveStartTime + TimeToLive Optional expirationTime is the time that you want your cached catalog entries to expire. It should also be in the UTC date-time format. Your expirationTime must occur after your effectiveStartTime or you receive an error message. TimeToLive is a custom setting created in CPQ Configuration Setup. It has a default value of 30 days.

Here is an example of how to pass the URI parameters:

GET /services/apexrest/vlocity_cmt/v3/admin/catalogs/AS-Test-Catalog/rulesetcombinations?effectiveStartTime=2021-07-04T12:08:56&expirationTime=2021-08-04T12:08:56

Remote API

This is an example of how you invoke the API using Apex:

String methodName;
Map<String, Object> input = new Map<String, Object>();
Map<String, Object> output = new Map<String, Object>();
Map<String, Object> options = new Map<String, Object>();

// Setting remote parameters
methodName = 'getRulesetCombinations';
input.put('apiName', 'CMRuleSetCombinations'); // required
input.put('rulesetId', 'a3e4x000000q0KcAAI');    // required
input.put('effectiveStartTime', null);         // optional
input.put('expirationTime', null);             // optional
input.put('methodName', methodName);           // required
input.put('requestURL', '/v3/admin/ruleset/a3e4x000000q0KcAAI/rulesetcombinations'); // required

//remote action invocation
vlocity_cmt.CpqAppHandler appHandler = new vlocity_cmt.CpqAppHandler();
appHandler.invokeMethod(methodName, input, output, options);

Parallel Invocation

You can run this API in parallel for multiple catalogs. For example, if you have 100 catalogs (Catalog1, Catalog2..Catalog 100), you can run the API for all 100 catalogs in 100 parallel threads.

THREAD1 -  GET /services/apexrest/{namespace}/v3/admin/ruleset/rulesetId1/catalogprofile
THREAD2 -  GET /services/apexrest/{namespace}/v3/admin/ruleset/rulesetId2/catalogprofile
......
THREAD100 -  GET /services/apexrest/{namespace}/v3/admin/ruleset/rulesetId100/catalogprofile

HTTP Headers

Header Description
Content-Type application/json

Response Body

This example shows a string representation of a boolean expression created by entity filters involved in the passed rule set.

"( ( DIM_0 == 'V_0_1' ) AND ( DIM_1 == 'V_1_1' ) )"

HTTP Response Codes

Code Description
200 OK
500 Internal Server Error