예제 #1
0
파일: Agent.cs 프로젝트: vijayamazon/ezbob
        public override void MakeAndVerifyDecision()
        {
            AutomationCalculator.AutoDecision.AutoRejection.RejectionAgent oSecondary = null;
            try {
                RunPrimary();

                oSecondary = RunSecondary();

                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

                WasMismatch = !Trail.EqualsTo(oSecondary.Trail);
            } catch (Exception e) {
                Log.Error(e, "Exception during auto rejection.");
                StepNoReject <ExceptionThrown>().Init(e);
            }             // try

            Trail.Save(DB, oSecondary == null ? null : oSecondary.Trail);
        }         // MakeAndVerifyDecision
예제 #2
0
        }         // Init

        public override void MakeAndVerifyDecision()
        {
            try {
                RunPrimary();

                AutomationCalculator.AutoDecision.AutoReApproval.Agent oSecondary = RunSecondary();

                WasMismatch = !Trail.EqualsTo(oSecondary.Trail);

                Log.Debug("Auto re-approval matching result: {0}match.", WasMismatch ? "mis" : string.Empty);

                if (!WasMismatch && Trail.HasDecided)
                {
                    Log.Debug("Match and approved.");

                    if (ApprovedAmount == oSecondary.Result.ReApproveAmount)
                    {
                        Log.Debug("Auto re-approval: match and approved and same amount of {0}.", ApprovedAmount);

                        Trail.Affirmative <SameAmount>(false).Init(ApprovedAmount);
                        oSecondary.Trail.Affirmative <SameAmount>(false).Init(oSecondary.Result.ReApproveAmount);
                    }
                    else
                    {
                        Log.Debug(
                            "Auto re-approval: match and approved but different amounts: {0} primary vs {1} secondary.",
                            ApprovedAmount,
                            oSecondary.Result.ReApproveAmount
                            );

                        Trail.Negative <SameAmount>(false).Init(ApprovedAmount);
                        oSecondary.Trail.Negative <SameAmount>(false).Init(oSecondary.Result.ReApproveAmount);

                        WasMismatch = true;
                    }             // if
                }                 // if

                Output.ApprovedAmount = ApprovedAmount;

                Trail.Save(DB, oSecondary.Trail);
            } catch (Exception e) {
                Log.Error(e, "Exception during re-approval.");
                StepFailed <ExceptionThrown>().Init(e);
                Output.ApprovedAmount = 0;
            }     // try
        }         // MakeAndVerifyDecision
예제 #3
0
파일: Agent.cs 프로젝트: vijayamazon/ezbob
        public override void MakeAndVerifyDecision()
        {
            Trail.SetTag(this.args.Tag).UniqueID = this.args.TrailUniqueID;

            AutomationCalculator.AutoDecision.AutoRejection.LGAgent oSecondary = null;

            try {
                RunPrimary();

                oSecondary = RunSecondary();

                ComparePrimaryAndSecondary(oSecondary);

                WasMismatch = !Trail.EqualsTo(oSecondary.Trail, CompareTrailsQuietly);
            } catch (Exception e) {
                Log.Error(e, "Exception during auto rejection.");
                Trail.Negative <ExceptionThrown>(true).Init(e);
            }             // try

            Trail.Save(DB, oSecondary == null ? null : oSecondary.Trail);
        }         // MakeAndVerifyDecision