Complete configuration example
The following files show an example configuration for a custom
incident named MobilePhoneIncident_Ext
and a custom risk unit
named MobilePhoneRU_Ext
. These entities do not make use of a
damageable. You can view the eti files for these entities at Data model design with "no damageable".
JSON does not support comments. However, to clarify the code, pseudo-comments have been added to the JSON code blocks. Each pseudo-comment is in bold and is preceded by a hashtag (#).
The schema extension file
claim_ext-1.0.schema.json
#Incident schema (added by REST endpoint generator):
"MobilePhoneIncidentExt": {
"title": "Mobile phone incident ext",
"description": "Mobile phone incident ext",
"type": "object",
"properties": {
#properties added by the REST endpoint generator:
"description": {
"title": "Description",
"description": "A general description of the incident",
"type": "string",
"x-gw-nullable": true,
"x-gw-extensions": {
"defaultViews": [
"detail"
],
"filterable": true,
"sortable": true
}
},
"id": {
"title": "ID",
"description": "The unique identifier of this element",
"type": "string",
"readOnly": true
},
"lossParty": {
"title": "Loss party",
"description": "The type of loss party, generally either the
insured or a third-party",
"$ref": "#/definitions/TypeKeyReference",
"x-gw-nullable": true,
"x-gw-extensions": {
"filterable": true,
"sortable": true,
"typelist": "LossPartyType"
}
},
"severity": {
"title": "Severity",
"description": "The severity of the loss",
"$ref": "#/definitions/TypeKeyReference",
"x-gw-nullable": true,
"x-gw-extensions": {
"filterable": true,
"sortable": true,
"typelist": "SeverityType"
}
},
#business requirement properties (added manually)
"repairEstimate": {
"title": "Repair estimate",
"description": "Estimate to repair phone",
"type": "string"
}
#foreign key from incident to risk unit (added manually)
"mobilePhoneRU_Ext": {
"title": "Mobile phone risk unit",
"description": "The associated mobile phone risk unit",
"$ref": "#/definitions/UpdateablePolicyObjectReference",
"x-gw-nullable": true,
"x-gw-extensions": {
"resourceType": "MobilePhoneRUExt"
}
}
},
#Risk unit schema (added by REST endpoint generator):
"MobilePhoneRUExt": {
"title": "Mobile phone ru ext",
"description": "Mobile phone ru ext",
"type": "object",
"properties": {
#properties added by the REST endpoint generator:
"RUNumber": {
"title": "Risk unit number",
"description": "The number automatically assigned to this
covered risk unit on the policy",
"type": "integer",
"readOnly": true,
"x-gw-extensions": {
"filterable": true,
"sortable": true
}
},
"description": {
"title": "Description",
"description": "A description of the risk unit",
"type": "string",
"x-gw-nullable": true
},
"id": {
"title": "ID",
"description": "The unique identifier of this element",
"type": "string",
"readOnly": true
},
"policySystemId": {
"title": "Policy system ID",
"description": "The unique identifier of this element within
the policy system",
"type": "string",
"readOnly": true,
"x-gw-extensions": {
"filterable": true
}
}
#business requirement properties (added manually)
"model": {
"title": "Model",
"description": "Model of the mobile phone",
"type": "string"
}
}
}
Java
The mapping extension file
claim_ext-1.0.mapping.json
#Incident mapper (added by REST endpoint generator):
"MobilePhoneIncidentExt": {
"schemaDefinition": "MobilePhoneIncidentExt",
"root": "entity.MobilePhoneIncident_Ext",
"properties": {
#properties added by the REST endpoint generator:
"description": {
"path": "MobilePhoneIncident_Ext.Description"
},
"id": {
"path": "MobilePhoneIncident_Ext.RestId"
},
"lossParty": {
"path": "MobilePhoneIncident_Ext.LossParty",
"mapper": "#/mappers/TypeKeyReference"
},
"severity": {
"path": "MobilePhoneIncident_Ext.Severity",
"mapper": "#/mappers/TypeKeyReference"
}
#business requirement properties (added manually)
"repairEstimate": {
"path": "MobilePhoneIncident_Ext.RepairEstimate"
}
#foreign key from incident to damageable (added manually)
"MobilePhoneRU_Ext": {
"path": "MobilePhoneIncident_Ext.MobilePhoneRU_Ext.RestV1_AsPolicyObjectReference",
"mapper": "#/mappers/PolicyObjectReference"
}
}
},
#Risk unit schema (added by REST endpoint generator):
"MobilePhoneRUExt": {
"schemaDefinition": "MobilePhoneRUExt",
"root": "entity.MobilePhoneRU_Ext",
"properties": {
#properties added by the REST endpoint generator:
"RUNumber": {
"path": "MobilePhoneRU_Ext.RUNumber"
},
"description": {
"path": "MobilePhoneRU_Ext.Description"
},
"id": {
"path": "MobilePhoneRU_Ext.RestId"
},
"policySystemId": {
"path": "MobilePhoneRU_Ext.PolicySystemId"
}
#business requirement properties (added manually)
"model": {
"path": "MobilePhoneRU_Ext.Model"
}
}
}
Java
The updater extension file
claim_ext-1.0.updater.json
#Incident updater (added by REST endpoint generator):
"MobilePhoneIncidentExt": {
"schemaDefinition": "MobilePhoneIncidentExt",
"root": "entity.MobilePhoneIncident_Ext",
"properties": {
#properties added by the REST endpoint generator:
"description": {
"path": "MobilePhoneIncident_Ext.Description"
},
"lossParty": {
"path": "MobilePhoneIncident_Ext.LossParty",
"valueResolver": {
"typeName": "TypeKeyValueResolver"
}
},
"severity": {
"path": "MobilePhoneIncident_Ext.Severity",
"postUpdateValidators": [
{
"typeName": "ExplicitlyFilteredTypekeyPostUpdateValidator",
"categories": "new
gw.entity.TypeKey[]{MobilePhoneIncident_Ext.Subtype}"
}
],
"valueResolver": {
"typeName": "TypeKeyValueResolver"
}
}
#business requirement properties (added manually)
"repairEstimate": {
"path": "MobilePhoneIncident_Ext.RepairEstimate"
}
#foreign key from incident to risk unit (added manually)
"MobilePhoneRU_Ext": {
"path": "MobilePhoneIncident_Ext.MobilePhoneRU_Ext",
"valueResolver": {
"typeName": "gw.rest.ext.cc.claim.v1.claims.policy.
mobilephoneruext.
MobilePhoneRUExtJsonValueResolver",
"resolvedValueToAncestorPath": "resolvedValue.Policy",
"rootToAncestorPath": "MobilePhoneIncident_Ext.Claim.Policy"
}
}
}
},
#Risk unit updater (added by REST endpoint generator):
"MobilePhoneRUExt": {
"schemaDefinition": "MobilePhoneRUExt",
"root": "entity.MobilePhoneRU_Ext",
"properties": {
#properties added by the REST endpoint generator:
"RUNumber": {
"path": "MobilePhoneRU_Ext.RUNumber"
},
"description": {
"path": "MobilePhoneRU_Ext.Description"
}
#business requirement properties (added manually)
"model": {
"path": "MobilePhoneRU_Ext.Model"
}
}
}
Java