You are here:
InsClaimService:invokeProductRules
Use this service in claim flows to invoke underwriting rules you've added to a product.
For example, if you'd added rules that send claims above a certain dollar amount to an underwriter for approval, this service invokes those rules.
How It Works
- The service finds the claim object based on the
objectIDand extracts the products for that object based on thatobjectID. - Looks for the specified
transitionName. - Runs the rules associated with the product and applicable to the
transitionName.Evaluates each Involved Party instance and/or Involved Property instance separately for each claim product rule.
- If any of the rules evaluate to true, the service executes the Vlocity action specified in those rules.
For example, if the action specifies that a task be created, the service creates a task.
- Looks for the value of the
includeStateTransitionoption. If the value =true, the service looks for the state model for this object, finds thefieldAPINamevalue, and changes that value based on the transition. - Outputs the results of the evaluation for each rule on each Involved Party and/or Involved Property instance.
Remote Options
Option |
Description |
|---|---|
|
If true, the service changes the state field specified in the state model's If false, the service does not do any state transition. |
|
The Claim Id or Claim Coverage Id to be queried. |
|
The state transition name associated with the rules you want to run. The service will run only rules associated with the To find a Transition Name, go to the state model for this object. |
|
If
If |
|
Optional. The state the service transitions the object to when all rules run by the service evaluate to false. The service transitions the object to this state only if |
Output JSON
The service returns the rule evaluation for each instance of an Involved Property and/or Involved Party.
For this example, the inputs are:
-
objectId = claimId
-
transitionName = rule transition name
{
"stateTransit": " updated ClaimStatus__c from Open to Closed",
"canTransitState": true,
"allFalse": false,
"falseRules": {
"Involved Property_a3lf4000000pcFUAAY": [
{
"ruleDetails": {
"instanceKey": "Involved Property_a3lf4000000pcFUAAY",
"involvedItemId": "a3lf4000000pcFUAAY",
"requirement name": "Maximum Aggregation Rule",
"conditions": "Pet.petType == 'dog' AND Pet.petBreed == 'Alaskan Husky' AND ptandev2__InsuranceClaim__c.ptandev2__ClaimStatus__c == 'Open'",
"message": "TestMessage",
"action method": "Product_Rule",
"action class": "IntegrationProcedureService",
"productId": "01tf4000004mGyhAAE",
"transitionName": "OpenToClosed",
"objectId": "a3qf4000000KtfKAAS"
}
}
],
"Involved Injury Cat Husky_a3kf4000000pLEuAAM": [
{
"ruleDetails": {
"instanceKey": "Involved Injury Cat Husky_a3kf4000000pLEuAAM",
"involvedItemId": "a3kf4000000pLEuAAM",
"requirement name": "Maximum Aggregation Rule",
"conditions": "Pet.petType == 'dog' AND Pet.petBreed == 'Alaskan Husky' AND ptandev2__InsuranceClaim__c.ptandev2__ClaimStatus__c == 'Open'",
"message": "TestMessage",
"action method": "Product_Rule",
"action class": "IntegrationProcedureService",
"productId": "01tf4000004mGyhAAE",
"transitionName": "OpenToClosed",
"objectId": "a3qf4000000KtfKAAS"
}
}
]
},
"trueRules": {
"Involved Injury Dog Husky_a3kf4000000pLEtAAM": [
{
"actionResults": {
"IPResult": {
"output": "TestOutput"
}
},
"ruleDetails": {
"instanceKey": "Involved Injury Dog Husky_a3kf4000000pLEtAAM",
"involvedItemId": "a3kf4000000pLEtAAM",
"requirement name": "Maximum Aggregation Rule",
"conditions": "Pet.petType == 'dog' AND Pet.petBreed == 'Alaskan Husky' AND ptandev2__InsuranceClaim__c.ptandev2__ClaimStatus__c == 'Open'",
"message": "TestMessage",
"action method": "Product_Rule",
"action class": "IntegrationProcedureService",
"productId": "01tf4000004mGyhAAE",
"transitionName": "OpenToClosed",
"objectId": "a3qf4000000KtfKAAS"
}
}
]
}
}
This JSON includes the following key/value pairs:
Key |
Value |
|---|---|
|
Describes what the service changed in the Status field on claim object. |
|
Tells whether or not the service transitions the object to a new state. |
|
If all of the rules run by the service evaluate to false, If any of the rules run by the service evaluates to true, |
|
An array of one or more Includes all rules run by the service that evaluate to false. |
|
An array of one or more Includes all rules run by the service that evaluate to true. Appears only if |
|
Any errors encountered by the service. If the value is ok, no error messages appear on the UI. |
The falseRules and trueRules arrays both include ruleDetails key/value pairs.
"ruleDetails": {
"instanceKey": "Involved Property_a3lf4000000pcFUAAY",
"involvedItemId": "a3lf4000000pcFUAAY",
"requirement name": "Maximum Aggregation Rule",
"conditions": "Pet.petType == 'dog' AND Pet.petBreed == 'Alaskan Husky' AND ptandev2__InsuranceClaim__c.ptandev2__ClaimStatus__c == 'Open'",
"message": "TestMessage",
"action method": "Product_Rule",
"action class": "IntegrationProcedureService",
"productId": "01tf4000004mGyhAAE",
"transitionName": "OpenToClosed",
"objectId": "a3qf4000000KtfKAAS"
}"ruleDetails": {
"requirement name": "Operator Points >4",
"conditions": "wcOperator.opPoints > 4",
"message": "The applicant's prior citations require underwriting review prior to issuance.",
"action method": "ReferToUnderwriting",
"action class": "DROpenImplementationClass",
"productId": "01tf4000001lKNQAA2",
"transitionName": "Submit>Underwrite",
"objectId": "0Q0f4000000ADatCAG"
}The trueRules array includes one or more actionResults, additional key/value pairs, and rulesDetails.
The actionResults are the output of the Vlocity action class and action method invoked by the service.
"trueRules": {
"Involved Injury Dog Husky_a3kf4000000pLEtAAM": [
{
"actionResults": {
"IPResult": {
"output": "TestOutput"
}
},
"ruleDetails": {
"instanceKey": "Involved Injury Dog Husky_a3kf4000000pLEtAAM",
"involvedItemId": "a3kf4000000pLEtAAM",
"requirement name": "Maximum Aggregation Rule",
"conditions": "Pet.petType == 'dog' AND Pet.petBreed == 'Alaskan Husky' AND ptandev2__InsuranceClaim__c.ptandev2__ClaimStatus__c == 'Open'",
"message": "TestMessage",
"action method": "Product_Rule",
"action class": "IntegrationProcedureService",
"productId": "01tf4000004mGyhAAE",
"transitionName": "OpenToClosed",
"objectId": "a3qf4000000KtfKAAS"
}
}
]
}
