public override ProcessResultsCollection ProcessComponent(IBusinessComponent component, ProcessInvocationPoint point, int pluginId, ProcessParameters processParameters) { if (_Logger.IsInfoEnabled) { _Logger.Info(string.Format("ClaimReviewTaskProcessHandler - ProcessComponent Called")); } ClaimHeader header = null; PluginHelper<IBusinessComponent> pluginHelper = null; if (component.GetType() == typeof(ClaimHeader)) { header = (ClaimHeader)component; pluginHelper = new PluginHelper<IBusinessComponent>(point, header, new ProcessResultsCollection()); this.ProcessClaimForReopen(header, pluginHelper); } return pluginHelper.ProcessResults; }
/// <summary> /// start the process on Virtual invocation point. /// </summary> /// <param name="component">ClaimEvent component or ClaimHeader component</param> /// <param name="point">invocation point</param> /// <param name="pluginId">plugin id</param> /// <param name="processParameters">process parameters</param> /// <returns>collection of process results</returns> public override ProcessResultsCollection ProcessComponent(IBusinessComponent component, ProcessInvocationPoint point, int pluginId, ProcessParameters processParameters) { ClaimEvent claimEvent = null; ClaimHeader header = null; PluginHelper<IBusinessComponent> pluginHelper = null; // Get the ClaimHeader, depending on whether we have a ClaimEvent or a ClaimHeader Component // The pluginHelper will reflect the Business Component passed in. if (component.GetType() == typeof(ClaimEvent)) { claimEvent = (ClaimEvent)component; // Get the Claim Header from the ClaimEvent, depending on where it's attached. if (claimEvent.Parent is ClaimDetail) { header = (ClaimHeader)claimEvent.Parent.Parent; } else { header = (ClaimHeader)claimEvent.Parent; } pluginHelper = new PluginHelper<IBusinessComponent>(point, claimEvent, new ProcessResultsCollection()); } else { header = (ClaimHeader)component; pluginHelper = new PluginHelper<IBusinessComponent>(point, header, new ProcessResultsCollection()); } try { // We are only processing on the Virtual invocation point. if (point == ProcessInvocationPoint.Virtual) { switch (processParameters.Alias) { case AXA_CLOSE_FINALIZE_CLAIM_PROCESS_HANDLER: // Close all tasks on Finalise. ClaimsProcessHelper.CloseAllTasks(header); break; case AXA_REVIEW_COMPLETED_PROCESS_HANDLER: if (processParameters.TransactionInvocationPoint == TransactionInvocationPoint.PreComplete) { // On pre-complete of a transaction only, process for the auto-review event. this.CheckAndCreateAutoReviewEvent(header, pluginHelper, processParameters.Alias); } break; case AXA_PHONE_LOG_PROCESS_HANDLER: // If the claim event "Task To Do" is set to '1' we have a PhoneLog and should process. if (!string.IsNullOrWhiteSpace(claimEvent.CustomCode03) && claimEvent.CustomCode03 == "1") { this.StartClaimProcess(header, pluginHelper, processParameters.Alias); } break; // ClaimWakeUp Processing (2) case AXA_MANUAL_REVIEW_START_CLAIM_PROCESS_HANDLER: // On opening a review task on a closed migrated claim, we must be doing this to reopen that claim // so we process the reopening using the ClaimReviewTaskProcessHandler, that calls out to the ClaimWakeUpService. if (ClaimsBusinessLogicHelper.CheckMigratedCloseClaim(header)) { ProcessHelper.HandleVirtualProcess(header, new ProcessParameters { Alias = "AXAClaimsReviewTaskProcessHandler" }); } // We also need to run the default processing but leaving out the 'break;' comment to drop through // is confusing for reading the code. this.StartClaimProcess(header, pluginHelper, processParameters.Alias); break; case AXAFileUploadNotificationProcessHandler: // CustomCode08 is based on Document.CustomCode08 "Generate task?" field string generateTask = Convert.ToString(propAccessor.GetProperty(claimEvent, ConfigurationManager.AppSettings[ClaimEventGenerateTaskCustomCodeField])); if (generateTask == "1") { this.StartClaimProcess(header, pluginHelper, processParameters.Alias); } break; default: this.StartClaimProcess(header, pluginHelper, processParameters.Alias); break; } } } catch (Exception e) { logger.Error(e); logger.Error(e.InnerException); pluginHelper.AddError(MessageConstants.CLAIM_PROCESS_ERROR); } return pluginHelper.ProcessResults; }