コード例 #1
0
ファイル: Agent.cs プロジェクト: vijayamazon/ezbob
        }         // InternalFlow

        private void ComparePrimaryAndSecondary(AutomationCalculator.AutoDecision.AutoRejection.LGAgent oSecondary)
        {
            if (Trail.HasApprovalChance == oSecondary.Trail.HasApprovalChance)
            {
                Trail.Negative <SameApprovalChance>(false)
                .Init(Trail.HasApprovalChance, oSecondary.Trail.HasApprovalChance);
                oSecondary.Trail.Negative <SameApprovalChance>(false)
                .Init(Trail.HasApprovalChance, oSecondary.Trail.HasApprovalChance);
            }
            else
            {
                Trail.Affirmative <SameApprovalChance>(false)
                .Init(Trail.HasApprovalChance, oSecondary.Trail.HasApprovalChance);
                oSecondary.Trail.Affirmative <SameApprovalChance>(false)
                .Init(Trail.HasApprovalChance, oSecondary.Trail.HasApprovalChance);
            }             // if

            if (Output.FlowType == oSecondary.Output.FlowType)
            {
                Trail.Dunno <SameFlowChosen>().Init(Output.FlowType, oSecondary.Output.FlowType);
                oSecondary.Trail.Dunno <SameFlowChosen>().Init(Output.FlowType, oSecondary.Output.FlowType);
            }
            else
            {
                Trail.Negative <SameFlowChosen>(true).Init(Output.FlowType, oSecondary.Output.FlowType);
                oSecondary.Trail.Negative <SameFlowChosen>(true).Init(Output.FlowType, oSecondary.Output.FlowType);
            }             // if

            if (Output.GradeRangeID == oSecondary.Output.GradeRangeID)
            {
                Trail.Dunno <SameConfigurationChosen>().Init(Output.GradeRangeID, oSecondary.Output.GradeRangeID);
                oSecondary.Trail.Dunno <SameConfigurationChosen>()
                .Init(Output.GradeRangeID, oSecondary.Output.GradeRangeID);
            }
            else
            {
                Trail.Negative <SameConfigurationChosen>(true).Init(Output.GradeRangeID, oSecondary.Output.GradeRangeID);
                oSecondary.Trail.Negative <SameConfigurationChosen>(true)
                .Init(Output.GradeRangeID, oSecondary.Output.GradeRangeID);
            }     // if
        }         // ComparePrimaryAndSecondary
コード例 #2
0
ファイル: Agent.cs プロジェクト: vijayamazon/ezbob
        protected virtual void RunPrimary()
        {
            using (Trail.AddCheckpoint(ProcessCheckpoints.OldWayFlow)) {
                this.oldWayAgent.Init().RunPrimaryOnly();
                this.oldWayAgent.Trail.UniqueID = this.args.TrailUniqueID;
                this.oldWayAgent.Trail.SetTag(this.args.Tag).Save(DB, null, TrailPrimaryStatus.OldPrimary);
            }             // old flow step

            using (Trail.AddCheckpoint(ProcessCheckpoints.GatherData)) {
                var inputData = new LGRejectionInputData();
                inputData.Init(
                    this.oldWayAgent.Trail.MyInputData.DataAsOf,
                    this.oldWayAgent.Trail.MyInputData,
                    this.oldWayAgent.Trail.MyInputData
                    );

                GatherData(inputData);

                Trail.MyInputData.Init(inputData.DataAsOf, inputData, inputData);
            }             // gather data step

            using (Trail.AddCheckpoint(ProcessCheckpoints.MakeDecision)) {
                if (Trail.MyInputData.AutoDecisionInternalLogic)
                {
                    Trail.Dunno <InternalFlow>().Init();
                }
                else
                {
                    Trail.Dunno <LogicalGlueFlow>().Init();
                }

                if (LogicalGlueFlowFollowed)
                {
                    LogicalGlueFlow();
                }
                else
                {
                    InternalFlow();
                }
            }     // make decision step
        }         // RunPrimary
コード例 #3
0
ファイル: Agent.cs プロジェクト: vijayamazon/ezbob
        }         // StepNoReject

        private T StepNoDecision <T>() where T : ATrace
        {
            return(Trail.Dunno <T>());
        } // StepNoDecision
コード例 #4
0
ファイル: Agent.cs プロジェクト: vijayamazon/ezbob
        }         // 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