} // GetRejectionInputData /// <summary> /// Main logic flow function to determine weather to auto reject the customer or not /// </summary> /// <param name="data">rejection input data</param> public void MakeDecision(RejectionInputData data) { Trail.Init(data); this.log.Debug("Secondary: checking if auto reject should take place for customer {0}...", this.customerId); try { CheckRejectionExceptions(); Trail.LockDecision(); CheckRejections(); } catch (Exception e) { this.log.Error(e, "Exception during auto rejection."); StepNoDecision <ExceptionThrown>().Init(e); } // try Trail.HasApprovalChance = (!this.lowPersonalScore || !this.lowBusinessScore) && !this.unresolvedPersonalDefaults && !this.companyTooYoung; Trail.DecideIfNotDecided(); this.log.Debug( "Secondary: checking if auto reject should take place for customer {0} complete; {1}", this.customerId, Trail ); } // MakeDecision
protected virtual void RunPrimary() { Log.Debug("Primary: checking if auto reject should take place for customer {0}...", Args.CustomerID); GatherData(); var checker = new Checker(Trail, Log).Run(); HasApprovalChance = checker.Trail.HasApprovalChance; Trail.DecideIfNotDecided(); Log.Debug( "Primary: checking if auto reject should take place for customer {0} complete, {1}", Args.CustomerID, Trail ); } // RunPrimary
} // GatherData private void LogicalGlueFlow() { Output.FlowType = AutoDecisionFlowTypes.LogicalGlue; if ((Trail.MyInputData.RequestID == null) || (Trail.MyInputData.ResponseHttpStatus != (int)HttpStatusCode.OK)) { Trail.Dunno <LGDataFound>().Init(false); Trail.Dunno <InternalFlow>().Init(); InternalFlow(); return; } else { Trail.Dunno <LGDataFound>().Init(true); } if (Trail.MyInputData.ResponseErrors.Count > 0) { Output.ErrorInLGData = true; Trail.Negative <LGWithoutError>(true).Init(false); } else { Output.ErrorInLGData = false; Trail.Dunno <LGWithoutError>().Init(true); } // if if (Trail.MyInputData.HardReject) { Trail.Affirmative <LGHardReject>(true).Init(true); } else { Trail.Dunno <LGHardReject>().Init(false); } if (Trail.MyInputData.Bucket == null) { Trail.Negative <HasBucket>(true).Init(false); } else { Trail.Dunno <HasBucket>().Init(true); } if (Trail.MyInputData.MatchingGradeRanges.Count < 1) { Trail.Affirmative <OfferConfigurationFound>(true).Init(0); } else if (Trail.MyInputData.MatchingGradeRanges.Count > 1) { Trail.Negative <OfferConfigurationFound>(true).Init(Trail.MyInputData.MatchingGradeRanges.Count); Log.Alert( "Too many grade range + product subtype pairs found for a {0} customer {1}, " + "score {2}, origin {3}, company is {4}regulated, loan source {5}.", Trail.MyInputData.LoanCount > 0 ? "returning" : "new", this.args.CustomerID, Trail.MyInputData.Score == null ? "'N/A'" : Trail.MyInputData.Score.ToString(), Trail.MyInputData.CustomerOrigin == null ? "'N/A'" : Trail.MyInputData.CustomerOrigin.Value.ToString(), Trail.MyInputData.CompanyIsRegulated ? string.Empty : "non-", Trail.MyInputData.LoanSource == null ? "'N/A'" : Trail.MyInputData.LoanSource.Value.ToString() ); } else { Trail.Dunno <OfferConfigurationFound>().Init(1); MatchingGradeRanges.SubproductGradeRange spgr = Trail.MyInputData.MatchingGradeRanges[0]; Output.GradeRangeID = spgr.GradeRangeID; Output.ProductSubTypeID = spgr.ProductSubTypeID; } // if Trail.DecideIfNotDecided(); } // LogicalGlueFlow