Ejemplo n.º 1
0
        public static Claim Execute(Claim claim)
        {
            var sw = Stopwatch.StartNew();

            if (!ShouldExecute(claim)) return claim;
            ClearLocksBlock.UnlockClaim(claim);

            try
            {
                if (!Reopening(claim))
                {
                    var transaction = claim.CreateAmendClaimTransaction();
                    if (transaction == null) return claim;
                    ValidateClaimUsingTransactionRules(transaction, claim);
                    transaction.Cancel();
                }
                if (string.IsNullOrEmpty(claim.CustomCode18)) claim.CustomCode18 = claim.ExcessAndDeductiblesToProcess ? "C01" : "C02";
                return claim;
            }
            finally
            {
                sw.Stop();
                var workDone = GlobalClaimWakeUp.Statistics.GetOrAdd(typeof(ValidateClaimBlock).Name, TimeSpan.FromMilliseconds(sw.ElapsedMilliseconds));
                GlobalClaimWakeUp.Statistics[typeof(ValidateClaimBlock).Name] = (workDone + TimeSpan.FromMilliseconds(sw.ElapsedMilliseconds));
            }
        }