예제 #1
0
파일: Flow.java 프로젝트: dursunkoc/Lion
  /**
   * 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;
  }
예제 #2
0
파일: Flow.java 프로젝트: dursunkoc/Lion
 /**
  * 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);
 }