About

Messages are needed to store and organize process-related information exchange between among executors and customers: notes, calls, emails.. So that all the history of communications around a process is always available there.

Setup

Following settings should be done in the configuration, preferably as an include.

Types

Any message has a type that should be added with the records:

messageType.<ID>.title=<TITLE>
messageType.<ID>.class=<CLASS>

Где:

  • <ID> - unique numeric positive ID, must not change after; there are some recommended values provided for each class;

  • <TITLE> - type’s title;

  • <CLASS> - the class of the message type.

The following <CLASS> values are supported in the app’s kernel.

MessageTypeNote

Used for appending process notes. Recommended <ID> is 100

message notes

Optional config:

# create notes in unread state
#messageType.<ID>.create.unread=1
# do not check empty subject on saving
#messageType.<ID>.check.empty.subject=0

Example:

messageType.100.title=Note
messageType.100.class=MessageTypeNote

MessageTypeCall

The only single possible message type with the <CLASS> recommended to have <ID> is 50 Notifications about calls itself should be provided by Asterisk plugin or external HTTP requests.

Optional config:

messageType.<ID>.offerNumberFromParamId=<OFFER_NUMBER_FROM_PARAM_ID>
# disable automatic registering number from <OFFER_NUMBER_FROM_PARAM_ID> parameter on user login
#messageType.<ID>.autoNumberRegister=0

Where:

  • <OFFER_NUMBER_FROM_PARAM_ID> - ID of user text parameter, containing his number.

That number has been occupied by a user during message processing.

messages occupy number

<CLASS> values from plugins

<CLASS> Plugin Recommended <ID> values

MessageTypeEmail

1-49

MessageTypeHelpDesk

200-249

For a message type can be defined different search modes (1) and contact savers (2)

message process

Для типа сообщения могут быть указаны один или несколько режимов поиска:

messageType.<ID>.search.{@inc:cnt}.title=<TITLE>
messageType.<ID>.search.{@cnt}.class=<searchModeClassName>

Где:

  • <TITLE> - наименование режима поиска;

  • <searchModeClassName> - имя класса, реализующего режим поиска.

Search modes, marked as Auto are automatically and parallel running when a message is opened.

Значение <searchModeClassName>, что ищет Конфигурация и пример

MessageTypeSearchCustomerByTitle
Контрагента по наименованию, для любого типа сообщения.

i0111

Нет дополнительных параметров.
Пример:

messageType.1.search.{@inc:cnt}.title=Customer by Title
messageType.1.search.{@cnt}.class=MessageTypeSearchCustomerByTitle

MessageTypeSearchCall
Auto
Поиск контрагента в базе BGERP по номеру телефона звонящего для типа сообщения Call. Поиск производится по точному совпадению.

messageType.<ID>.search.{@inc:cnt}.title=<TITLE>
messageType.<ID>.search.{@cnt}.class=MessageTypeSearchCall
messageType.<ID>.search.{@cnt}.commands=<commands>
# необязательный параметр
messageType.<ID>.search.{@cnt}.expressionNumberPreprocess=<jexl>

Где:

  • <commands> - команды разделённые точкой с запятой, в данный момент поддержана customerByPhoneParam:<paramIds>, где <paramIds> - коды параметров типа "телефон" в биллинге через запятую;

  • <jexl> - JEXL выражение для предобработки номера перед поиском с его использованием, исходный номер передаётся переменной numberFrom.

Пример:

messageType.1.search.{@inc:cnt}.title=Customer by Phone
messageType.1.search.{@cnt}.class=MessageTypeSearchCall
messageType.1.search.{@cnt}.commands=customerByPhoneParam:10
messageType.1.search.{@cnt}.expressionNumberPreprocess=if (numberFrom.length() == 11) { numberFrom = numberFrom.substring(1) }; return numberFrom;

MessageTypeSearchEmail
Auto
Поиск контрагента по Email для типа сообщения Email.

Нет дополнительных параметров.
Пример:

messageType.1.search.{@inc:cnt}.title=Customer by EMail
messageType.1.search.{@cnt}.class=MessageTypeSearchEmail

BGBillingMessageTypeSearchEmail
Auto
Поиск договора в базе BGBilling по EMail парамеру для типа сообщения EMail.

