• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/classes/general/stateservice.php
  • Класс: CBPStateService
  • Вызов: CBPStateService::onStatusChange
public function onStatusChange($workflowId, $status)
{
	if ($status == CBPWorkflowStatus::Completed || $status == CBPWorkflowStatus::Terminated)
	{
		$info = $this->getWorkflowStateInfo($workflowId);
		$userId = isset($info['STARTED_BY']) ? (int)$info['STARTED_BY'] : 0;
		if ($userId > 0)
		{
			self::cleanRunningCountersCache($userId);
		}

		foreach (GetModuleEvents('bizproc', 'OnWorkflowComplete', true) as $event)
		{
			ExecuteModuleEventEx($event, array($workflowId, $status));
		}
		//Clean workflow subscriptions
		BitrixBizprocSchedulerEventTable::deleteByWorkflow($workflowId);
	}
}