public boolean isFinished() {
    for (ShortTaskStatus ts : getRequestStatus().getTasks()) {
      if (!HostRoleStatus.valueOf(ts.getStatus()).isCompletedState()) {
        return false;
      }
    }
    return true;
  }
@return true if all the tasks in the logical request are in completed state, false otherwise
ambari-server/src/main/java/org/apache/ambari/server/topology/LogicalRequest.java