• Модуль: bizproc
  • Путь к файлу: ~/bitrix/modules/bizproc/lib/Debugger/Session/Session.php
  • Класс: BitrixBizprocDebuggerSessionSession
  • Вызов: Session::finish
public function finish()
{
	if ($this->isBeforeDebuggerStartState())
	{
		$this->fillDocuments();
		$documents = clone($this->getDocuments());
		if ($documents)
		{
			foreach ($documents as $document)
			{
				$this->removeFromDocuments($document);
			}
		}
	}

	$this
		->setFinishedDate(new BitrixMainTypeDateTime())
		->setActive(false)
	;

	//$this->killWorkflows();
	$this->terminateWorkflows();

	$result = $this->save();
	if ($result->isSuccess() && $this->isFixed())
	{
		$documentService = CBPRuntime::GetRuntime(true)->getDocumentService();

		$documentService->onDebugSessionDocumentStatusChanged(
			$this->getFixedDocument()->getParameterDocumentId(),
			$this->getStartedBy(),
			DocumentStatus::FINISHED
		);
	}

	return $result;
}