• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/automation/engine/runtime.php
  • Класс: BitrixBizprocAutomationEngineRuntime
  • Вызов: Runtime::getWorkflowInstanceIds
protected function getWorkflowInstanceIds()
{
	$documentType = $this->getTarget()->getDocumentType();
	$documentId = $this->getTarget()->getDocumentId();
	$ids = WorkflowInstanceTable::getList([
		'select' => ['ID'],
		'filter' => [
			'=MODULE_ID' => $documentType[0],
			'=ENTITY' => $documentType[1],
			'=DOCUMENT_ID' => $documentId,
			'@STARTED_EVENT_TYPE' => [CBPDocumentEventType::Automation, CBPDocumentEventType::Debug],
			'=TEMPLATE.DOCUMENT_TYPE' => $documentType[2],
		],
	])->fetchAll();

	return array_column($ids, 'ID');
}