PHPackages                             agoalofalife/bpm-online - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. agoalofalife/bpm-online

ActiveNo[API Development](/categories/api)

agoalofalife/bpm-online
=======================

Using the API BPM Terrasoft

2.2.1(8y ago)84.7k6[3 issues](https://github.com/agoalofalife/bpm-online/issues)MITPHPPHP &gt;=5.6.4

Since Nov 8Pushed 8y ago5 watchersCompare

[ Source](https://github.com/agoalofalife/bpm-online)[ Packagist](https://packagist.org/packages/agoalofalife/bpm-online)[ RSS](/packages/agoalofalife-bpm-online/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (12)Versions (10)Used By (0)

### API BPM ONLINE

[](#api-bpm-online)

[![Build Status](https://camo.githubusercontent.com/9a3556be27efe5f24271de99cae1cff3b4400be1b5acb804ca05d48726662556/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61676f616c6f66616c6966652f62706d2d6f6e6c696e652f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/agoalofalife/bpm-online/build-status/master)[![Twitter](https://camo.githubusercontent.com/9ac819ecc5e0d3189ad42edae67865c4c961c755e58780318669fd71f87c1321/68747470733a2f2f696d672e736869656c64732e696f2f747769747465722f75726c2f68747470732f6769746875622e636f6d2f61676f616c6f66616c6966652f67656f6772617068792e7376673f7374796c653d736f6369616c267374796c653d706c6173746963)](https://twitter.com/intent/tweet?text=Wow:&url=%5Bobject%20Object%5D)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/17e1354b4ba9d1e2ff32cc63b3c2bb724567ec423594b523ddb64d0b5b9d746f/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61676f616c6f66616c6966652f62706d2d6f6e6c696e652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/agoalofalife/bpm-online/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/7dad45ef5610a22ac9371bfa024a126051b9b6e54da14a2be7a7d1f85b9e7462/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f61676f616c6f66616c6966652f62706d2d6f6e6c696e652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/agoalofalife/bpm-online/?branch=master)[![License](https://camo.githubusercontent.com/9ea374b71e8e6675a5028df0cd3af3845df6ca8c0152509f290b31e89eadba59/68747470733a2f2f706f7365722e707567782e6f72672f61676f616c6f66616c6966652f67656f6772617068792f6c6963656e7365)](https://packagist.org/packages/agoalofalife/geography)

[RU](#RU) | [EN](#EN)

**Что это такое?**

Пакет предоставляет удобный интерфейс для работы с [API Bpm’online](https://academy.terrasoft.ru/documents/technic-sdk/7-8/rabota-s-obektami-bpmonline-po-protokolu-odata-s-ispolzovaniem-http-zaprosov) через протокол OData.

- [Установка](#Installation)
- [Настройка конфигураций](#Config)
- [Аутенфикация](#Authentication)
- [Установка коллекции](#SetCollection)
- [Основные запросы](#BasesRequest)
    - [Select](#Select)
    - [Create](#Create)
    - [Update](#Update)
    - [Delete](#Delete)
- [Обработчики ответов](#Handler)
- [Логирование](#Log)
- [Интеграция с Laravel](#Laravel)
- [Инструмент](#Tools)

Установка
---------

[](#установка)

Для установки необходимо выполнить команду из composer

```
composer require agoalofalife/bpm-online

```

Настройка конфигураций
----------------------

[](#настройка-конфигураций)

Для установки ваших конфигурационных данных есть несколько способов :

- Через class File

```
 //Инициализируем ядро
 $kernel = new KernelBpm();
 $file = new File();

 // указываем путь до файла с  конфигурациями
 $file->setSource(__DIR__ . '/config/apiBpm.php');
 // Загружаем их
 $kernel->loadConfiguration($file);

```

Файл должен возвращать массив с конфигурационными данными

```
return [
	// url для аутентификации
    'UrlLogin' => '',
    //ваш url для запросов по api
    'UrlHome'  => '',
    'Login'    => '',
    'Password' => ''
    ]

```

- Через метод setConfigManually в KernelBpm

```
$kernel = new KernelBpm();
// первым параметром передается префикс для конфигурации
$$kernel->setConfigManually('apiBpm', [
        'UrlLogin' => '',
        'Login'    => '',
        'Password' => '',
        'UrlHome'  => ''
]);

```

Аутенфикация
------------

[](#аутенфикация)

Для аутенфикация в BPM API необходимо получить cookie по URL `https://ikratkoe.bpmonline.com/ServiceModel/AuthService.svc/Login`Для этого необходимо вызвать метод `authentication`

```
$kernel->authentication();

```

Можно не вызывать его и пакет автоматически обновит куки сделав дополнительный запрос.

Установка коллекции
-------------------

[](#установка-коллекции)

В BPM все таблицы из базы данных именуются как коллекции ( Collections ) Для взаимодействия необходимо установить коллекцию.

```
$kernel->setCollection('CaseCollection');

```

Данный подход имеет минус в дополнительном вызове метода `setCollection` , но позволяет переиспользывать установку коллекции. Имеется в виду что мы можем один раз установить коллекцию и производить операции по ней.

Select
------

[](#select)

Все методы принимают первым параметром строку типа операции и тип данных, вторым параметром callback внутрь которого передается тип операции, внутри callback происходит выполнение всех пред - настроек в конце вызывается метод get. Возращается обьект типа Handler который обрабатывает ответ от BPM.

```
$handler = $kernel->action('read:json', function ($read){
    $read->amount(1)->skip(100);

})->get();

```

Всего два типа данных `xml` и `json`. Четыре вида операции `read`, `create`, `update`, `delete`.

**Методы Select**

**filterConstructor**Позволяет фильтровать выборку с помощью функции $filter в запросе

```
filterConstructor('Id eq guid\'00000000-0000-0000-0000-000000000000\'');

```

**orderBy**Получать данные в отсортированном виде Первым параметром название поля, вторым параметром тип сортировки : по возрастанию (asc) по убыванию (desc)

```
->orderby('Number', 'desc')

```

**skip**Если необходимо пропустить заданное кол - во записей

```
->skip(10)

```

**amount**Задать максимальное кол - во записей

```
->amount(100)

```

`Имейте в виду что вы можете комбинировать методы согласно документации Bpm’online`

Create
------

[](#create)

Синтаксис для создания записи такой же как и Select. Внутри callback необходимо вызвать метод setData и передать ему массив параметров для создания записи в таблице BPM.

```
$handler = $kernel->action('create:xml', function ($creator){
    $creator->setData([
        // array key => value
    ]);
})->get();

```

Update
------

[](#update)

Для обновления данных в записи в BPM необходимо знать guid записи. Здесь устанавливается guid и новые параметры для обновления.

```
$handler = $kernel->action('update:json', function ($creator){
    $creator->guid('')->setData([
       'Number' => ''
    ]);
})->get();

```

Delete
------

[](#delete)

Для удаление записи из бд достаточно знать guid

```
$handler = $kernel->action('delete:xml', function ($creator){
    $creator->guid('');
})->get();

```

Обработчики ответов
-------------------

[](#обработчики--ответов)

Вне зависимости от операции всегда возращается тип Handler, который иммеет несколько методов для преобразования данных.

**toArray**Преобразовывает данные в массив

**toJson**Преобразовывает данные в json

**getData**Получить данные как есть

Логирование
-----------

[](#логирование)

На данный момент пакет сохраняет внутри себя детализацию всех запросов с сортировкой по дате. Их можно найти в `src/resource/logs/...`

Интеграция с Laravel
--------------------

[](#интеграция-с-laravel)

Для интеграции с фреймворком Laravel необходимо скопировать конфигурации и заполнить их

```
 php artisan vendor:publish --tag=bpm --force

```

Вставить сервис провайдер в файл `config/app.php`

```
 \agoalofalife\bpm\ServiceProviders\BpmBaseServiceProvider::class

```

Далее можно пользоваться извлекая обьект из контейнера

```
$bpm =  app('bpm');
$bpm->setCollection('CaseCollection');

 $handler = $bpm->action('read:xml', function ($read){
    $read->amount(1);
})->get();

```

Либо используя фасад , предварительно зарегистрировав его в файле `config/app.php`:

```
   'aliases' => [
 Illuminate\Support\Facades\Facade\Bpm
  ...
  ]

```

Клиентский код

```

    Bpm::setCollection('CaseCollection');
     $handler = Bpm::action('read:xml', function ($read){
        $read->amount(1);
    })->get();

```

Инструмент
----------

[](#инструмент)

Вам необходимо запустить сервер выполнив команду

```
vendor/bin/panel-server

```

Когда перейдете по адресу то увидите перед собой , статистику продолжительности ваших запросов в Bpm. Это программа парсит ваш лог файл который находиться по адресу src/resource/logs

[![alt text](https://camo.githubusercontent.com/f12de2ff39e3fc5565d861073687a573d2e1b117eb5b8d98b7d147e1f80adc1b/687474703a2f2f672e7265636f726469742e636f2f6e3573465178446e49722e676966)](https://camo.githubusercontent.com/f12de2ff39e3fc5565d861073687a573d2e1b117eb5b8d98b7d147e1f80adc1b/687474703a2f2f672e7265636f726469742e636f2f6e3573465178446e49722e676966)

**What is it ?**

The package provides a convenient interface to work with [API Bpm’online](https://academy.terrasoft.ru/documents/technic-sdk/7-8/rabota-s-obektami-bpmonline-po-protokolu-odata-s-ispolzovaniem-http-zaprosov) through the Protocol

- [Install](#Installation_en)
- [Configurations](#Config_en)
- [Authentication](#Authentication_en)
- [Set Collection](#SetCollection_en)
- [Base Request](#BasesRequest_en)
    - [Select](#Select_en)
    - [Create](#Create_en)
    - [Update](#Update_en)
    - [Delete](#Delete_en)
- [Handler Response](#Handler_en)
- [Log](#Log_en)
- [Integration with Laravel](#Laravel_en)
- [Tool](#Tool_en)

Install
-------

[](#install)

For installation, you must run the command from composer

```
composer require agoalofalife/bpm-online

```

Configurations
--------------

[](#configurations)

To install your configuration data there are several ways :

- class File

```
 //Init  kernel
 $kernel = new KernelBpm();
 $file = new File();

 // specify the path to the file with the configurations
 $file->setSource(__DIR__ . '/config/apiBpm.php');
 // loading...
 $kernel->loadConfiguration($file);

```

The file must return an array with the data

```
return [
	// url for auth
    'UrlLogin' => '',
    //our url for request api
    'UrlHome'  => '',
    'Login'    => '',
    'Password' => ''
    ]

```

- through method setConfigManually in KernelBpm

```
$kernel = new KernelBpm();
// the first parameter is passed a prefix for configuration
$kernel->setConfigManually('apiBpm', [
        'UrlLogin' => '',
        'Login'    => '',
        'Password' => '',
        'UrlHome'  => ''
]);

```

Authentication
--------------

[](#authentication)

For authentication in BPM API , it is necessary to get cookie in URL

`https://ikratkoe.bpmonline.com/ServiceModel/AuthService.svc/Login`It is necessary to call the method `authentication`

```
$kernel->authentication();

```

You can not call it and the package will automatically update the cookies by making an additional query.

Set Collection
--------------

[](#set-collection)

In **BPM** all tables of the database are referred to as collections ( Collections ) To communicate, you must install the collection.

```
$kernel->setCollection('CaseCollection');

```

This approach has an additional disadvantage in the method call `setCollection`, but reuse installation of the collection. Meaning that we can install a collection and perform operations on it.

Select
------

[](#select-1)

All methods take the first parameter of the string type and the data type, the second parameter `callback` inside of which is passed the type of operation, inside `callback` executed all pre - settings at the end method is called `get`.

Returns the object type Handler which handler response from BPM.

```
$handler = $kernel->action('read:json', function ($read){
    $read->amount(1)->skip(100);

})->get();

```

Only two types of data `xml` and `json`. Four types of operations `read`, `create`, `update`, `delete`.

**Methods Select**

**filterConstructor**

Allows you to filter the selection using the function $filter in request

```
filterConstructor('Id eq guid\'00000000-0000-0000-0000-000000000000\'');

```

**orderBy**To retrieve data in sorted form The first parameter the field name, the second argument to sort : ascending (asc) descending (desc)

```
->orderby('Number', 'desc')

```

**skip**

If you want to skip the specified number of records

```
->skip(10)

```

**amount**To set the maximum number of records

```
->amount(100)

```

`Keep in mind that you can combine the methods according to the documentation Bpm’online`

Create
------

[](#create-1)

The syntax for creating a record is the same as Select. Inside `callback` you must call setData and pass his array parameters for creating record in table BPM.

```
$handler = $kernel->action('create:xml', function ($creator){
    $creator->setData([
        // array key => value
    ]);
})->get();

```

Update
------

[](#update-1)

To update the data in the record BPM you need to know guid record. This set guid and new parameters for updates.

```
$handler = $kernel->action('update:json', function ($creator){
    $creator->guid('')->setData([
       'Number' => ''
    ]);
})->get();

```

Delete
------

[](#delete-1)

For deleting a record from DB enough to know guid and only guid

```
$handler = $kernel->action('delete:xml', function ($creator){
    $creator->guid('');
})->get();

```

Handler Response
----------------

[](#handler-response)

Regardless of the operation always returns a typeп Handler, which has several methods to convert the data.

**toArray**Converts the data into an array

**toJson**Converts the data to json

**getData**Just Return the data

Log
---

[](#log)

At the moment, the package keeps a detail of all queries sorted by date. You can find them in `src/resource/logs/...`

Integration with Laravel
------------------------

[](#integration-with-laravel)

For integration with the framework Laravel you must copy the configuration and fill them

```
 php artisan vendor:publish --tag=bpm --force

```

Insert the service provider to a file `config/app.php`

```
 \agoalofalife\bpm\ServiceProviders\BpmBaseServiceProvider::class,

```

Then you can use extract the object from the container.

```
    $bpm =  app('bpm');
    $bpm->setCollection('CaseCollection');

     $handler = $bpm->action('read:xml', function ($read){
        $read->amount(1);
    })->get();

```

Or by using the Facade , registering it in a file`config/app.php`:

```
   'aliases' => [
 Illuminate\Support\Facades\Facade\Bpm
  ...
  ]

```

Client code

```
    Bpm::setCollection('CaseCollection');
     $handler = Bpm::action('read:xml', function ($read){
        $read->amount(1);
    })->get();

```

Tool
----

[](#tool)

You need to start the server by running the command :

```
vendor/bin/panel-server

```

When you click on the address you will see a statistics of the duration of your queries in Bpm. This program parses your log file which is located at the address src/resource/logs

[![alt text](https://camo.githubusercontent.com/f12de2ff39e3fc5565d861073687a573d2e1b117eb5b8d98b7d147e1f80adc1b/687474703a2f2f672e7265636f726469742e636f2f6e3573465178446e49722e676966)](https://camo.githubusercontent.com/f12de2ff39e3fc5565d861073687a573d2e1b117eb5b8d98b7d147e1f80adc1b/687474703a2f2f672e7265636f726469742e636f2f6e3573465178446e49722e676966)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 96% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~86 days

Recently: every ~98 days

Total

8

Last Release

2920d ago

Major Versions

1.0.0 → 2.0.x-dev2017-04-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/de0b1f6d64571d925fd7580acf7f99394511ad98c4befd6d2d9e1ef64ea1ea8e?d=identicon)[agoalofalife](/maintainers/agoalofalife)

---

Top Contributors

[![agoalofalife](https://avatars.githubusercontent.com/u/15719824?v=4)](https://github.com/agoalofalife "agoalofalife (121 commits)")[![bunke](https://avatars.githubusercontent.com/u/4853099?v=4)](https://github.com/bunke "bunke (5 commits)")

---

Tags

bpmbpm-apibpm-onlinelaravelbpmbpm-online

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/agoalofalife-bpm-online/health.svg)

```
[![Health](https://phpackages.com/badges/agoalofalife-bpm-online/health.svg)](https://phpackages.com/packages/agoalofalife-bpm-online)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9762.4M131](/packages/roots-acorn)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