messageType.<id>.search.{@inc:cnt}.title=<title>
messageType.<id>.search.{@cnt}.class=BGBillingMessageTypeSearchEmail
messageType.<id>.search.{@cnt}.billingId=<billingId>
messageType.<id>.search.{@cnt}.paramIds=<paramIds>

Где:

  • <billingId> - идентификатор биллинга;

  • <paramIds> - коды параметров договора т ипа EMail через запятую.

Пример:

messageType.1.search.3.title=Договор по параметру EMail
messageType.1.search.3.class=BGBillingMessageTypeSearchEmail
messageType.1.search.3.billingId=bitel
messageType.1.search.3.paramIds=7

BGBillingMessageTypeSearchCall
Auto
Поиск договора в базе BGBilling по номеру телефона звонящего для типа сообщения Call. Поиск производится по подстроке.

messageType.<id>.search.{@inc:cnt}.title=<title>
messageType.<id>.search.{@cnt}.class=BGBillingMessageTypeSearchCall
messageType.<id>.search.{@cnt}.billingId=<billingId>
messageType.<id>.search.{@cnt}.commands=<commands>
# необязательный параметр
messageType.<id>.search.{@cnt}.expressionNumberPreprocess=<jexl>

Где:

  • <billingId> - идентификатор биллинга;

  • <commands> - команды, в данный момент поддержана contractByPhoneParam:<paramId>, где <paramId> - идентификатор параметра типа "телефон" в биллинге;

  • <jexl> - JEXL выражение для предобработки номера перед поиском с его использованием, исходный номер передаётся переменной numberFrom.

Пример:

messageType.1.search.1.title=Договор по номеру
messageType.1.search.1.class=BGBillingMessageTypeSearchCall
messageType.1.search.1.billingId=bg
messageType.1.search.1.commands=contractByPhoneParam:27
messageType.1.search.1.expressionNumberPreprocess=if (numberFrom.length() == 11) { numberFrom = numberFrom.substring(1) }; return numberFrom;

BGBillingMessageTypeSearchContractByTitleAndComment
Поиск договора в базе BGBilling по номеру и комментарию, для любого типа сообщения.

messageType.<id>.search.{@inc:cnt}.title=<title>
messageType.<id>.search.{@cnt}.class=BGBillingMessageTypeSearchContractByTitleAndComment
messageType.<id>.search.{@cnt}.billingId=<billingId>

Где:

  • <billingId> - идентификатор биллинга.

Пример:

messageType.1.search.2.title=По номеру/примечанию
messageType.1.search.2.class=BGBillingMessageTypeSearchContractByTitleAndComment
messageType.1.search.2.billingId=bg

Contact Savers

Contact Saver has defined in a message type configuration:

messageType.<ID>.saver.class=<saverClassName>
Значение <saverClassName>, что делает Конфигурация и пример

MessageTypeContactSaverPhone
Save the calling phone number to parameter with type phone of process or a linked customer

messageType.<ID>.saver.class=MessageTypeContactSaverPhone
messageType.<ID>.saver.paramId=<paramId>

Where:

  • <paramId> - the parameter ID

Example:

messageType.1.saver.class=MessageTypeContactSaverPhone
messageType.1.saver.paramId=37

MessageTypeContactSaverEmail
Сохранение EMail в параметр типа "email" контрагента. Возможно сохранение домена либо только EMail а.

messageType.<id>.saver.class=MessageTypeContactSaverEmail
messageType.<id>.saver.paramId=<paramId>

Где:

  • <paramId> - код параметра контрагента типа "EMail".

Пример:

messageType.{@inc:cnt}.saver.class=MessageTypeContactSaverEmail
messageType.{@cnt}.saver.paramId=27

BGBillingMessageTypeContactSaverPhone
Сохранение телефона в параметр типа "телефон" договора биллинга.

messageType.<id>.saver.class=BGBillingMessageTypeContactSaverPhone
messageType.<id>.saver.paramId=<paramId>
messageType.<id>.saver.format=<format>

Где:

Пример:

messageType.{@inc:cnt}.saver.class=BGBillingMessageTypeContactSaverPhone
messageType.{@cnt}.saver.paramId=27

Tags

Colored message tags allow to separate messages in process tab. Example of configuration:

tag.1.title=Access
tag.1.color=red
tag.2.title=Requirements
tag.2.color=green
tag.3.title=TODO
tag.3.color=magenta

