Extend the RecoverNewJobsRequestAttributes
schema
Finally, you must extend the RecoverNewJobsRequestAttributes
schema.
The schema file
To extend the schema itself, add your extensions to the
policyperiod_ext-1.0.schema.json
file.
Guidewire recommends adding an _Ext
suffix to all property names you
add to a base configuration schema. This is to prevent any conflicts that could
arise in future releases with search criteria properties added by Guidewire.
Sample policyperiod_ext-1.0.schema.json
file
For the sample implementation, this is what the file looks like after configuration.
{
"$schema": "http://json-schema.org/draft-04/schema#",
"x-gw-combine": [
"gw.content.pc.policyperiod.v1.policyperiod_content-1.0",
"ext.common.v1.common_ext-1.0"
],
"definitions": {
"RecoverNewJobsRequestAttributes": {
"title": "Recover new jobs request attributes",
"description": "Recovery properties used to recover new non-complete jobs for an unauthenticated user",
"type": "object",
"x-gw-sinceVersion": "1.6.0",
"properties": {
"accountNumber_Ext": {
"title": "Account number",
"description": "The `accountNumber` of the account",
"type": "string"
},
"firstName_Ext": {
"title": "First name",
"description": "The `firstName` of the account's `accountHolder`",
"type": "string"
},
"jobNumber_Ext": {
"title": "Job number",
"description": "The number of the job",
"type": "string"
},
"lastName_Ext": {
"title": "Last name",
"description": "The `lastName` of the account's `accountHolder`",
"type": "string"
},
"postalCode_Ext": {
"title": "Postal code",
"description": "The `postalCode` of the `primaryAddress` on the account's `accountHolder`. Only applicable in certain countries.",
"type": "string",
"x-gw-extensions": {
"countryRestricted": true
}
}
}
}
}
}
The mapper file
To extend the mappings, add your extensions to the
policyperiod_ext-1.0.mapping.json
file.
This file declares search attribute properties, and these properties never store data from PolicyCenter. Therefore, there is no technical requirement to have mappers. However, Cloud API raises a warning if properties are added to a schema without mappers. So, Guidewire recommends adding these mappers solely to suppress this warning.
Sample policyperiod_ext-1.0.mapping.json
file
For the sample implementation, this is what the file looks like after configuration.
{
"schemaName": "ext.policyperiod.v1.policyperiod_ext-1.0",
"combine": [
"gw.content.pc.policyperiod.v1.policyperiod_content-1.0",
"ext.common.v1.common_ext-1.0"
],
"mappers": {
// Added to suppress "no mappers" warnings
"RecoverNewJobsRequestAttributes": {
"schemaDefinition": "RecoverNewJobsRequestAttributes",
"root": "java.lang.Object",
"properties": {
"accountNumber_Ext": {
"path": "null as String"
},
"firstName_Ext": {
"path": "null as String"
},
"jobNumber_Ext": {
"path": "null as String"
},
"lastName_Ext": {
"path": "null as String"
},
"postalCode_Ext": {
"path": "null as String"
}
}
}
}
}
The updater file
To extend the updaters, add your extensions to the
policyperiod_ext-1.0.updater.json
file.
Sample policyperiod_ext-1.0.updater.json
file
For the sample implementation, this is what the file looks like after configuration.
Note that, for each property, the root is the
RecoverNewJobsWrapperExt
class.
{
"schemaName": "ext.policyperiod.v1.policyperiod_ext-1.0",
"combine": [
"gw.content.pc.policyperiod.v1.policyperiod_content-1.0",
"ext.common.v1.common_ext-1.0"
],
"updaters": {
"RecoverNewJobsRequestAttributes": {
"schemaDefinition": "RecoverNewJobsRequestAttributes",
"root": "gw.rest.ext.pc.job.v1.security.RecoverNewJobsWrapperExt",
"properties": {
"accountNumber_Ext": {
"path": "RecoverNewJobsWrapperExt.AccountNumber"
},
"firstName_Ext": {
"path": "RecoverNewJobsWrapperExt.FirstName"
},
"jobNumber_Ext": {
"path": "RecoverNewJobsWrapperExt.JobNumber"
},
"lastName_Ext": {
"path": "RecoverNewJobsWrapperExt.LastName"
},
"postalCode_Ext": {
"path": "RecoverNewJobsWrapperExt.PostalCode"
}
}
}
}
}