Base class for module components.

Decision was made to collect the same phrases into single file to avoid duplicating such phrases in different files. This single file is attached to this class with a separate method created for uploading.

All components use the following life cycle:

  1. The method executeComponent calls the method init that initializes the necessary data;
  2. When some parameters are unavailable or some errors occur, they are added to object's errorCollection;
  3. After calling init, performs a check of collection errors. When errors did occur, connects a component template and further execution is terminated;
  4. Each template has a code that checks availability of errors. When errors did occur, they are printed and the rest of template is not rendered.

Inheritance chain

abstract class Bitrix\Rpa\Components\Base extends \CBitrixComponent implements Bitrix\Main\Errorable


Method Description Available from version
public static function getUsers(array $userIds): array Returns processed user data with IDs sourced from array $userIds.
public function addTopPanel(\CBitrixComponentTemplate $template) Adds upper panel from component $template. Used in component_epilog.php of rpa.router component template. As a result, its available on all module pages.
public function addToolbar(\CBitrixComponentTemplate $template) Addes "second" rpa module toolbar (component rpa.toolbar).
public static function loadBaseLanguageMessages(): array Connects module's base language phrases. Returns array with these phrases.

Protected methods

Class descendants can re-define some protected methods that affect the interface.

Method Description Available from version
protected function init(): void Executes initialization. When errors occur, they are stored in $this->errorCollection.
protected function getTypeId(): ?int returns current process ID.
protected function getTopPanelItems(): array Returns array of elements for upper panel.
protected function getToolbarParameters(): array Returns array with parameters for passing in rpa.toolbar. Array must have the following structure:

    'typeId' => $this->getTypeId(), // process ID
    'buttons' => [], // buttons for ui.toolbar
    'filter' => [], // filter settings for ui.toolbar
    'views' => [], // settings for switching display
    'tasks' => 0, // task counter

© «Bitrix24», 2001-2024