Adding compound datatypes
InsuranceSuite includes several datatypes where multiple values are stored as a unit. This includes the following:
Typekey(containing acodeand aname)MonetaryAmountandCurrencyAmount(containing acurrencyand anamount)SpatialPoint(containing alongitudecoordinate and alatitudecoordinate)
assignmentStatus property is a typekey. Thus,
the response payload for an activity's assignment status has two sub-fields
(code and
name):"assignmentStatus": {
"code": "assigned",
"name": "Assigned"
}Use the schema, mapping, and updater extension files to add a compound datatype to a resource.
| Filename | Guidewire Studio node |
|---|---|
<API>_ext-1.0.schema.json |
integration -> schemas -> ext -> <API>.v1 |
<API>_ext-1.0.mapping.json |
integration -> mappers -> ext -> <API>.v1 |
<API>_ext-1.0.updater.json |
integration -> updaters -> ext -> <API>.v1 |
The schema extension file
Each schema extension file for every API contains a definitions section.
In the base configuration, this section is typically blank. You can add the name of one
or more schemas to the definitions section. In each schema, you can
define a properties section, which lists one or more properties defined
for the schema.
For compound values, each property must also have a $ref. It specifies
an existing definition for the datatype.
SpatialPoint field (which is a spatial point) looks like
this: "properties": {
"spatialPoint": {
...
"$ref": "#/definitions/SpatialPoint"
}
}Compound datatype definitions
Set the $ref attribute to a datatype definition from the following
table.
| Compound datatype | $ref value | Additional required attributes |
|---|---|---|
Typekey |
#/definitions/TypeKeyReference |
A x-gw-extensions attribute with a
typelist child attribute that identifies the
relevant typelist. |
MonetaryAmount |
#/definitions/MonetaryAmount |
|
CurrencyAmount |
#/definitions/MonetaryAmount (Note that there is
no CurrencyAmount schema. This datatype uses the
MonetaryAmount schema.) |
|
SpatialPoint |
#/definitions/SpatialPoint |
x-gw-extensions property with a child typelist
property set to the name of the typelist. For
example: "properties": {
"assignmentStatus": {
...
"$ref": "#/definitions/TypeKeyReference",
"x-gw-extensions": {
"typelist": "AssignmentStatus"
}
}
}The mapping extension file
Each mapping extension file for every API contains a mappers section. In
the base configuration, this section is typically blank. You can add the name of one or
more schemas to the mappers section. In each schema, you can define a
properties section, which lists one or more properties defined in
the schema.
For each property, you must identify how data is mapped from the Guidewire data model to the property. This is done using the following attributes:
path- defines the path to the data model field that stores the datamapper- names a mapper that defines how the compound data type is mapped into its schema
The following table lists the mapper attribute values for the common compound datatypes.
| Compound datatype | mapper value |
|---|---|
Typekey |
#/mappers/TypeKeyReference |
MonetaryAmount |
#/mappers/MonetaryAmount |
CurrencyAmount |
#/mappers/CurrencyAmount |
SpatialPoint |
#/mappers/SpatialPoint |
Activity data model entity's
AssignmentStatus field looks like
this:"mappers": {
"Activity": {
"properties": {
"assignmentStatus": {
"path": "Activity.AssignmentStatus",
"mapper": "#/mappers/TypeKeyReference"
}
}
}
}The updater extension file
Each updater extension file for every API contains a updaters section.
In the base configuration, this section is typically blank. You can add the name of one
or more schemas to the updaters section. In each schema, you can define
a properties section, which lists one or more properties defined in the
schema.
For each writeable property, you must identify how data is mapped from the Guidewire data model to the property. This is done using the following attributes:
path- defines the path to the data model field that stores the datavalueResolver- names a mapper that defines how the compound data type is mapped into its schema
"<property>": {
"path": "<pathValue>",
"valueResolver": {
"typeName": "<resolverName>"
}
}The following table lists the resolver names for the common compound datatypes.
| Compound datatype | Mapper value |
|---|---|
Typekey |
TypeKeyValueResolver |
MonetaryAmount |
MonetaryAmountValueResolver |
CurrencyAmount |
CurrencyAmountValueResolver |
SpatialPoint |
SpatialPointValueResolver |
Activity resource's
assignmentStatus property looks like
this:"updaters": {
"Activity": {
"properties": {
"assignmentStatus": {
"path": "Activity.AssignmentStatus",
"valueResolver": {
"typeName": "TypeKeyValueResolver"
}
},
...If you are using the TypeKeyValueResolver, you can optionally include a property
allowRetired. If set to true, retired entries in
the typelist can still be used. The valueResolver field would look look
like this:
"valueResolver": {
"typeName": "TypeKeyValueResolver",
"allowRetired": false
}