Exemplo n.º 1
0
        /// <summary>
        /// Explains the current item
        /// </summary>
        /// <param name="subElements"></param>
        /// <returns></returns>
        public string getExplain(bool subElements)
        {
            string retVal = "";

            if (Type != null)
            {
                if (!Utils.Utils.isEmpty(Type.Comment))
                {
                    retVal = retVal + Type.Comment + "\n";
                }
            }

            if (!Utils.Utils.isEmpty(Comment))
            {
                retVal = retVal + Comment;
            }

            return(TextualExplainUtilities.Encapsule(retVal));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Provides an explanation of the rule's behaviour
        /// </summary>

        /// <param name="explainSubElements">Precises if we need to explain the sub elements (if any)</param>
        /// <returns></returns>
        public string getExplain(bool explainSubRules)
        {
            string retVal = "";

            List <PreCondition> enclosingPreConditions = new List <PreCondition>();

            if (EnclosingRuleCondition != null)
            {
                enclosingPreConditions = EnclosingRuleCondition.AllPreConditions;
            }

            if (enclosingPreConditions.Count == 0 || explainSubRules)
            {
                retVal = retVal + getExplain(0, explainSubRules);
            }
            else  // we will only display enclosing preconditions for the report, when explainSubRules == true
            {
                bool first = true;
                foreach (PreCondition preCondition in enclosingPreConditions)
                {
                    if (first)
                    {
                        retVal = retVal + "{\\b IF} " + preCondition.getExplain(true);
                        first  = false;
                    }
                    else
                    {
                        retVal = retVal + "{\\b AND} " + preCondition.getExplain(true);
                    }
                }
                if (!first)
                {
                    retVal = retVal + "{\\b THEN}\\par";
                }
                retVal = retVal + getExplain(2, explainSubRules);
                if (!first)
                {
                    retVal = retVal + "{\\b END IF}\\par";
                }
            }

            return(TextualExplainUtilities.Encapsule(retVal));
        }
Exemplo n.º 3
0
        /// <summary>
        /// Provides an explanation of the rule's behaviour
        /// </summary>
        /// <returns></returns>
        public string getExplain(bool explainSubElements)
        {
            string retVal = getExplain(0, true);

            return(TextualExplainUtilities.Encapsule(retVal));
        }