Package org.openhab.model.rule.rules

Examples of org.openhab.model.rule.rules.RuleModel.eAdapters()


   */
  public static synchronized IEvaluationContext getContext(Rule rule) {
      RuleModel ruleModel = (RuleModel) rule.eContainer();

      // check if a context already exists on the resource
      for(Adapter adapter : ruleModel.eAdapters()) {
      if(adapter instanceof RuleContextAdapter) {
        return ((RuleContextAdapter) adapter).getContext();
      }
    }
   
View Full Code Here


          logger.warn("Variable '{}' on rule file '{}' cannot be initialized with value '{}': {}",
              new String[] { var.getName(), ruleModel.eResource().getURI().path(), var.getRight().toString(), e.getMessage() });
        }
      }
      }
      ruleModel.eAdapters().add(new RuleContextAdapter(evaluationContext));
    return evaluationContext;
  }

  /**
   * Inner class that wraps an evaluation context into an EMF adapters
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.