Ejemplo n.º 1
0
 /**
  * Returns whether or not the rule is waived for this plan
  *
  * @see isEnabled
  * @param rule
  * @return
  */
 public static boolean isWaived(EPlanElement element, ERule rule) {
   RuleAdvisorMember ruleMember = element.getMember(RuleAdvisorMember.class, true);
   List<String> ruleNames =
       WaiverUtils.getExistingWaivedViolations(ruleMember, RuleAdvisorMember.RULE_WAIVERS_KEY);
   if (ruleNames != null) {
     return ruleNames.contains(rule.getName());
   }
   return false;
 }
Ejemplo n.º 2
0
 /** Returns a list of the names of all the rules that are currently waived on the element */
 public static EcoreEList<String> getWaivedRuleNames(EPlanElement element) {
   RuleAdvisorMember ruleMember = element.getMember(RuleAdvisorMember.class, true);
   List<String> ruleNames =
       WaiverUtils.getWaivedViolations(ruleMember, RuleAdvisorMember.RULE_WAIVERS_KEY);
   return (EcoreEList<String>) ruleNames;
 }