/*
   * (non-Javadoc)
   *
   * @see com.aof.service.business.rule.FlowManager#executeControlFlow(com.aof.model.business.Controllable)
   */
  public boolean executeControlFlow(Controllable target) throws NoAvailableFlowToExecuteException {
    if (target == null) {
      throw new RuntimeException("Cannot execute flow on null target");
    }

    EngineFlow ef = workspace.getFlow(target.getControlFlowName());
    if (ef == null) {
      throw new NoAvailableFlowToExecuteException();
    }
    List l = ef.execute(target);
    int s = l.size();
    if (s == 0) {
      throw new RuntimeException(
          "Execute control flow return empty result list, this is a coding error.");
    }
    return ((Boolean) l.get(s - 1)).booleanValue();
  }