Exemplo n.º 1
0
  /**
   * Extracts expected variables from the environmet.
   *
   * @param expectedVariables
   * @param environment
   * @return
   */
  private Map<String, Variable> getResultMap(
      List<String> expectedVariables, Environment environment) {

    Map<String, Variable> resultMap = new HashMap<String, Variable>();
    /*
     * foreach expectedVariables get it from environment put into the
     * resultMap
     */
    for (String varName : expectedVariables) {
      Variable variable = environment.getUncheckedVariable(varName);
      resultMap.put(varName, variable);
    }
    return resultMap;
  }
Exemplo n.º 2
0
 /**
  * Executes node and push result of execution into environment
  *
  * @param node - to be executed
  * @param environment - in which the execution will take place, and result will be pushed in.
  * @throws CallerException
  */
 private void executeInternal(Node node, Environment environment) throws CallerException {
   String nodeIdentifier = node.getId();
   Object nodeExecutionResult = node.execute(environment);
   Variable nodeResult = VariableFactory.newInstance(nodeExecutionResult);
   environment.addOrUpdateVariable(nodeIdentifier, nodeResult);
 }