Loading
保险
InsProductService:runRules

InsProductService:runRules

使用此服务在产品上运行规则,而无需重新定价该产品。

类:InsProductService

方法:runRules

工作原理

  1. 该服务会搜索输入 JSON 的selectedProduct密钥。

  2. 在 selectedProduct 节点上运行规则。

    运行哪些规则集取决于将哪些远程选项设置为真。

  3. 返回 JSON,其中包含添加到selectedProduct节点的规则结果。

远程选项

选项

说明

ruleAttributeSetValues

true 或 false

默认为 true。

如果为真,服务将运行属性集值规则。

evalOptionalCoverageRelationship

true 或 false

默认为 false。

当此选项设置为true时,服务会根据可用规则评估可选承保范围关系,并更新受影响的可选承保范围记录上的isSelected标志。

runDefaultSelected

true 或 false

在设置为真时,为选定产品运行默认选定承保范围规则。

runEligibility

true 或 false

在设置为真时,为选定产品运行资格规则。

如果规则评估为false,服务会将可选覆盖范围中的isEligible节点设置为false。

runRequiredCoverage

true 或 false

在设置为真时,运行可选承保范围所需承保范围规则。

validateCoverageSelection

true 或 false

默认设置为假。

当此选项设置为true时,服务会根据可用规则验证可选承保范围选择。

如果规则评估为假,服务会将消息节点添加到受影响的可选承保范围记录。

输入 JSON

此服务在其输入 JSON 的 selectedProduct 键中查找产品对象。此对象可由其他服务创建,例如 getRatedProducts。它包括根产品、子产品和孙产品。

在服务运行规则之前,此示例仅包含一个输入节点。


"Name": "Accidental Death",
                    "Description": "An accidental death benefit rider also known as a double indemnity clause provides a higher death benefit to the beneficiaries of the policy in case the insured dies because of an accident. The death benefit is generally a multiple of the face value of the base coverage.",
                    "Family": "Individual Life",
                    "ProductCode": "ADDCOV",
                    "LineOfBusiness__c": "Individual Health",
                    "Type__c": "Coverages",
                    "IsRecommended__c": false,
                    "PricingSource__c": "premiumADD",
                    "RecordTypeName__c": "CoverageSpec",
                    "IsConfigurable__c": true,
                    "productId": "01t1U000000OEamQAG",
                    "pciId": "a2w1U0000001G4YQAU",
                    "selectValidationCriteria": "[{\"expression\":\"WOP.isSelected == true\",\"code\":\"code_0\"}]",
                    "selectValidationMessage": "[{\"message\":\"WOP must be true\",\"severity\":\"INFO\",\"code\":\"code_0\"}]",
                    "isOptional": true,
                    "isSelected": true,
                    "parentInstanceKey": "Jack Kirkland",
                    "Price": 358,
                    "pathFromRoot": "[0].childProducts.records[2].childProducts.records[2]",
                    "formattedParentInstanceKey": "jack-kirkland",
                    "parentProductName": "Jack Kirkland",
                    "originalIndex": 2,
                    "numberCategories": 18,
                    "numberAttributes": 18,
                    "popoverOpen": false,
                    "isOriginalOptional": true,
                    "isAddedOptional": true,
                    "showTypeHeader": true,
                    "displaySequence": 1                 

preTransformBundle 替代方案

或者,您可以定义 Omnistudio 数据映射器转换,将传输到输入 JSON 的数据映射到服务需要的形式。此数据映射器的输出 JSON 是 runRules 所需的selectedProducts节点。将此服务添加到 OmniScript 时,请将 preTransformBundle 设置为数据映射器的名称,以便服务使用数据映射器。

输出 JSON

该服务返回与selectedProduct节点中相同的 JSON 结构,其中包含规则运行的结果。有关此对象的内容和结构的详细信息,请参阅产品 JSON 结构模型。

在服务运行规则后,此示例仅包含一个输出节点,其中包含规则运行的结果。

"messages": [
                    {
                      "code": "code_0",
                      "severity": "INFO",
                      "message": "WOP must be true"
                    }
                  ],
                  "displaySequence": 1,
                  "lastNonOptional": true,
                  "firstOptional": true,
                  "Id": "01t1U000000OEamQAG",
                  "Name": "Accidental Death",
                  "Description": "An accidental death benefit rider also known as a double indemnity clause provides a higher death benefit to the beneficiaries of the policy in case the insured dies because of an accident. The death benefit is generally a multiple of the face value of the base coverage.",
                  "Family": "Individual Life",
                  "ProductCode": "ADDCOV",
                  "LineOfBusiness__c": "Individual Health",
                  "Type__c": "Coverages",
                  "IsRecommended__c": false,
                  "PricingSource__c": "premiumADD",
                  "RecordTypeName__c": "CoverageSpec",
                  "IsConfigurable__c": true,
                  "productId": "01t1U000000OEamQAG",
                  "pciId": "a2w1U0000001G4YQAU",
                  "selectValidationCriteria": "[{\"expression\":\"WOP.isSelected == true\",\"code\":\"code_0\"}]",
                  "selectValidationMessage": "[{\"message\":\"WOP must be true\",\"severity\":\"INFO\",\"code\":\"code_0\"}]",
                  "isOptional": true,
                  "isSelected": true,
                  "parentInstanceKey": "Jack Kirkland",
                  "Price": 358,
                  "pathFromRoot": "[0].childProducts.records[2].childProducts.records[2]",
                  "formattedParentInstanceKey": "jack-kirkland",
                  "parentProductName": "Jack Kirkland",
                  "originalIndex": 2,
                  "numberCategories": 18,
                  "numberAttributes": 18,
                  "popoverOpen": false,
                  "isOriginalOptional": true,
                  "isAddedOptional": true,
                  "showTypeHeader": true,                                             
 
正在加载
Salesforce Help | Article