CBPDocument::StartWorkflowParametersValidate: Bitrix method

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

    
public static function StartWorkflowParametersValidate($templateId$arWorkflowParameters$documentType, &$arErrors)
    {
        
$arErrors = array();

        
$templateId intval($templateId);
        if (
$templateId <= 0)
        {
            
$arErrors[] = array(
                
"code" => "",
                
"message" => GetMessage("BPCGDOC_EMPTY_WD_ID"),
            );
            return array();
        }

        if (!isset(
$arWorkflowParameters) || !is_array($arWorkflowParameters))
            
$arWorkflowParameters = array();

        
$arWorkflowParametersValues = array();

        
$arRequest $_REQUEST;
        foreach (
$_FILES as $k => $v)
        {
            if (
array_key_exists("name"$v))
            {
                if (
is_array($v["name"]))
                {
                    
$ks array_keys($v["name"]);
                    for (
$i 0$cnt count($ks); $i $cnt$i++)
                    {
                        
$ar = array();
                        foreach (
$v as $k1 => $v1)
                            
$ar[$k1] = $v1[$ks[$i]];

                        
$arRequest[$k][] = $ar;
                    }
                }
                else
                {
                    
$arRequest[$k] = $v;
                }
            }
        }

        if (
count($arWorkflowParameters) > 0)
        {
            
$arErrorsTmp = array();
            
$ar = array();

            foreach (
$arWorkflowParameters as $parameterKey => $arParameter)
                
$ar[$parameterKey] = $arRequest["bizproc".$templateId."_".$parameterKey];

            
$arWorkflowParametersValues CBPWorkflowTemplateLoader::CheckWorkflowParameters(
                
$arWorkflowParameters,
                
$ar,
                
$documentType,
                
$arErrors
            
);
        }

        return 
$arWorkflowParametersValues;
    }