/// <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 WonkaBizRuleReportNode FindRuleReport(int pnRuleSetId, int pnRuleId) { WonkaBizRuleReportNode RuleReportNode = null; WonkaBizRuleSetReportNode RuleSetReportNode = FindRuleSetReport(pnRuleSetId, false); if (RuleSetReportNode != null) { RuleReportNode = RuleSetReportNode.RuleResults.Where(x => x.RuleID == pnRuleId).FirstOrDefault(); } return(RuleReportNode); }
/// <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(WonkaBizRule poRule, ERR_CD peRuleErrCd, string psRuleErrorDesc, string psVerboseError) { bool bResult = true; WonkaBizRuleSetReportNode RuleSetReportNode = FindRuleSetReport(poRule.ParentRuleSetId, true); if (RuleSetReportNode != null) { WonkaBizRuleReportNode RuleReportNode = new WonkaBizRuleReportNode(poRule); RuleReportNode.ErrorCode = peRuleErrCd; RuleReportNode.ErrorDescription = psRuleErrorDesc; RuleReportNode.VerboseError = psVerboseError; RuleSetReportNode.RuleResults.Add(RuleReportNode); } return(bResult); }