• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/automation/tracker.php
  • Класс: BitrixBizprocAutomationTracker
  • Вызов: Tracker::getStatusesStates
private function getStatusesStates($statuses)
{
	$states = array();
	$templateIds = $this->getBizprocTemplateIds($statuses);

	if (!$templateIds)
		return $states;

	$stateIterator = WorkflowStateTable::getList(array(
		'select' => array('ID', 'WORKFLOW_TEMPLATE_ID'),
		'filter' => array(
			'=DOCUMENT_ID' => $this->target->getDocumentId(),
			'@WORKFLOW_TEMPLATE_ID' => array_keys($templateIds)
		),
		'order' => array('STARTED' => 'DESC')
	));

	while ($row = $stateIterator->fetch())
	{
		$status = $templateIds[$row['WORKFLOW_TEMPLATE_ID']];
		if (!in_array($status, $states))
			$states[$row['ID']] = $status;
	}

	return $states;
}