Accessing risk assessment interactively

When accessing Spotlight interactive service, you can go to the Spotlight application from PolicyCenter by clicking View in Spotlight on the Location Information screen. In Spotlight, you can examine the location and its surroundings, and perform risk evaluations. You can also move the location pin for longitude and latitude. Spotlight risk assessment service provides risk data. Then you can return to PolicyCenter.

The following illustration shows the Spotlight interactive and risk assessment flow in PolicyCenter.



For interactive risk assessment flow, the following steps correspond to the numbers in the previous illustration.

  1. PolicyCenter When the user clicks Evaluate in Spotlight, PolicyCenter sets a variable indicating that this button was clicked. Then PolicyCenter stores the current policy location data into the OutboundLocationRiskAssessmentTempStore, OutboundPeriodRiskAssessmentTempStore, and OutboundReinsurableRiskAssessmentTempStore temporary objects. PolicyCenter uses these objects to match the data that the risk assessment service returns.

    For new locations that do not have latitude and longitude, PolicyCenter sends a formatted address. The AddressFormatter class formats the address into a globalized address. In your customization, pass the fields you require into the formatter. In the base configuration, the fields are stored in a static function called GeoCodableAddressFields in SpotlightConfigParameters.gs.

    Policy Center passes three parameters to Spotlight through the URL. These parameters are used in requests to transfer JSON data from Spotlight to PolicyCenter.

    • policySystemServer – Base URL which prepends the other two page parameters
    • encodedLocationDetailRequestPage – Page for requesting location details from PolicyCenter including location public ID
    • encodedReturnPage – Page for returning from Spotlight to PolicyCenter to display the risk assessment calculated by Spotlight

    The URL is in the following format:

    https://SpotlightURL/urlPrefix/policySystemServer/
    paramsUrlFragment/encodedLocationDetailRequestPage/returnUrlFragment/encodedReturnPage
  2. Spotlight After PolicyCenter sends the public ID of the LocationForRiskAssessment object to Spotlight, Spotlight sends a request to PolicyCenter to retrieve the details of that location. The request is made through the URL:
    policySystemServer/encodedLocationDetailRequestPage 

    In PolicyCenter the request goes to SpotlightServlet.gs.

  3. PolicyCenter The SpotlightServlet delegates to LocationDetailsRequestHandler.gs.
  4. The LocationDetailsRequestHandler gets the location details.
  5. The LocationDetailsRequestHandler responds to the request by sending JSON data from OutboundPolicyData.gs. Jackson is used to serialize and deserialize the JSON data. This class implements the JacksonEnabledSerializable interface so that Jackson works with Gosu.
    Note: Guidewire recommends that you do not use polymorphic deserialization, or that you use it only with annotations on an individual class basis. Do not enable global default typing.
  6. Spotlight At this point, the user can modify the location pin or risk profile in Spotlight, then click PolicyCenter to return to PolicyCenter. The Spotlight service uses the supplied latitude and longitude if present to identify the location, in preference to the address information.
  7. PolicyCenter When the user initiates the return to PolicyCenter, a request is sent to the URL:
    policySystemServer/encodedReturnPage

    The request arrives at SpotlightServlet.gs.

    The request includes the location data as JSON data in a request parameter which is parsed with Jackson and stored in InboundPolicyRequestData.gs.

  8. The SpotlightServlet passes control to SpotlightReturnToPCRequestHandler.
  9. SpotlightReturnToPCRequestHandler matches the JSON data with temporary objects in database.
  10. The request handler calls PolicyLocationRiskAssessmentGateway with the matched temporary objects. The gateway ensures that the plugin methods are called correctly, checks permissions, and handles errors.
  11. The gateway calls the PolicyLocationRiskAssessmentPlugin.
  12. Spotlight PolicyLocationRiskAssessmentPlugin calls the Spotlight risk assessment service. The data is sent by OutboundPolicyData.
  13. The risk assessment data is returned with InboundRiskAssessmentData.
  14. PolicyCenter The data is persisted in InboundLocationRiskAssessmentTempStore. The handler returns control to SpolightServlet.
  15. Spotlight The servlet returns control to Spotlight.
  16. PolicyCenter Spotlight directs the URL back to PolicyCenter.
  17. In PolicyCenter, the Location Information screen displays the risk assessment data below the map. The risk assessment data includes Latitude, Longitude, and other fields.

When the user returns to PolicyCenter, the page reloads the OutboundLocationRiskAssessmentTempStore object which contains the risk assessment data in InboundLocationRiskAssessmentTempStore.

PolicyCenter reloads the thumbnail map to display the latitude and longitude picked in Spotlight if moved. When there is new risk assessment data, PolicyCenter displays a message below the thumbnail map saying Spotlight returned new data. You can choose whether or not to Use this new data. The data in InboundLocationRiskAssessmentTempStore object is added into the LocationRiskAssessment object if you choose to use the new data and click Ok. If you click Cancel, the risk assessment data is not stored into the policy graph. You can view the location in Spotlight multiple times and move the location pin each time resulting in different risk assessment values. Only the last risk assessment value is preserved into the policy graph when you select Ok.

You also see the risk assessment details after visiting Spotlight and clicking Evaluate. Next to the label Risk Profile: US Large Commercial, click Show to view risk assessments and details.

When the new risk assessment is accepted, a LocationRiskAssessment object is created and populated with risk assessment, including the hash of the data used to generate this risk assessment.