示例#1
0
  public void run() throws ExpressionException {
    for (int i = 0; i < 5; i++) {
      store.clearDirtyState();
      for (Rule rule : rules) {
        rule.execute();
      }

      if (!store.isDirtyState()) {
        break;
      }
    }
  }
示例#2
0
  public void runOnce() throws ExpressionException {
    List<Rule> currentRules = new ArrayList<Rule>(rules);
    List<Rule> nextRules = new ArrayList<Rule>();
    for (int i = 0; i < 5; i++) {
      store.clearDirtyState();
      for (Rule rule : currentRules) {
        boolean matched = rule.execute();
        if (!matched) {
          nextRules.add(rule);
        }
      }

      if (!store.isDirtyState()) {
        break;
      }
      currentRules = nextRules;
      nextRules = new ArrayList<Rule>();
    }
  }
 public EvaluationResult(Rule r) {
   rule = r;
   status = r.execute();
 }