<?php
// CBPRuntime :: AddService()
// /dist/bitrix/modules/bizproc/classes/general/runtime.php:350
public function AddService($name, CBPRuntimeService $service)
{
if ($this->isStarted)
throw new Exception("Runtime is started");
$name = trim($name);
if (strlen($name) <= 0)
throw new Exception("Service code is empty");
if (!$service)
throw new Exception("Service is null");
if (array_key_exists($name, $this->arServices))
throw new Exception("Service is already exists");
$this->arServices[$name] = $service;
}