You may want to collect slightly different data in web forms then those provided in the FNOL checkout example. Learn how to do that by modifying web forms and corresponding transformer.
Context
The claim request data, or the first notice of loss, that is sent to SAP Claims Management (FS-CM) system consists of relevant information about a user and his or her policy (the existing data), and the new information about the claim incident collected when a user files a claim report on the portal.
To modify the information that is collected about the claim incident on the portal, you need to:
- add additional steps or fields to the FNOL checkout
- parse the new data with your custom FSClaimRequestTransformer
- extend the data model, if needed, with new item types or attributes
- update the integration object
Procedure
In this example, we extend the data collected from a user with just one additional field: municipality, which is going to be added to the first step of the FNOL checkout. The municipality field is part of the information about the loss location, together with other attributes: country, city, address, postcode, etc.
- Log into Backoffice with your admin credentials.
- Go to and select AutoClaim-IncidentInformation.
- Click the pencil icon to edit yForm definition.
- Add the municipality field and save the form.
- Extend the data model by adding a new attribute to the already existing type FSLocationOfLoss in your custom extension *-items.xml.
<attribute qualifier="municipality" type="java.lang.String">
<persistence type="property"/>
</attribute>
- Create a custom FSClaimRequestTransformer (e.g. CustomClaimRequestTransformer) that overrides the default implementation of FSClaimRequestTransformer. In the newly created transformer override method transformRequest by doing the following:
- Add a parser for the municipality field
final String municipality = XmlUtilTransformer.getTextValue(xpath, document, INCIDENT_INFORMATION + "/municipality");
- Update the claim model
claimModel.setLocationOfLoss(customPopulateLocationOfLoss(locationOfLoss, countryCode, stateCode, city, address, postcode, municipality, whereHappened));
- Implement the logic for populating the location of loss
protected FSLocationOfLossModel customPopulateLocationOfLoss(FSLocationOfLossModel locationOfLoss, String countryCode, String stateCode,
String city, String address, String postcode, String municipality, String whereHappened)
{
super.populateLocationOfLoss(locationOfLoss, countryCode, stateCode, city, address, postcode, whereHappened)
if (StringUtils.isNotEmpty(municipality)){
locationOfLoss.setMunicipality(municipality);
}
return locationtOfLoss;
}
- Register your newly created custom transformer as a Spring bean in your *-items.xml.
<alias name=“customClaimRequestTransformer” alias=“fsClaimTransformer”/>
<bean id=“customClaimRequestTransformer” class=“<your_package>.CustomClaimRequestTransformer” parent="defaultFSClaimRequestTransformer"/>
- Extend the integration object. You can find the default structure of the integration object in the claim-outbound.impex file.
INSERT_UPDATE IntegrationObjectItemAttribute; integrationObjectItem(integrationObject(code), code)[unique = true]; attributeName[unique = true]; attributeDescriptor(enclosingType(code), qualifier); returnIntegrationObjectItem(integrationObject(code), code); unique[default = false]; autoCreate[default = false]
; OutboundFSClaim:FSLocationOfLoss ; municipality ; FSLocationOfLoss:municipality ; ; ;