Template::updateBizprocTemplate: Bitrix method

      
<?php 
//  Bitrix\Bizproc\Automation\Engine\Template :: updateBizprocTemplate()
//  /dist/bitrix/modules/bizproc/lib/automation/engine/template.php:341

    
protected function updateBizprocTemplate($id$userId)
    {
        
$raw $this->template;
        
$result = new Result();

        try
        {
            \
CBPWorkflowTemplateLoader::update($id, [
                
'TEMPLATE'      => $raw['TEMPLATE'],
                
'PARAMETERS'    => $raw['PARAMETERS'],
                
'VARIABLES'     => [],
                
'CONSTANTS'     => $raw['CONSTANTS'],
                
'USER_ID'         => $userId,
                
'MODIFIER_USER' => new \CBPWorkflowTemplateUser($userId),
            ]);
        }
        catch (\
Exception $e)
        {
            
$result->addError(new Error($e->getMessage()));
        }

        return 
$result;
    }