CBPDocument::setTasksUserStatus: Bitrix method

      
<?php 
//  CBPDocument :: setTasksUserStatus()
//  /dist/bitrix/modules/bizproc/classes/general/document.php:546

    
public static function setTasksUserStatus($userId$status$ids = array(), &$errors = array())
    {
        
$filter = array(
            
'USER_ID' => $userId,
            
'STATUS' => CBPTaskStatus::Running,
            
'USER_STATUS' => CBPTaskUserStatus::Waiting,
        );
        if (
$ids)
        {
            
$ids array_filter(array_map('intval', (array)$ids));
            if (
$ids)
                
$filter['ID'] = $ids;
        }

        
$iterator CBPTaskService::GetList(array('ID'=>'ASC'),
            
$filter,
            
false,
            
false,
            array(
'ID''NAME''WORKFLOW_ID''ACTIVITY''ACTIVITY_NAME''IS_INLINE'));
        while (
$task $iterator->fetch())
        {
            if (
$task['IS_INLINE'] == 'Y')
            {
                
$taskErrors = array();
                
self::PostTaskForm($task$userId, array('INLINE_USER_STATUS' => $status), $taskErrors);
                if (!empty(
$taskErrors))
                    foreach (
$taskErrors as $error)
                        
$errors[] = GetMessage('BPCGDOC_ERROR_ACTION', array('#NAME#' => $task['NAME'], '#ERROR#' => $error['message']));
            }
            else
                
$errors[] = GetMessage('BPCGDOC_ERROR_TASK_IS_NOT_INLINE', array('#NAME#' => $task['NAME']));

        }
        return 
true;
    }