示例#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);
 }