詳細情報:
InsProductService: runRules
このサービスを使用すると、商品を複製することなく、その商品に対してルールを実行できます。
方法: runRules
操作手順
-
サービスは入力 JSON で
selectedProductキーを検索します。 -
selectedProductノードでルールを実行します。実行されるルールセットは、true に設定されているリモートオプションによって異なります。
-
selectedProductノードにルールの結果が追加された JSON を返します。
リモートオプション
オプション |
説明 |
|---|---|
|
デフォルトは true の場合、サービスは属性セット値ルールを実行します。 |
|
デフォルトは このオプションを [ |
|
true に設定すると、選択した商品に対してデフォルトで選択された補償範囲ルールが実行されます。 |
|
true に設定すると、選択した商品の対象資格ルールが実行されます。 ルールが |
|
true に設定すると、省略可能な必須補償範囲ルールが実行されます。 |
|
デフォルトは false です。 このオプションが [ ルールが false と評価されると、影響を受ける省略可能な補償範囲レコードにメッセージノードが追加されます。 |
Input JSON
このサービスは、入力 JSON の selectedProduct キーから商品オブジェクトを検索します。このオブジェクトは、getRatedProducts などの他のサービスによって作成できます。ルート商品、子商品、孫商品が含まれます。
この例では、サービスがルールを実行する前に 1 つの入力ノードのみが含まれます。
"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 Alternative
または、入力 JSON に渡されるデータをサービスに必要な形式にマッピングする OmniStudio データマッパー変換を定義できます。このデータマッパーの出力 JSON は、runRules に必要なselectedProductsノードです。このサービスを OmniScript に追加するときに、preTransformBundle をデータマッパーの名前に設定して、サービスでデータマッパーを使用できるようにします。
出力 JSON
サービスは、selectedProduct ノードと同じ JSON 構造とルールの実行結果を返します。このオブジェクトの内容と構造についての詳細は、「Product JSON Structure Model (製品 JSON 構造モデル)」を参照してください。
この例では、ルールの実行結果と共にサービスがルールを実行した後に 1 つの出力ノードのみが含まれます。
"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, 