Esempio n. 1
0
        /// <summary>
        ///
        /// This method will find the RuleReport for a specific Rule.
        ///
        /// <param name="pnRuleSetId">The ID of the RuleSet who contains the Rule of interest</param>
        /// <param name="pnRuleId">The ID of the Rule of interest</param>
        /// <returns>The RuleReport that describes the execution of a specific Rule</returns>
        /// </summary>
        public WonkaBreRuleReportNode FindRuleReport(int pnRuleSetId, int pnRuleId)
        {
            WonkaBreRuleReportNode RuleReportNode = null;

            WonkaBreRuleSetReportNode RuleSetReportNode = FindRuleSetReport(pnRuleSetId, false);

            if (RuleSetReportNode != null)
            {
                RuleReportNode = RuleSetReportNode.RuleResults.Where(x => x.RuleID == pnRuleId).FirstOrDefault();
            }

            return(RuleReportNode);
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// This method will archive the results of a particular rule's execution by storing them as a
        /// a RuleReportNode and by inserting it into a RuleSetReportNode.
        ///
        /// <param name="poRule">The business rule that we have executed</param>
        /// <param name="peRuleErrCd">The error (i.e., result) code of that rule's execution</param>
        /// <param name="psRuleErrorDesc">The general description of the rule's error (if there is one)</param>
        /// <param name="psVerboseError">The verbose description of the rule's error (if there is one)</param>
        /// <returns>The indicator for whether or not the rule's execution results were successfully archived</returns>
        /// </summary>
        public bool ArchiveRuleExecution(WonkaBreRule poRule, ERR_CD peRuleErrCd, string psRuleErrorDesc, string psVerboseError)
        {
            bool bResult = true;

            WonkaBreRuleSetReportNode RuleSetReportNode = FindRuleSetReport(poRule.ParentRuleSetId, true);

            if (RuleSetReportNode != null)
            {
                WonkaBreRuleReportNode RuleReportNode = new WonkaBreRuleReportNode(poRule);

                RuleReportNode.ErrorCode        = peRuleErrCd;
                RuleReportNode.ErrorDescription = psRuleErrorDesc;
                RuleReportNode.VerboseError     = psVerboseError;

                RuleSetReportNode.RuleResults.Add(RuleReportNode);
            }

            return(bResult);
        }