...
Code Block |
---|
configuration: { url: "http://localhost:3002/" (hbw_url), login: user@example.com (hbw_login), password: renewmeplease (hbw_token) } |
- метод, в котором ко всем параметрам запросов будут будет добавляться идентификатор пользователя, который взаимодействует с HOMS
Code Block |
---|
def with_user_identifier(parameters)
parameters.merge(
'user_identifier' => Lib::GetSession.(params[:payload][:token])[:session][:email]
)
end
def allow_params(*allowed_params)
with_user_identifier(params.slice(*allowed_params))
end |
...
- методы для работы с формами заказа
- получение всех заказов –
GET
запрос c параметрамиentity_class
,entity_code
:
...
Code Block | ||
---|---|---|
| ||
get_request_bpm_backend('users/check') |
Встраивание JS
Включить Необходимо включить в HTML страницы внешней системы JS и CSS виджета:
Code Block | ||
---|---|---|
| ||
<script type="text/javascript" src="<%= '\<\%\= hbw_assets_path \%\>' %>assets/hbw.js"></script> <link relreluser_identifier="stylesheet" type="text/css" href="<%= '\<\%\= hbw_assets_path \%\>' %>assets/hbw.css"> |
Добавить на страницу <div> с уникальным ID, например, bpmWidgetContainer
, чтобы в нём отрендерился виджет.
Вызвать функцию
render
у объекта виджета:Code Block | ||||
---|---|---|---|---|
| ||||
this.widget = new (modulejs.require('HBW'))({ widgetContainer: `#${this.widgetContainerId}`, widgetPath: '/widget', entity_class: 'your_entity_class', entity_type: 'operator', entity_code: `${id}`, locale: i18n.language, payload: { token: cookies.get('token'), variables: { id: { value: `${id}`, type: 'string', }, }, }, }); this.widget.render(); |