SetStatusTitle: Bitrix method

      
<?php 
//  SetStatusTitle()
//  /dist/bitrix/modules/bizproc/classes/general/activity.php:350

    
public function SetStatusTitle($title '')
    {
        
$rootActivity $this->GetRootActivity();
        
$stateService $this->workflow->GetService("StateService");
        if (
$rootActivity instanceof CBPStateMachineWorkflowActivity)
        {
            
$arState $stateService->GetWorkflowState($this->GetWorkflowInstanceId());

            
$arActivities $rootActivity->CollectNestedActivities();
            
/** @var CBPActivity $activity */
            
foreach ($arActivities as $activity)
                if (
$activity->GetName() == $arState["STATE_NAME"])
                    break;

            
$stateService->SetStateTitle(
                
$this->GetWorkflowInstanceId(),
                
$activity->Title.($title != '' ": ".$title '')
            );
        }
        else
        {
            if (
$title != '')
            {
                
$stateService->SetStateTitle(
                    
$this->GetWorkflowInstanceId(),
                    
$title
                
);
            }
        }
    }