Tracker :: getStatusesStates: Bitrix method

      
<?php 
//  Bitrix\Bizproc\Automation\Tracker :: getStatusesStates()
//  /dist/bitrix/modules/bizproc/lib/automation/tracker.php:142

    
private function getStatusesStates($statuses)
    {
        
$states = array();
        
$templateIds $this->getBizprocTemplateIds($statuses);

        if (!
$templateIds)
            return 
$states;

        
$stateIterator WorkflowStateTable::getList(array(
            
'select' => array('ID''WORKFLOW_TEMPLATE_ID'),
            
'filter' => array(
                
'=DOCUMENT_ID' => $this->target->getDocumentId(),
                
'@WORKFLOW_TEMPLATE_ID' => array_keys($templateIds)
            ),
            
'order' => array('STARTED' => 'DESC')
        ));

        while (
$row $stateIterator->fetch())
        {
            
$status $templateIds[$row['WORKFLOW_TEMPLATE_ID']];
            if (!
in_array($status$states))
                
$states[$row['ID']] = $status;
        }

        return 
$states;
    }