Get all running (unfinished) flows from database. {@inheritDoc}
150
@Override
  public List<ExecutableFlow> getRunningFlows() {
    final ArrayList<ExecutableFlow> flows = new ArrayList<>();
    try {
      getFlowsHelper(flows, this.executorLoader.fetchUnfinishedFlows().values());
    } catch (final ExecutorManagerException e) {
      logger.error("Failed to get running flows.", e);
    }
    return flows;
  }
213791
protected function getRequestsNotRunning()
    {
        $map = $this->queue;
        foreach ($this->running as $k => $v) unset($map[$k]);
        return $map;
    }
529242
private function collectTransitions()
	{
		$nlEdges = $this->_xp->query('//ns:edge');
		if ($nlEdges->length == 0) {
			throw new WorkflowException("no edge could be found in this workflow");
		}

		$result = [];
		for ($i = 0; $i < $nlEdges->length; $i ++) {
			$currentNode = $nlEdges->item($i);

			$source = trim($this->_xp->query("@source", $currentNode)->item(0)->value);
			$target = trim($this->_xp->query("@target", $currentNode)->item(0)->value);

			if (! isset($result[$source]) || ! isset($result[$source][$target])) {
				$result[$source][$target] = [];
			}
		}
		return $result;
	}
1366256
public function getAll()
    {
        $query = $this->createQuery();
        $result = $this->database->query($query);

        $entities = [];
        if ($result) {
            $result = $result->fetchAll(\PDO::FETCH_ASSOC);
            $entities = $this->handleResult($result);
        }
        if ($this->returnOne && is_array($entities)) {
            return current($entities);
        }
        return $entities;
    }
296353
private void completePendingFlush()
  {
    int size = _pendingFlushEntries.size();
    
    if (size == 0) {
      return;
    }

    // ArrayList<TableService.PageFlush> pageList = new ArrayList<>();
    
    for (int i = 0; i < size; i++) {
      PendingEntry entry = _pendingFlushEntries.get(i);
      
      entry.afterFlush();
      
      _pendingFsyncEntries.add(entry);
    }
    
    // _tableService.afterDataFlush(pageList);
    
    _pendingFlushEntries.clear();
  }
439277
@Override
  public Collection<FastFuture<T>> getAllResults() {
    results.addAll(active);
    active.clear();
    return results;
  }
1157420
public List<Integer> getRunningFlowIds() {
    final List<Integer> allIds = new ArrayList<>();
    try {
      getExecutionIdsHelper(allIds, this.executorLoader.fetchUnfinishedFlows().values());
    } catch (final ExecutorManagerException e) {
      this.logger.error("Failed to get running flow ids.", e);
    }
    return allIds;
  }
1201037
@Override
  public List<ExecutableFlow> fetchRecentlyFinishedFlows(final Duration maxAge)
      throws ExecutorManagerException {
    return this.executionFlowDao.fetchRecentlyFinishedFlows(maxAge);
  }
497675
public function findRunningChangeset()
    {
        $qb = $this->createQueryBuilder('ac')
            ->select('ac')
            ->where('ac.status = :status')
            ->addOrderBy('ac.id', 'ASC')
            ->setMaxResults(1)
            ->setParameter('status', AclChangeset::STATUS_RUNNING);

        return $qb->getQuery()->getOneOrNullResult();
    }
