CBPWorkflowTemplateLoader :: CheckWorkflowParameters: Bitrix method

      
<?php 
//  CBPWorkflowTemplateLoader :: CheckWorkflowParameters()
//  /dist/bitrix/modules/bizproc/classes/general/workflowtemplateloader.php:657

    
public static function CheckWorkflowParameters($arTemplateParameters$arPossibleValues$documentType, &$arErrors)
    {
        
$arErrors = array();
        
$arWorkflowParameters = array();

        if (
count($arTemplateParameters) <= 0)
            return array();

        
$runtime CBPRuntime::GetRuntime();
        
$runtime->StartRuntime();
        
$documentService $runtime->GetService("DocumentService");

        foreach (
$arTemplateParameters as $parameterKey => $arParameter)
        {
            
$arErrorsTmp = array();

            
$arWorkflowParameters[$parameterKey] = $documentService->GetFieldInputValue(
                
$documentType,
                
$arParameter,
                
$parameterKey,
                
$arPossibleValues,
                
$arErrorsTmp
            
);

            if (
CBPHelper::getBool($arParameter['Required']) && CBPHelper::isEmptyValue($arWorkflowParameters[$parameterKey]))
            {
                
$arErrorsTmp[] = array(
                    
"code" => "RequiredValue",
                    
"message" => str_replace("#NAME#"$arParameter["Name"], GetMessage("BPCGWTL_INVALID8")),
                    
"parameter" => $parameterKey,
                );
            }

            
$arErrors array_merge($arErrors$arErrorsTmp);
        }

        return 
$arWorkflowParameters;
    }