N
N
Nikita Maksimov2020-02-28 07:59:59
Notifications
Nikita Maksimov, 2020-02-28 07:59:59

Why don't notifications come to users when delegating a business process task to 1s-Bitrix Corporate Portal?

Good afternoon everyone!

There is a 1C-Bitrix Corporate Portal (box). Works well, push notifications for tasks, reminders, etc. come.

Faced a problem in the absence of user notification if a task is delegated to him in a business process. In this case, the task itself appears and he can complete it.
In the b_event table, there are no records for notifications related to the business process as such.
In the documentation for the modules and specifically for the business process module, this moment is somehow completely missed from the word.

Maybe someone had similar precedents and you found a solution?
I have a suspicion that I missed reading somewhere.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita Maksimov, 2020-06-04
@mknk

As a result, I implemented it through business process events.
If anyone needs it, then the code below is working.

<?php

use Bitrix\Main\Loader;

class BizprocEvents
{
    public static function OnTaskDelegate($taskId, $fromUserId, $toUserId)
    {
        $arTask = self::getTask($taskId);
        self::addNotify($toUserId, $arTask["NAME"], $arTask["DESCRIPTION"]);
        return true;
    }

    private static function getTask($taskId)
    {
        global $DB;
        $taskId = intval($taskId);
        $strSql = "SELECT DESCRIPTION, NAME, DOCUMENT_NAME FROM b_bp_task WHERE ID = '" . $taskId . "'";
        $result = $DB->Query($strSql);
        return $result->Fetch();
    }

    private static function addNotify($toUserId, $name, $text)
    {
        Loader::includeModule("im");

        $arMessageFields = array(
            "TO_USER_ID" => $toUserId,
            "FROM_USER_ID" => 0,
            "NOTIFY_TYPE" => IM_NOTIFY_SYSTEM,
            "NOTIFY_MODULE" => "bizproc",
            "NOTIFY_MESSAGE" => $name . "[BR]" . $text . "[BR][url=тут урл]Перейти к бизнес-процессам[/url]",
            "NOTIFY_MESSAGE_OUT" => $name . "[BR]" . $text . "[BR][url=тут урл]Перейти к бизнес-процессам[/url]"
        );
        CIMNotify::Add($arMessageFields);
    }
}

A
Aliy Kunashev, 2020-02-28
@askunash

I'm afraid this notification is not embedded in the activity. No stand on hand to test, but pretty sure.
If so, then you lay another mechanism in the template itself - a prohibition to delegate, instead, a request for additional information with a choice of whom to transfer. Status, preferably.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question