Accessing risk assessment non-interactively
You can access risk assessment non-interactively by clicking Update Risk Evaluations on the Risk Analysis screen. PolicyCenter runs risk assessment for all locations on the policy period.
When accessing risk assessment non-interactively, PolicyCenter calls the Spotlight risk assessment service, saves the results, and creates an activity indicating whether the risk assessment succeeded or failed. This occurs without providing the user access to Spotlight interactive services.
The following illustration shows the flow when accessing Spotlight non-interactively from PolicyCenter.
For non-interactive risk assessment flow, the following steps correspond to the numbers in the previous illustration.
- The user selects Update Risk Evaluations and PolicyCenter
calls the PolicyLocationRiskAssessmentRequestor
class.
This class requests risk assessments for all the locations on a policy period, by calling the enqueueForLocationsRiskAssessment method. This method creates a
RiskEvaluationWorkItemwhich refers to thePolicyPeriod. It also sets theRequestingUserfield to the current user. TheworkItemis created and committed in thePolicyPeriodbundle.The class also provides the static query isLocationsRiskAssessmentInProgress method to determine whether there is already an active
RiskEvaluationWorkItemfor this policy period. - Policy Locations Risk Assessment
batch processing writes items to the Policy Locations Risk Assessment
work queue. This work queue starts risk assessment for all locations
on the policy.
This work queue does not have a finder. Therefore, batch requests are created explicitly by the PolicyLocationsRiskAssessmentRequestor class.
- The work queue calls PolicyLocationRiskAssessmentGateway class. The gateway ensures that the plugin methods are called correctly, checks permissions, and handles errors.
- The gateway class calls the
PolicyLocationRiskAssessmentPluginplugin. - The plugin calls the Spotlight
risk assessment service. The data is sent by
OutboundPolicyData. - The risk assessment data is
returned with
InboundRiskAssessmentData. - The data is persisted in InboundLocationRiskAssessmentTempStore objects.
- For each location, the SpotlightNotificationActivityCreator class creates an activity indicating whether risk assessment succeeded or failed.
- Users can view the activities in PolicyCenter.
