CBPDocument :: UpdateWorkflowTemplate: Bitrix method

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

    
public static function UpdateWorkflowTemplate($id$documentType$arFields, &$arErrors)
    {
        
$arErrors = array();

        
$dbTemplates CBPWorkflowTemplateLoader::GetList(
            array(),
            array(
"ID" => $id"DOCUMENT_TYPE" => $documentType),
            
false,
            
false,
            array(
"ID")
        );
        
$arTemplate $dbTemplates->Fetch();
        if (!
$arTemplate)
        {
            
$arErrors[] = array(
                
"code" => 0,
                
"message" => str_replace("#ID#"$idGetMessage("BPCGDOC_INVALID_WF_ID")),
                
"file" => ""
            
);
            return;
        }

        try
        {
            
CBPWorkflowTemplateLoader::Update($id$arFields);
        }
        catch (
Exception $e)
        {
            
$arErrors[] = array(
                
"code" => $e->getCode(),
                
"message" => $e->getMessage(),
                
"file" => $e->getFile()." [".$e->getLine()."]"
            
);
        }
    }