758897
def UpdateFlow(self,
                 client_id,
                 flow_id,
                 flow_obj=db.Database.unchanged,
                 flow_state=db.Database.unchanged,
                 client_crash_info=db.Database.unchanged,
                 pending_termination=db.Database.unchanged,
                 processing_on=db.Database.unchanged,
                 processing_since=db.Database.unchanged,
                 processing_deadline=db.Database.unchanged):
    """"""

    try:
      flow = self.flows[(client_id, flow_id)]
    except KeyError:
      raise db.UnknownFlowError(client_id, flow_id)

    if flow_obj != db.Database.unchanged:
      self.flows[(client_id, flow_id)] = flow_obj
      flow = flow_obj

    if flow_state != db.Database.unchanged:
      flow.flow_state = flow_state
    if client_crash_info != db.Database.unchanged:
      flow.client_crash_info = client_crash_info
    if pending_termination != db.Database.unchanged:
      flow.pending_termination = pending_termination
    if processing_on != db.Database.unchanged:
      flow.processing_on = processing_on
    if processing_since != db.Database.unchanged:
      flow.processing_since = processing_since
    if processing_deadline != db.Database.unchanged:
      flow.processing_deadline = processing_deadline
    flow.last_update_time = rdfvalue.RDFDatetime.Now()
1220183
public static function get_recordset_for_due_and_incomplete() {
        global $DB;
        $sql = "duedate > 0 AND duedate < :now AND status = :status";
        $params = array('now' => time(), 'status' => self::STATUS_ACTIVE);
        return $DB->get_recordset_select(self::TABLE, $sql, $params);
    }
954350
public Flow[] getFlows()
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {
      SibTr.entry(tc, "getFlows");
    }
    Flow[] clonedFlows = flows.clone();
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
    {    
      SibTr.exit(tc, "getFlows", clonedFlows);
    }    
    return clonedFlows;
  }
89261
protected function continueRevertDatabase() {
		$this->log("Checking status of {$this->Title}...");

		// Skip snapshot for dry run
		if($this->Pipeline()->DryRun) {
			$this->log("[Skipped] Checking progress of snapshot restore");
			return $this->finish();
		}

		// Get related snapshot
		$transfer = $this->RollbackDatabase();
		if(empty($transfer) || !$transfer->exists()) {
			$this->log("Missing database transfer for in-progress {$this->Title}");
			$this->markFailed();
			return false;
		}

		// Check finished state
		$status = $transfer->ResqueStatus();
		if($this->checkResqueStatus($status)) {
			// Re-enable the site by disabling the maintenance, since the DB restored successfully
			$this->Pipeline()->Environment()->disableMaintenance($this->Pipeline()->getLogger());

			// After revert is complete we are done
			return $this->finish();
		}
	}
488881
public function get_all()
    {
        $this->trigger('before_get');

        if ($this->soft_delete && $this->_temporary_with_deleted !== TRUE)
        {
            $this->_database->where($this->soft_delete_key, (bool)$this->_temporary_only_deleted);
        }

        $result = $this->_database->get($this->_table)
                           ->{$this->_return_type(1)}();
        $this->_temporary_return_type = $this->return_type;

        foreach ($result as $key => &$row)
        {
            $row = $this->trigger('after_get', $row, ($key == count($result) - 1));
        }

        $this->_with = array();
        return $result;
    }
684007
public function flush()
    {
        if ($this->is_done) {
            throw new RuntimeException('This batch insert is already done');
        }

        $count_rows = count($this->rows);

        if ($count_rows > 0) {
            $this->connection->execute($this->sql_foundation . implode(', ', $this->rows));

            $this->rows = [];
            $this->total += $count_rows;
        }
    }
878610
public function getAllStatuses($workflowId)
	{
		$wDef = $this->getWorkflowDefinition($workflowId);
		if ( $wDef == null) {
			throw new WorkflowException('No workflow found with id ' . $workflowId);
		}
		$allStatuses = [];
		foreach( $wDef[self::KEY_NODES] as $statusId => $statusDef){
			$allStatuses[$statusId] = $this->getStatus($statusId);
		}
		return $allStatuses;
	}
613802
public function getAll()
    {
        if (!$this->isDataLoadedFromDb) {
            $stmt = $this->db->prepare('SELECT * FROM ' . $this->name);
            $stmt->execute();

            while ($row = $stmt->fetch(\PDO::FETCH_NUM, \PDO::FETCH_ORI_NEXT)) {
                $this->data[$row[0]] = $row[1];
            }
        }

        return $this->data;
    }