CCrmBizProcHelper::HasRunningWorkflows

  1. Bitrix24 API (v. 23.675.0)
  2. crm
  3. CCrmBizProcHelper
  4. HasRunningWorkflows
  • Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/classes/general/crm_bizproc_helper.php
  • Класс: \CCrmBizProcHelper
  • Вызов: CCrmBizProcHelper::HasRunningWorkflows
static function HasRunningWorkflows($ownerTypeID, $ownerID)
{
	if (!(IsModuleInstalled('bizproc') && CModule::IncludeModule('bizproc') && CBPRuntime::isFeatureEnabled()))
	{
		return false;
	}

	$ownerTypeID = (int)$ownerTypeID;
	$ownerID = (int)$ownerID;

	$ownerTypeName = CCrmOwnerType::ResolveName($ownerTypeID);
	if($ownerTypeName === '')
	{
		return false;
	}

	$docName = self::ResolveDocumentName($ownerTypeID);
	if($docName === '')
	{
		return false;
	}

	$docID = "{$ownerTypeName}_{$ownerID}";
	return (CBPStateService::CountDocumentWorkflows(array('crm', $docName, $docID)) > 0);
}

Добавить комментарий