Templates

Message Templates allow to create pre-defined subject and text content, to begin typical messages.

To add a template, add the following configuration block.

message.template.{@inc:cnt}.title=<TITLE>
message.template.{@cnt}.subject=<subject>
message.template.{@cnt}.text=<text>

All the values are self-explainable, here is the sample of configured template.

// PzdcDoc snippet of: 'MessageTest.config.txt', lines: 33 - 39

message.template.{@inc:cnt}.title=Greetings from BGERP
message.template.{@cnt}.subject=Hello from BGERP
message.template.{@cnt}.text=<<END
Dear Friend,

the Team BGERP wishes you all the best!
END

And how does it look like.

message template

Possible Processes

You can see (message Kernel Message Possible Process Unprocessed message) the feature operation in Demo System. The configuration for that has the name Kernel Message Possible Process.

To configure Possible Processes to be found during message processing add to configuration following blocks:

message.possible.process.<ID>.class=<CLASS>
message.possible.process.<ID>.color=<color>

Where:

  • <ID> - unique block’s numeric ID, found processes are sorted by the IDs

  • <color> - optional HTML color for table rows with found processes

  • <CLASS> - search type, one of the following values:

    • MessagePossibleProcessSearchMessageFrom - processes with messages from the same from address (Email sender or calling number) as the processed message.

    • MessagePossibleProcessSearchFoundLinks - processes with the same links as found for the processed message.

    • MessagePossibleProcessSearchFoundLinksCustomerAddressCity - processes with a list parameter values, matching to city IDs of address parameter of found customers. That type requires additional properties set:

      • processCityParamId, ID of the list parameter.

    • BGBillingMessagePossibleProcessSearchFoundLinksContractAddressCity - processes with a list parameter values, matching to city IDs of address parameter of found contracts in BGBilling system. That type requires additional properties set:

      • processCityParamId, ID of the list parameter;

      • contractAddressParamId.<billingId>, ID of address parameter in BGBilling system with ID <billingId>.

If no block is defined then a single ones with class MessagePossibleProcessSearchMessageFrom is added.

Scheduler

Получение новых сообщений и отправку созданных осуществляет класс Kernel Message Exchange, настройте его запуск в планировщике.

Дополнительные опциональные ключи конфигурации задачи:

  • messageTypeIds - коды типов сообщений через запятую, для которых производить обмен.

Usage

Оснастка "Сообщения"

Основное назначение - первичная обработка сообщений с привязкой к вновь созданным, либо существующим процессам. В обработке нуждаются не все сообщения, в данный момент она используется для Email ов и звонков. Обработка звонка открывается автоматически, Email ы необходимо открывать в оснастке вручную.

Уведомление о количестве необработанных сообщений выводится в области уведомлений.

Сообщение считается обработанным после того, как к нему привязан процесс. Помимо этого сообщение можно удалить. В выпадающем списке можно выбрать фильтр по типу сообщений. В квадратных скобках рядом с типом отображается число необработанных сообщений каждого типа.

messages

При клике по строке открывается обработка сообщения, внешний вид может быть следующим для звонка (снимок уже использовался выше).

message process

Либо для Email.

message process email

In the left bottom area during message processing are shown possible processes, that can be assinged for the message using set links.

message process possible process

Процесс

Отображение вкладки сообщений должно быть настроено в конфигурации типа процесса.

process messages

Для создания сообщения в рамках процесса используйте кнопку Создать.

Доступен фильтр по сообщениям со вложениями и тегам. Теги позволяют маркировать каждое сообщение определёнными метками, позволяющими их позже легко найти, например: "TODO", "Реквизиты".

Кнопка M рядом с каждым сообщением вызывает всплывающее меню с операциями:

  • Вкл./выкл. разрывы строк - перенос длинных строк в сообщениях либо отображение скроллинга;

  • Теги - установить теги на выбранное сообщение.

  • Изменить процесс на - привязать сообщение к другому процессу:

  • Ответить - создать новое сообщение, являющееся ответом на выбранное и также привязанное к текущему процессу;

  • Редактировать - редактировать сообщение, если тип поддерживает;

  • Удалить - удалить сообщение, если тип поддерживает.

Пометку процессов с новыми сообщениями можно реализовать переключением статуса процесса по событию поступления сообщения.