Asynchronous Quoting work queue

Code

AsyncQuoting

Categories

None

Implementation

Work queue

Class

AsyncQuotingWorkQueue.gs

The Asynchronous Quoting work queue rates and quotes the current policy period asynchronously. If two-step quoting is also enabled for a line of business, then this work queue quotes only.

PolicyCenter creates an asynchronous quoting work item (AsyncQuotingWorkItem) when a user starts an asynchronous quote. This work queue processes these work items. AsyncQuotingWorkItem is an entity that delegates to WorkItem. This work item has properties for the following:
RequestingUser
The user that requested the quote
PolicyPeriod
The policy period to quote

In work-queue.xml, the default progress interval for asynchronous quoting work queue is 600,000 milliseconds (10 minutes). Set this value to an interval longer than the expected time for an asynchronous quote to complete.

How the Asynchronous Quoting work queue handles issues

If the asynchronous quote generates issues, most of these issues appear in the Validation Results tab next to the Activity tab. This tab displays both product model synchronization issues (ProductModelSyncIssue) and validation issues (ValidationIssue). Other more serious issues, such as rating or unexpected errors, appear on the policy transaction screen.

The AsyncQuotingWorkQueue.processWorkItem method processes asynchronous quoting work items. If exceptions occur while processing work items, this method creates one or more issues, AsyncQuoteIssue entity instances, for each exception. The MessageType property contains the issue type, defined in the AsyncQuoteIssueType typelist.

The processWorkItem method catches all exceptions thrown by the call to JobProcess.requestQuote. For each exception, PolicyCenter displays messages:
Exception Message appears on... Description
QuoteHaltedException Validation Results tab
EntityValidationException Validation Results tab This exception can contain multiple messages. The method creates one AsynchQuoteIssue entity instance for each message.
DisplayableException Policy transaction screen Displayable exceptions report failure such as out-of-sequence conflicts or rating failure.

When you click to display the asynchronous quoting activity, PolicyCenter displays this exception on the policy transaction screen.

Unexpected throwables Policy transaction screen Are transferred to DisplayableException and appear on the policy transaction screen. Unlike the expected exceptions, after catching the throwable and creating the corresponding AsyncQuoteIssue entity, the work queue retries the work item. If the throwable still occurs during the last retry, the AsyncQuotingWorkQueue#workItemFailed method creates a failure activity.
UWAuthorityBlocksProgressException Policy transaction screen with a link to the Risk Analysis screen Normally, no message is created because the exception creates an underwriting issue (UWIssue) for the exception. In the unlikely event that an underwriting issue was not created, processWorkItem generates an AsyncQuoteIssue instance.

AsyncQuotingWorkItem entity

The asynchronous quoting work queue processes AsyncQuotingWorkItem work items. AsyncQuotingWorkItem is an entity that delegates to WorkItem. This work item has properties for the following:
RequestingUser
The user that requested the quote
PolicyPeriod
The policy period to quote

AsyncQuoteIssue entity

The asynchronous quoting work queue generates messages when something notable occurs while processing the quote. Each AsyncQuoteIssue entity instance corresponds to a message. Messages can be informational, warnings, errors, or exceptions. Some of the properties of this entity are:
PolicyPeriod
Foreign key to the policy period being quoted.
IssueType
Issue type for messages generated by asynchronous quoting. Values are defined in the AsyncQuoteIssueType typelist.
Description
Description of the issue.
IssueSequence
Indicates the order in which the issue was created.