Esempio n. 1
0
  public void open() throws TeiidProcessingException, TeiidComponentException {
    if (!this.evaluatedParams) {
      if (this.outParams != null) {
        for (ElementSymbol param : this.outParams) {
          setParameterValue(param, getCurrentVariableContext(), null);
        }
      }
      if (this.params != null) {
        for (Map.Entry<ElementSymbol, Expression> entry : this.params.entrySet()) {
          ElementSymbol param = entry.getKey();
          Expression expr = entry.getValue();

          VariableContext context = getCurrentVariableContext();
          if (context.getVariableMap().containsKey(param)) {
            continue;
          }
          Object value = this.evaluateExpression(expr);

          // check constraint
          checkNotNull(param, value);
          setParameterValue(param, context, value);
        }
        this.evaluator.close();
      } else if (runInContext) {
        // if there are no params, this needs to run in the current variable context
        this.currentVarContext.setParentContext(parentContext);
      }
      this.push(originalProgram);
    }
    this.evaluatedParams = true;
  }
Esempio n. 2
0
 private void removeAllCursors(VariableContext cs) {
   for (Map.Entry<Object, Object> entry : cs.getVariableMap().entrySet()) {
     removeState((CursorState) entry.getValue());
   }
 }