Инструменты пользователя

Инструменты сайта


sharixopen:knowledge:scenarios:access_request_pending

Это старая версия документа!


ACCESS_REQUEST в PENDING: рассмотрение запроса на право

Область: ShariX Open. Обработчик: open_access_request_pending, тип ACCESS_REQUEST (3), рабочий статус PENDING (320). Опубликованный встроенный Python на 28.10.2026 побайтово совпадает с канонической генерацией из Blockly workspace. Состояние выбранной версии конкретного сервера проверяется отдельно.

Назначение и границы

Обработчик сопровождает запрос на предоставление права до решения. Он не создаёт Permissions, не проверяет все требования и не активирует право. При автоматическом режиме запрашивается стадия ACCEPTED и Ticket передаётся следующему handler; активация остаётся отдельной операцией с доменными проверками.

Первый фильтр после рабочего статуса — assigned_to is not None. Если Ticket уже назначен, текущий проход запрашивает его удаление из локальной очереди и удаление комнаты. Это не положительное решение и не передача в ACCEPTED: статус не меняется. Scoped список PENDING фильтруется по типу и статусу, поэтому при сохранении PENDING такая карточка может снова попасть из periodic reconciliation и вновь быть исключена. Назначение пользователя и решение по заявке следует различать.

Следующая развилка использует ACCREQ_AUTOACCEPT, а не настройку ST_REQUEST. Значение берётся при создании HandlerContext. Изменение окружения не следует считать уже применённым к работающему процессу без проверки его конфигурации/перезапуска.

Один проход и ожидание (BPMN)

Схема BPMN

Загрузка схемы…

Исходник схемы
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_access_pending_logic" targetNamespace="urn:sharix:knowledge:handlers">
  <bpmn:process id="access_Process_access" name="open_access_request_pending: решение о запросе, не активация права" isExecutable="false">
    <bpmn:documentation>{"notes": ["Git built-in и внешние контракты, без выполнения обработчика.", "BPMN isExecutable=false. End event — конец показанного прохода, не предоставление права.", "deferred_until — символ локального срока, не настройка сервера."], "sources": [{"commit": "76e0c693b628ed4a1fa34515a3f8abdff26149bb", "path": "handlers/open_access_request_pending.py", "repository": "sharix-open-handlers-examples", "sha256": "ca7c362ab1bddd1712bc569100d827297402ffde74badaab5e4f8847c09800a6"}, {"commit": "76e0c693b628ed4a1fa34515a3f8abdff26149bb", "path": "generated_handler_blocks/open_access_request_pending.json", "repository": "sharix-open-handlers-examples", "sha256": "06b959d4511d9b64e0b6a2a1d1c0ba118199d913c15f6206d086edaf6072099d"}, {"commit": "76e0c693b628ed4a1fa34515a3f8abdff26149bb", "path": "catalog.py", "repository": "sharix-open-handlers-examples", "sha256": "e3dcb72b7e620e2837adacd7af053f35b04cdff475789496d9c114e17d57dfde"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/blockly_runtime.py", "repository": "sharix-open-handlers-backend", "sha256": "3e222150cbff315077c6c9b160d46e59856cedf6d6591d213e958c63cb2f2428"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/handler_operations.py", "repository": "sharix-open-handlers-backend", "sha256": "28620658501c375f556e24437871620b84a17a88d0b62b2d1a3cc5deb2f14b1e"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/data_parsers.py", "repository": "sharix-open-handlers-backend", "sha256": "d7f26f172f68e4b390f675de88fbfb3c37a58fb29d4bf3d6687b31bd7953f9e4"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/ejabberd_muc.py", "repository": "sharix-open-handlers-backend", "sha256": "35c2eba89fab36b5c444439a87beaa516b55133991136d5370418d92a18d7bcd"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/requesters.py", "repository": "sharix-open-handlers-backend", "sha256": "965a348cea477722bbaf4c8c6b06023eb238b71664a332f7ea8c90bfe72ea808"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "classes/AccessRequestTicket.py", "repository": "sharix-open-handlers-backend", "sha256": "3f3a498ae76b3d878b19a8f32170fc2a71c6c6c182bf34a6ecc50edf7b0f5eff"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "ticket_blockly_codegen.py", "repository": "sharix-open-handlers-backend", "sha256": "bce71eab622922f8dd0954222842349799b60e18a0ab6310cc3e5f305603661e"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "ticket_codegen_contract.json", "repository": "sharix-open-handlers-backend", "sha256": "0bfd2b0ebb07bd380ed3c867386536ab88ef7dfa6e13f1cd8c91d32bb02c1ae9"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "lib/tickets.py", "repository": "sharix-open-tickets", "sha256": "0d260c17947f9a186d07af2749159780e3c7354a95b4bafe9d67493663c96883"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "api/views/handler_workflow.py", "repository": "sharix-open-tickets", "sha256": "f97c4b467a9a30749f5c4b86b39a833c430e57aaa1f030f70030d9b5c609d368"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "api/handler_auth.py", "repository": "sharix-open-tickets", "sha256": "ac76dc45aaa9742e5e1da0b98aae914bb2e287048d33e97b4a245a6997bc8425"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "utils.py", "repository": "sharix-open-tickets", "sha256": "a5680205c6522e1d9a74d9d267fe9ee96faf6f06436b00877fc0a93d80234bf5"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "views/ticket_detail.py", "repository": "sharix-open-tickets", "sha256": "05d344b0fba14cf895400694d4a18f486c800fef08dd1acb43ea46909b9e7e59"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "signals.py", "repository": "sharix-open-tickets", "sha256": "39aad8690a2e7d35cebfb052127a8130a951cbb4eea316c4f767a0a59fc5fa7e"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "services/handler_wakeup.py", "repository": "sharix-open-tickets", "sha256": "c9fdc62a18301fd7c075395c697d5b1c738c77713aa71fcbb5ab097e173d98de"}]}</bpmn:documentation>
    <bpmn:laneSet id="access_Lanes_access">
      <bpmn:lane id="access_Lane_worker" name="Worker: один проход Python">
        <bpmn:flowNodeRef>access_start</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_status</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_assigned</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_auto</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_notify</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_defer</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_cleanup</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_end</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_transition</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_confirmed</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_handoff</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_remove</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_accepted</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_missing</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_notify_error</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_api_error</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_send_error</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_retry</bpmn:flowNodeRef>
      </bpmn:lane>
      <bpmn:lane id="access_Lane_queue" name="Планировщик: ожидание без занятого worker">
        <bpmn:flowNodeRef>access_wait</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_timer</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_revision</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>access_ready</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>
    <bpmn:startEvent id="access_start" name="Ticket готов к проходу">
      <bpmn:outgoing>access_Flow_0</bpmn:outgoing>
    </bpmn:startEvent>
    <bpmn:exclusiveGateway id="access_status" name="Статус PENDING?">
      <bpmn:incoming>access_Flow_0</bpmn:incoming>
      <bpmn:incoming>access_Flow_23</bpmn:incoming>
      <bpmn:outgoing>access_Flow_1</bpmn:outgoing>
      <bpmn:outgoing>access_Flow_2</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:exclusiveGateway id="access_assigned" name="assigned_to не None?">
      <bpmn:incoming>access_Flow_1</bpmn:incoming>
      <bpmn:outgoing>access_Flow_3</bpmn:outgoing>
      <bpmn:outgoing>access_Flow_4</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:exclusiveGateway id="access_auto" name="ACCREQ_AUTOACCEPT?">
      <bpmn:incoming>access_Flow_3</bpmn:incoming>
      <bpmn:outgoing>access_Flow_6</bpmn:outgoing>
      <bpmn:outgoing>access_Flow_9</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:sendTask id="access_notify" name="Сообщить в MUC-комнату заявки">
      <bpmn:documentation>METASERVICE-ADMIN, JID текущего bot и report JID; не автоматическая выдача роли.</bpmn:documentation>
      <bpmn:incoming>access_Flow_6</bpmn:incoming>
      <bpmn:outgoing>access_Flow_7</bpmn:outgoing>
    </bpmn:sendTask>
    <bpmn:serviceTask id="access_defer" name="manual_access_decision; defer">
      <bpmn:documentation>ACCESS_REQUEST_PENDING_RECHECK_SECONDS</bpmn:documentation>
      <bpmn:incoming>access_Flow_7</bpmn:incoming>
      <bpmn:outgoing>access_Flow_8</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:serviceTask id="access_cleanup" name="Убрать локальный Ticket и комнату">
      <bpmn:incoming>access_Flow_2</bpmn:incoming>
      <bpmn:incoming>access_Flow_4</bpmn:incoming>
      <bpmn:outgoing>access_Flow_5</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:endEvent id="access_end" name="Текущий проход прекращён">
      <bpmn:incoming>access_Flow_5</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:serviceTask id="access_transition" name="Scoped API: ACCEPTED">
      <bpmn:incoming>access_Flow_9</bpmn:incoming>
      <bpmn:outgoing>access_Flow_10</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:exclusiveGateway id="access_confirmed" name="Переход подтверждён?">
      <bpmn:incoming>access_Flow_10</bpmn:incoming>
      <bpmn:outgoing>access_Flow_11</bpmn:outgoing>
      <bpmn:outgoing>access_Flow_12</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:sendTask id="access_handoff" name="Передать в open_access_request_accepted">
      <bpmn:incoming>access_Flow_12</bpmn:incoming>
      <bpmn:outgoing>access_Flow_13</bpmn:outgoing>
    </bpmn:sendTask>
    <bpmn:serviceTask id="access_remove" name="Убрать Ticket; комнату сохранить">
      <bpmn:incoming>access_Flow_13</bpmn:incoming>
      <bpmn:outgoing>access_Flow_14</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:endEvent id="access_accepted" name="Передача завершена, право ещё проверяется">
      <bpmn:incoming>access_Flow_14</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:endEvent id="access_missing" name="404: локальная очистка запрошена">
      <bpmn:incoming>access_Flow_11</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:boundaryEvent id="access_notify_error" name="Ошибка уведомления" attachedToRef="access_notify" cancelActivity="true">
      <bpmn:outgoing>access_Flow_15</bpmn:outgoing>
      <bpmn:errorEventDefinition />
    </bpmn:boundaryEvent>
    <bpmn:boundaryEvent id="access_api_error" name="Ошибка API" attachedToRef="access_transition" cancelActivity="true">
      <bpmn:outgoing>access_Flow_16</bpmn:outgoing>
      <bpmn:errorEventDefinition />
    </bpmn:boundaryEvent>
    <bpmn:boundaryEvent id="access_send_error" name="Ошибка отправки" attachedToRef="access_handoff" cancelActivity="true">
      <bpmn:outgoing>access_Flow_17</bpmn:outgoing>
      <bpmn:errorEventDefinition />
    </bpmn:boundaryEvent>
    <bpmn:serviceTask id="access_retry" name="processing_error + общий defer">
      <bpmn:documentation>DEFERRED_TICKET_RECHECK_SECONDS; committed ACCEPTED не откатывается.</bpmn:documentation>
      <bpmn:incoming>access_Flow_15</bpmn:incoming>
      <bpmn:incoming>access_Flow_16</bpmn:incoming>
      <bpmn:incoming>access_Flow_17</bpmn:incoming>
      <bpmn:outgoing>access_Flow_18</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:eventBasedGateway id="access_wait" name="Что наступило раньше?">
      <bpmn:incoming>access_Flow_8</bpmn:incoming>
      <bpmn:incoming>access_Flow_18</bpmn:incoming>
      <bpmn:outgoing>access_Flow_19</bpmn:outgoing>
      <bpmn:outgoing>access_Flow_20</bpmn:outgoing>
    </bpmn:eventBasedGateway>
    <bpmn:intermediateCatchEvent id="access_timer" name="Локальный срок defer">
      <bpmn:incoming>access_Flow_19</bpmn:incoming>
      <bpmn:outgoing>access_Flow_21</bpmn:outgoing>
      <bpmn:timerEventDefinition>
        <bpmn:timeDate xsi:type="bpmn:tFormalExpression">deferred_until</bpmn:timeDate>
      </bpmn:timerEventDefinition>
    </bpmn:intermediateCatchEvent>
    <bpmn:intermediateCatchEvent id="access_revision" name="Новая authoritative revision">
      <bpmn:incoming>access_Flow_20</bpmn:incoming>
      <bpmn:outgoing>access_Flow_22</bpmn:outgoing>
      <bpmn:messageEventDefinition />
    </bpmn:intermediateCatchEvent>
    <bpmn:serviceTask id="access_ready" name="Снять defer, вернуть в ready FIFO">
      <bpmn:incoming>access_Flow_21</bpmn:incoming>
      <bpmn:incoming>access_Flow_22</bpmn:incoming>
      <bpmn:outgoing>access_Flow_23</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:sequenceFlow id="access_Flow_0" sourceRef="access_start" targetRef="access_status" name="" />
    <bpmn:sequenceFlow id="access_Flow_1" sourceRef="access_status" targetRef="access_assigned" name="Да" />
    <bpmn:sequenceFlow id="access_Flow_2" sourceRef="access_status" targetRef="access_cleanup" name="Нет" />
    <bpmn:sequenceFlow id="access_Flow_3" sourceRef="access_assigned" targetRef="access_auto" name="Нет" />
    <bpmn:sequenceFlow id="access_Flow_4" sourceRef="access_assigned" targetRef="access_cleanup" name="Да" />
    <bpmn:sequenceFlow id="access_Flow_5" sourceRef="access_cleanup" targetRef="access_end" name="" />
    <bpmn:sequenceFlow id="access_Flow_6" sourceRef="access_auto" targetRef="access_notify" name="Нет" />
    <bpmn:sequenceFlow id="access_Flow_7" sourceRef="access_notify" targetRef="access_defer" name="" />
    <bpmn:sequenceFlow id="access_Flow_8" sourceRef="access_defer" targetRef="access_wait" name="" />
    <bpmn:sequenceFlow id="access_Flow_9" sourceRef="access_auto" targetRef="access_transition" name="Да" />
    <bpmn:sequenceFlow id="access_Flow_10" sourceRef="access_transition" targetRef="access_confirmed" name="" />
    <bpmn:sequenceFlow id="access_Flow_11" sourceRef="access_confirmed" targetRef="access_missing" name="Нет (404)" />
    <bpmn:sequenceFlow id="access_Flow_12" sourceRef="access_confirmed" targetRef="access_handoff" name="Да" />
    <bpmn:sequenceFlow id="access_Flow_13" sourceRef="access_handoff" targetRef="access_remove" name="" />
    <bpmn:sequenceFlow id="access_Flow_14" sourceRef="access_remove" targetRef="access_accepted" name="" />
    <bpmn:sequenceFlow id="access_Flow_15" sourceRef="access_notify_error" targetRef="access_retry" name="" />
    <bpmn:sequenceFlow id="access_Flow_16" sourceRef="access_api_error" targetRef="access_retry" name="" />
    <bpmn:sequenceFlow id="access_Flow_17" sourceRef="access_send_error" targetRef="access_retry" name="" />
    <bpmn:sequenceFlow id="access_Flow_18" sourceRef="access_retry" targetRef="access_wait" name="" />
    <bpmn:sequenceFlow id="access_Flow_19" sourceRef="access_wait" targetRef="access_timer" name="" />
    <bpmn:sequenceFlow id="access_Flow_20" sourceRef="access_wait" targetRef="access_revision" name="" />
    <bpmn:sequenceFlow id="access_Flow_21" sourceRef="access_timer" targetRef="access_ready" name="" />
    <bpmn:sequenceFlow id="access_Flow_22" sourceRef="access_revision" targetRef="access_ready" name="" />
    <bpmn:sequenceFlow id="access_Flow_23" sourceRef="access_ready" targetRef="access_status" name="Следующий проход" />
  </bpmn:process>
  <bpmn:collaboration id="Collaboration_access_pending_logic">
    <bpmn:participant id="access_Pool_access" name="open_access_request_pending: решение о запросе, не активация права" processRef="access_Process_access" />
  </bpmn:collaboration>
  <bpmndi:BPMNDiagram id="Diagram_access_pending_logic">
    <bpmndi:BPMNPlane id="Plane_access_pending_logic" bpmnElement="Collaboration_access_pending_logic">
      <bpmndi:BPMNShape id="access_DI_Pool_access" bpmnElement="access_Pool_access" isHorizontal="true">
        <dc:Bounds x="0.0" y="0.0" width="2010" height="970" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_Lane_worker" bpmnElement="access_Lane_worker" isHorizontal="true">
        <dc:Bounds x="30.0" y="0.0" width="1980" height="585.0" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_Lane_queue" bpmnElement="access_Lane_queue" isHorizontal="true">
        <dc:Bounds x="30.0" y="585.0" width="1980" height="385.0" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_start" bpmnElement="access_start">
        <dc:Bounds x="132.0" y="92.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_status" bpmnElement="access_status">
        <dc:Bounds x="325.0" y="85.0" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_assigned" bpmnElement="access_assigned">
        <dc:Bounds x="555.0" y="85.0" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_auto" bpmnElement="access_auto">
        <dc:Bounds x="805.0" y="85.0" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_notify" bpmnElement="access_notify">
        <dc:Bounds x="1005.0" y="75.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_defer" bpmnElement="access_defer">
        <dc:Bounds x="1265.0" y="75.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_cleanup" bpmnElement="access_cleanup">
        <dc:Bounds x="275.0" y="265.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_end" bpmnElement="access_end">
        <dc:Bounds x="562.0" y="282.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_transition" bpmnElement="access_transition">
        <dc:Bounds x="755.0" y="265.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_confirmed" bpmnElement="access_confirmed">
        <dc:Bounds x="1055.0" y="275.0" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_handoff" bpmnElement="access_handoff">
        <dc:Bounds x="1265.0" y="265.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_remove" bpmnElement="access_remove">
        <dc:Bounds x="1525.0" y="265.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_accepted" bpmnElement="access_accepted">
        <dc:Bounds x="1832.0" y="282.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_missing" bpmnElement="access_missing">
        <dc:Bounds x="1062.0" y="462.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_notify_error" bpmnElement="access_notify_error">
        <dc:Bounds x="1112.0" y="127.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_api_error" bpmnElement="access_api_error">
        <dc:Bounds x="862.0" y="317.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_send_error" bpmnElement="access_send_error">
        <dc:Bounds x="1372.0" y="317.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_retry" bpmnElement="access_retry">
        <dc:Bounds x="1525.0" y="465.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_wait" bpmnElement="access_wait">
        <dc:Bounds x="1055.0" y="715.0" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_timer" bpmnElement="access_timer">
        <dc:Bounds x="1322.0" y="652.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_revision" bpmnElement="access_revision">
        <dc:Bounds x="1322.0" y="852.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="access_DI_ready" bpmnElement="access_ready">
        <dc:Bounds x="1525.0" y="705.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="access_DI_Flow_0" bpmnElement="access_Flow_0">
        <di:waypoint x="168.0" y="110.0" />
        <di:waypoint x="325.0" y="110.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_1" bpmnElement="access_Flow_1">
        <di:waypoint x="375.0" y="110.0" />
        <di:waypoint x="555.0" y="110.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_2" bpmnElement="access_Flow_2">
        <di:waypoint x="350.0" y="135.0" />
        <di:waypoint x="350.0" y="265.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_3" bpmnElement="access_Flow_3">
        <di:waypoint x="605.0" y="110.0" />
        <di:waypoint x="805.0" y="110.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_4" bpmnElement="access_Flow_4">
        <di:waypoint x="605.0" y="110.0" />
        <di:waypoint x="690.0" y="110.0" />
        <di:waypoint x="690.0" y="235.0" />
        <di:waypoint x="350.0" y="235.0" />
        <di:waypoint x="350.0" y="265.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_5" bpmnElement="access_Flow_5">
        <di:waypoint x="425.0" y="300.0" />
        <di:waypoint x="562.0" y="300.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_6" bpmnElement="access_Flow_6">
        <di:waypoint x="855.0" y="110.0" />
        <di:waypoint x="1005.0" y="110.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_7" bpmnElement="access_Flow_7">
        <di:waypoint x="1155.0" y="110.0" />
        <di:waypoint x="1265.0" y="110.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_8" bpmnElement="access_Flow_8">
        <di:waypoint x="1415.0" y="110.0" />
        <di:waypoint x="1470.0" y="110.0" />
        <di:waypoint x="1470.0" y="600.0" />
        <di:waypoint x="1080.0" y="600.0" />
        <di:waypoint x="1080.0" y="715.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_9" bpmnElement="access_Flow_9">
        <di:waypoint x="830.0" y="135.0" />
        <di:waypoint x="830.0" y="265.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_10" bpmnElement="access_Flow_10">
        <di:waypoint x="905.0" y="300.0" />
        <di:waypoint x="1055.0" y="300.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_11" bpmnElement="access_Flow_11">
        <di:waypoint x="1080.0" y="325.0" />
        <di:waypoint x="1080.0" y="462.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_12" bpmnElement="access_Flow_12">
        <di:waypoint x="1105.0" y="300.0" />
        <di:waypoint x="1265.0" y="300.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_13" bpmnElement="access_Flow_13">
        <di:waypoint x="1415.0" y="300.0" />
        <di:waypoint x="1525.0" y="300.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_14" bpmnElement="access_Flow_14">
        <di:waypoint x="1675.0" y="300.0" />
        <di:waypoint x="1832.0" y="300.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_15" bpmnElement="access_Flow_15">
        <di:waypoint x="1148.0" y="145.0" />
        <di:waypoint x="1190.0" y="145.0" />
        <di:waypoint x="1520.0" y="145.0" />
        <di:waypoint x="1520.0" y="435.0" />
        <di:waypoint x="1600.0" y="435.0" />
        <di:waypoint x="1600.0" y="465.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_16" bpmnElement="access_Flow_16">
        <di:waypoint x="898.0" y="335.0" />
        <di:waypoint x="940.0" y="335.0" />
        <di:waypoint x="940.0" y="415.0" />
        <di:waypoint x="1600.0" y="415.0" />
        <di:waypoint x="1600.0" y="465.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_17" bpmnElement="access_Flow_17">
        <di:waypoint x="1408.0" y="335.0" />
        <di:waypoint x="1450.0" y="335.0" />
        <di:waypoint x="1600.0" y="335.0" />
        <di:waypoint x="1600.0" y="465.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_18" bpmnElement="access_Flow_18">
        <di:waypoint x="1675.0" y="500.0" />
        <di:waypoint x="1720.0" y="500.0" />
        <di:waypoint x="1720.0" y="615.0" />
        <di:waypoint x="1080.0" y="615.0" />
        <di:waypoint x="1080.0" y="715.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_19" bpmnElement="access_Flow_19">
        <di:waypoint x="1105.0" y="740.0" />
        <di:waypoint x="1213.5" y="740.0" />
        <di:waypoint x="1213.5" y="670.0" />
        <di:waypoint x="1322.0" y="670.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_20" bpmnElement="access_Flow_20">
        <di:waypoint x="1105.0" y="740.0" />
        <di:waypoint x="1213.5" y="740.0" />
        <di:waypoint x="1213.5" y="870.0" />
        <di:waypoint x="1322.0" y="870.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_21" bpmnElement="access_Flow_21">
        <di:waypoint x="1358.0" y="670.0" />
        <di:waypoint x="1441.5" y="670.0" />
        <di:waypoint x="1441.5" y="740.0" />
        <di:waypoint x="1525.0" y="740.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_22" bpmnElement="access_Flow_22">
        <di:waypoint x="1358.0" y="870.0" />
        <di:waypoint x="1441.5" y="870.0" />
        <di:waypoint x="1441.5" y="740.0" />
        <di:waypoint x="1525.0" y="740.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="access_DI_Flow_23" bpmnElement="access_Flow_23">
        <di:waypoint x="1675.0" y="740.0" />
        <di:waypoint x="2040.0" y="740.0" />
        <di:waypoint x="2040.0" y="25.0" />
        <di:waypoint x="350.0" y="25.0" />
        <di:waypoint x="350.0" y="85.0" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1750.0" y="5.0" width="180" height="26" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>
  • Чужой статус либо уже заполненный assigned_to — убрать локальный Ticket и комнату, не менять бизнес-статус.
  • Неназначенный Ticket, autoaccept выключен — сформировать сообщение о запрошенной роли, группе согласования и реквизитах заявки, отправить его в MUC-комнату Ticket, записать manual_access_decision и назначить defer по ACCESS_REQUEST_PENDING_RECHECK_SECONDS.
  • Неназначенный Ticket, autoaccept включён — запросить ACCEPTED через scoped Ticket API, явно передать в open_access_request_accepted и убрать текущий Ticket с сохранением комнаты после успешной передачи.

404 перехода означает устаревший scope и запрашивает локальную очистку. Иная ошибка API/отправки попадает в общий processing_error и defer по DEFERRED_TICKET_RECHECK_SECONDS. Уже committed ACCEPTED не откатывается из-за ошибки прямой XMPP-передачи: backend wakeup и periodic reconciliation позволяют следующему владельцу получить сохранённое состояние.

Ручное решение и внешние участники (BPMN)

Схема BPMN

Загрузка схемы…

Исходник схемы
<?xml version="1.0" encoding="UTF-8"?>
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="Definitions_access_pending_external" targetNamespace="urn:sharix:knowledge:handlers">
  <bpmn:process id="person_Process_person" name="Ответственный пользователь с отдельным доступом к Ticket" isExecutable="false">
    <bpmn:documentation>{"notes": ["Git built-in и внешние контракты, без выполнения обработчика.", "BPMN isExecutable=false. End event — конец показанного прохода, не предоставление права.", "deferred_until — символ локального срока, не настройка сервера.", "Участие в XMPP комнате не выдаёт право менять Ticket. Текст сообщения не является командой смены статуса."], "sources": [{"commit": "76e0c693b628ed4a1fa34515a3f8abdff26149bb", "path": "handlers/open_access_request_pending.py", "repository": "sharix-open-handlers-examples", "sha256": "ca7c362ab1bddd1712bc569100d827297402ffde74badaab5e4f8847c09800a6"}, {"commit": "76e0c693b628ed4a1fa34515a3f8abdff26149bb", "path": "generated_handler_blocks/open_access_request_pending.json", "repository": "sharix-open-handlers-examples", "sha256": "06b959d4511d9b64e0b6a2a1d1c0ba118199d913c15f6206d086edaf6072099d"}, {"commit": "76e0c693b628ed4a1fa34515a3f8abdff26149bb", "path": "catalog.py", "repository": "sharix-open-handlers-examples", "sha256": "e3dcb72b7e620e2837adacd7af053f35b04cdff475789496d9c114e17d57dfde"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/blockly_runtime.py", "repository": "sharix-open-handlers-backend", "sha256": "3e222150cbff315077c6c9b160d46e59856cedf6d6591d213e958c63cb2f2428"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/handler_operations.py", "repository": "sharix-open-handlers-backend", "sha256": "28620658501c375f556e24437871620b84a17a88d0b62b2d1a3cc5deb2f14b1e"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/data_parsers.py", "repository": "sharix-open-handlers-backend", "sha256": "d7f26f172f68e4b390f675de88fbfb3c37a58fb29d4bf3d6687b31bd7953f9e4"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/ejabberd_muc.py", "repository": "sharix-open-handlers-backend", "sha256": "35c2eba89fab36b5c444439a87beaa516b55133991136d5370418d92a18d7bcd"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/requesters.py", "repository": "sharix-open-handlers-backend", "sha256": "965a348cea477722bbaf4c8c6b06023eb238b71664a332f7ea8c90bfe72ea808"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "classes/AccessRequestTicket.py", "repository": "sharix-open-handlers-backend", "sha256": "3f3a498ae76b3d878b19a8f32170fc2a71c6c6c182bf34a6ecc50edf7b0f5eff"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "ticket_blockly_codegen.py", "repository": "sharix-open-handlers-backend", "sha256": "bce71eab622922f8dd0954222842349799b60e18a0ab6310cc3e5f305603661e"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "ticket_codegen_contract.json", "repository": "sharix-open-handlers-backend", "sha256": "0bfd2b0ebb07bd380ed3c867386536ab88ef7dfa6e13f1cd8c91d32bb02c1ae9"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "lib/tickets.py", "repository": "sharix-open-tickets", "sha256": "0d260c17947f9a186d07af2749159780e3c7354a95b4bafe9d67493663c96883"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "api/views/handler_workflow.py", "repository": "sharix-open-tickets", "sha256": "f97c4b467a9a30749f5c4b86b39a833c430e57aaa1f030f70030d9b5c609d368"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "api/handler_auth.py", "repository": "sharix-open-tickets", "sha256": "ac76dc45aaa9742e5e1da0b98aae914bb2e287048d33e97b4a245a6997bc8425"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "utils.py", "repository": "sharix-open-tickets", "sha256": "a5680205c6522e1d9a74d9d267fe9ee96faf6f06436b00877fc0a93d80234bf5"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "views/ticket_detail.py", "repository": "sharix-open-tickets", "sha256": "05d344b0fba14cf895400694d4a18f486c800fef08dd1acb43ea46909b9e7e59"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "signals.py", "repository": "sharix-open-tickets", "sha256": "39aad8690a2e7d35cebfb052127a8130a951cbb4eea316c4f767a0a59fc5fa7e"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "services/handler_wakeup.py", "repository": "sharix-open-tickets", "sha256": "c9fdc62a18301fd7c075395c697d5b1c738c77713aa71fcbb5ab097e173d98de"}]}</bpmn:documentation>
    <bpmn:laneSet id="person_Lanes_person">
      <bpmn:lane id="person_Lane_worker" name="Ручное решение">
        <bpmn:flowNodeRef>person_notice</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>person_review</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>person_choose</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>person_send</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>person_end</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>
    <bpmn:startEvent id="person_notice" name="Получено сообщение о заявке">
      <bpmn:outgoing>person_Flow_0</bpmn:outgoing>
      <bpmn:messageEventDefinition />
    </bpmn:startEvent>
    <bpmn:userTask id="person_review" name="Изучить заявку и основание доступа">
      <bpmn:incoming>person_Flow_0</bpmn:incoming>
      <bpmn:outgoing>person_Flow_1</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:userTask id="person_choose" name="Выбрать ACCEPTED / DECLINED">
      <bpmn:incoming>person_Flow_1</bpmn:incoming>
      <bpmn:outgoing>person_Flow_2</bpmn:outgoing>
    </bpmn:userTask>
    <bpmn:sendTask id="person_send" name="Запросить переход в карточке/API">
      <bpmn:incoming>person_Flow_2</bpmn:incoming>
      <bpmn:outgoing>person_Flow_3</bpmn:outgoing>
    </bpmn:sendTask>
    <bpmn:endEvent id="person_end" name="Ожидать результата сохранения">
      <bpmn:incoming>person_Flow_3</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="person_Flow_0" sourceRef="person_notice" targetRef="person_review" name="" />
    <bpmn:sequenceFlow id="person_Flow_1" sourceRef="person_review" targetRef="person_choose" name="" />
    <bpmn:sequenceFlow id="person_Flow_2" sourceRef="person_choose" targetRef="person_send" name="" />
    <bpmn:sequenceFlow id="person_Flow_3" sourceRef="person_send" targetRef="person_end" name="" />
  </bpmn:process>
  <bpmn:process id="backend_Process_backend" name="Tickets backend: объектные права, lifecycle и commit" isExecutable="false">
    <bpmn:documentation>{"notes": ["Git built-in и внешние контракты, без выполнения обработчика.", "BPMN isExecutable=false. End event — конец показанного прохода, не предоставление права.", "deferred_until — символ локального срока, не настройка сервера.", "Участие в XMPP комнате не выдаёт право менять Ticket. Текст сообщения не является командой смены статуса."], "sources": [{"commit": "76e0c693b628ed4a1fa34515a3f8abdff26149bb", "path": "handlers/open_access_request_pending.py", "repository": "sharix-open-handlers-examples", "sha256": "ca7c362ab1bddd1712bc569100d827297402ffde74badaab5e4f8847c09800a6"}, {"commit": "76e0c693b628ed4a1fa34515a3f8abdff26149bb", "path": "generated_handler_blocks/open_access_request_pending.json", "repository": "sharix-open-handlers-examples", "sha256": "06b959d4511d9b64e0b6a2a1d1c0ba118199d913c15f6206d086edaf6072099d"}, {"commit": "76e0c693b628ed4a1fa34515a3f8abdff26149bb", "path": "catalog.py", "repository": "sharix-open-handlers-examples", "sha256": "e3dcb72b7e620e2837adacd7af053f35b04cdff475789496d9c114e17d57dfde"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/blockly_runtime.py", "repository": "sharix-open-handlers-backend", "sha256": "3e222150cbff315077c6c9b160d46e59856cedf6d6591d213e958c63cb2f2428"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/handler_operations.py", "repository": "sharix-open-handlers-backend", "sha256": "28620658501c375f556e24437871620b84a17a88d0b62b2d1a3cc5deb2f14b1e"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/data_parsers.py", "repository": "sharix-open-handlers-backend", "sha256": "d7f26f172f68e4b390f675de88fbfb3c37a58fb29d4bf3d6687b31bd7953f9e4"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/ejabberd_muc.py", "repository": "sharix-open-handlers-backend", "sha256": "35c2eba89fab36b5c444439a87beaa516b55133991136d5370418d92a18d7bcd"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "core/requesters.py", "repository": "sharix-open-handlers-backend", "sha256": "965a348cea477722bbaf4c8c6b06023eb238b71664a332f7ea8c90bfe72ea808"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "classes/AccessRequestTicket.py", "repository": "sharix-open-handlers-backend", "sha256": "3f3a498ae76b3d878b19a8f32170fc2a71c6c6c182bf34a6ecc50edf7b0f5eff"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "ticket_blockly_codegen.py", "repository": "sharix-open-handlers-backend", "sha256": "bce71eab622922f8dd0954222842349799b60e18a0ab6310cc3e5f305603661e"}, {"commit": "50baf376e224d915a87d63240f3f339b3dda9afa", "path": "ticket_codegen_contract.json", "repository": "sharix-open-handlers-backend", "sha256": "0bfd2b0ebb07bd380ed3c867386536ab88ef7dfa6e13f1cd8c91d32bb02c1ae9"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "lib/tickets.py", "repository": "sharix-open-tickets", "sha256": "0d260c17947f9a186d07af2749159780e3c7354a95b4bafe9d67493663c96883"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "api/views/handler_workflow.py", "repository": "sharix-open-tickets", "sha256": "f97c4b467a9a30749f5c4b86b39a833c430e57aaa1f030f70030d9b5c609d368"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "api/handler_auth.py", "repository": "sharix-open-tickets", "sha256": "ac76dc45aaa9742e5e1da0b98aae914bb2e287048d33e97b4a245a6997bc8425"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "utils.py", "repository": "sharix-open-tickets", "sha256": "a5680205c6522e1d9a74d9d267fe9ee96faf6f06436b00877fc0a93d80234bf5"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "views/ticket_detail.py", "repository": "sharix-open-tickets", "sha256": "05d344b0fba14cf895400694d4a18f486c800fef08dd1acb43ea46909b9e7e59"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "signals.py", "repository": "sharix-open-tickets", "sha256": "39aad8690a2e7d35cebfb052127a8130a951cbb4eea316c4f767a0a59fc5fa7e"}, {"commit": "fd64704d7d9f01a5ec5b7b89cbc5afe5102b2c14", "path": "services/handler_wakeup.py", "repository": "sharix-open-tickets", "sha256": "c9fdc62a18301fd7c075395c697d5b1c738c77713aa71fcbb5ab097e173d98de"}]}</bpmn:documentation>
    <bpmn:laneSet id="backend_Lanes_backend">
      <bpmn:lane id="backend_Lane_worker" name="Сохранение решения">
        <bpmn:flowNodeRef>backend_request</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>backend_acl</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>backend_allowed</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>backend_save</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>backend_publish</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>backend_end</bpmn:flowNodeRef>
        <bpmn:flowNodeRef>backend_reject</bpmn:flowNodeRef>
      </bpmn:lane>
    </bpmn:laneSet>
    <bpmn:startEvent id="backend_request" name="Запрос решения">
      <bpmn:outgoing>backend_Flow_0</bpmn:outgoing>
      <bpmn:messageEventDefinition />
    </bpmn:startEvent>
    <bpmn:serviceTask id="backend_acl" name="Проверить доступ и допустимость перехода">
      <bpmn:incoming>backend_Flow_0</bpmn:incoming>
      <bpmn:outgoing>backend_Flow_1</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:exclusiveGateway id="backend_allowed" name="Разрешено?">
      <bpmn:incoming>backend_Flow_1</bpmn:incoming>
      <bpmn:outgoing>backend_Flow_2</bpmn:outgoing>
      <bpmn:outgoing>backend_Flow_3</bpmn:outgoing>
    </bpmn:exclusiveGateway>
    <bpmn:serviceTask id="backend_save" name="Сохранить статус и Event">
      <bpmn:incoming>backend_Flow_2</bpmn:incoming>
      <bpmn:outgoing>backend_Flow_4</bpmn:outgoing>
    </bpmn:serviceTask>
    <bpmn:sendTask id="backend_publish" name="После commit: changed / moved">
      <bpmn:incoming>backend_Flow_4</bpmn:incoming>
      <bpmn:outgoing>backend_Flow_5</bpmn:outgoing>
    </bpmn:sendTask>
    <bpmn:endEvent id="backend_end" name="Решение сохранено">
      <bpmn:incoming>backend_Flow_5</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:endEvent id="backend_reject" name="Отказ: переход не выполнен">
      <bpmn:incoming>backend_Flow_3</bpmn:incoming>
    </bpmn:endEvent>
    <bpmn:sequenceFlow id="backend_Flow_0" sourceRef="backend_request" targetRef="backend_acl" name="" />
    <bpmn:sequenceFlow id="backend_Flow_1" sourceRef="backend_acl" targetRef="backend_allowed" name="" />
    <bpmn:sequenceFlow id="backend_Flow_2" sourceRef="backend_allowed" targetRef="backend_save" name="Да" />
    <bpmn:sequenceFlow id="backend_Flow_3" sourceRef="backend_allowed" targetRef="backend_reject" name="Нет" />
    <bpmn:sequenceFlow id="backend_Flow_4" sourceRef="backend_save" targetRef="backend_publish" name="" />
    <bpmn:sequenceFlow id="backend_Flow_5" sourceRef="backend_publish" targetRef="backend_end" name="" />
  </bpmn:process>
  <bpmn:collaboration id="Collaboration_access_pending_external">
    <bpmn:participant id="room_Participant" name="MUC-комната ticket_&lt;id&gt;_type_3: приглашение / сообщение для рассмотрения" />
    <bpmn:participant id="person_Pool_person" name="Ответственный пользователь с отдельным доступом к Ticket" processRef="person_Process_person" />
    <bpmn:participant id="backend_Pool_backend" name="Tickets backend: объектные права, lifecycle и commit" processRef="backend_Process_backend" />
    <bpmn:participant id="old_Participant" name="PENDING handler: исключить прежний снимок; fallback reconciliation" />
    <bpmn:participant id="next_Participant" name="ACCEPTED / DECLINED handler: профильные проверки и действия" />
    <bpmn:messageFlow id="Message_access_pending_external_0" sourceRef="room_Participant" targetRef="person_notice" name="Уведомление, не разрешение доступа" />
    <bpmn:messageFlow id="Message_access_pending_external_1" sourceRef="person_send" targetRef="backend_request" name="Ручное решение через разрешённый интерфейс" />
    <bpmn:messageFlow id="Message_access_pending_external_2" sourceRef="backend_publish" targetRef="old_Participant" name="ticket.moved: прежний PENDING" />
    <bpmn:messageFlow id="Message_access_pending_external_3" sourceRef="backend_publish" targetRef="next_Participant" name="ticket.changed: новый владелец" />
  </bpmn:collaboration>
  <bpmndi:BPMNDiagram id="Diagram_access_pending_external">
    <bpmndi:BPMNPlane id="Plane_access_pending_external" bpmnElement="Collaboration_access_pending_external">
      <bpmndi:BPMNShape id="DI_room_Participant" bpmnElement="room_Participant" isHorizontal="true">
        <dc:Bounds x="0" y="0" width="1700" height="90" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="person_DI_Pool_person" bpmnElement="person_Pool_person" isHorizontal="true">
        <dc:Bounds x="0.0" y="210.0" width="1400" height="200" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="person_DI_Lane_worker" bpmnElement="person_Lane_worker" isHorizontal="true">
        <dc:Bounds x="30.0" y="210.0" width="1370" height="200" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="person_DI_notice" bpmnElement="person_notice">
        <dc:Bounds x="132.0" y="292.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="person_DI_review" bpmnElement="person_review">
        <dc:Bounds x="345.0" y="275.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="person_DI_choose" bpmnElement="person_choose">
        <dc:Bounds x="625.0" y="275.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="person_DI_send" bpmnElement="person_send">
        <dc:Bounds x="905.0" y="275.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="person_DI_end" bpmnElement="person_end">
        <dc:Bounds x="1222.0" y="292.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="person_DI_Flow_0" bpmnElement="person_Flow_0">
        <di:waypoint x="168.0" y="310.0" />
        <di:waypoint x="345.0" y="310.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="person_DI_Flow_1" bpmnElement="person_Flow_1">
        <di:waypoint x="495.0" y="310.0" />
        <di:waypoint x="625.0" y="310.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="person_DI_Flow_2" bpmnElement="person_Flow_2">
        <di:waypoint x="775.0" y="310.0" />
        <di:waypoint x="905.0" y="310.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="person_DI_Flow_3" bpmnElement="person_Flow_3">
        <di:waypoint x="1055.0" y="310.0" />
        <di:waypoint x="1222.0" y="310.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="backend_DI_Pool_backend" bpmnElement="backend_Pool_backend" isHorizontal="true">
        <dc:Bounds x="0.0" y="560.0" width="1630" height="380" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="backend_DI_Lane_worker" bpmnElement="backend_Lane_worker" isHorizontal="true">
        <dc:Bounds x="30.0" y="560.0" width="1600" height="380" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="backend_DI_request" bpmnElement="backend_request">
        <dc:Bounds x="132.0" y="642.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="backend_DI_acl" bpmnElement="backend_acl">
        <dc:Bounds x="345.0" y="625.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="backend_DI_allowed" bpmnElement="backend_allowed">
        <dc:Bounds x="675.0" y="635.0" width="50" height="50" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="backend_DI_save" bpmnElement="backend_save">
        <dc:Bounds x="875.0" y="625.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="backend_DI_publish" bpmnElement="backend_publish">
        <dc:Bounds x="1145.0" y="625.0" width="150" height="70" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="backend_DI_end" bpmnElement="backend_end">
        <dc:Bounds x="1452.0" y="642.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="backend_DI_reject" bpmnElement="backend_reject">
        <dc:Bounds x="682.0" y="822.0" width="36" height="36" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="backend_DI_Flow_0" bpmnElement="backend_Flow_0">
        <di:waypoint x="168.0" y="660.0" />
        <di:waypoint x="345.0" y="660.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="backend_DI_Flow_1" bpmnElement="backend_Flow_1">
        <di:waypoint x="495.0" y="660.0" />
        <di:waypoint x="675.0" y="660.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="backend_DI_Flow_2" bpmnElement="backend_Flow_2">
        <di:waypoint x="725.0" y="660.0" />
        <di:waypoint x="875.0" y="660.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="backend_DI_Flow_3" bpmnElement="backend_Flow_3">
        <di:waypoint x="700.0" y="685.0" />
        <di:waypoint x="700.0" y="822.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="backend_DI_Flow_4" bpmnElement="backend_Flow_4">
        <di:waypoint x="1025.0" y="660.0" />
        <di:waypoint x="1145.0" y="660.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="backend_DI_Flow_5" bpmnElement="backend_Flow_5">
        <di:waypoint x="1295.0" y="660.0" />
        <di:waypoint x="1452.0" y="660.0" />
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNShape id="DI_old_Participant" bpmnElement="old_Participant" isHorizontal="true">
        <dc:Bounds x="0" y="1090" width="760" height="100" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNShape id="DI_next_Participant" bpmnElement="next_Participant" isHorizontal="true">
        <dc:Bounds x="850" y="1090" width="850" height="100" />
      </bpmndi:BPMNShape>
      <bpmndi:BPMNEdge id="DI_Message_access_pending_external_0" bpmnElement="Message_access_pending_external_0">
        <di:waypoint x="150" y="90" />
        <di:waypoint x="150" y="292" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="170" y="140" width="260" height="42" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="DI_Message_access_pending_external_1" bpmnElement="Message_access_pending_external_1">
        <di:waypoint x="980" y="345" />
        <di:waypoint x="980" y="510" />
        <di:waypoint x="150" y="510" />
        <di:waypoint x="150" y="642" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="260" y="480" width="260" height="42" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="DI_Message_access_pending_external_2" bpmnElement="Message_access_pending_external_2">
        <di:waypoint x="1220" y="695" />
        <di:waypoint x="1220" y="940" />
        <di:waypoint x="380" y="940" />
        <di:waypoint x="380" y="1090" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="210" y="985" width="260" height="42" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
      <bpmndi:BPMNEdge id="DI_Message_access_pending_external_3" bpmnElement="Message_access_pending_external_3">
        <di:waypoint x="1280" y="695" />
        <di:waypoint x="1650" y="695" />
        <di:waypoint x="1650" y="1010" />
        <di:waypoint x="1275" y="1010" />
        <di:waypoint x="1275" y="1090" />
        <bpmndi:BPMNLabel>
          <dc:Bounds x="1080" y="1040" width="260" height="42" />
        </bpmndi:BPMNLabel>
      </bpmndi:BPMNEdge>
    </bpmndi:BPMNPlane>
  </bpmndi:BPMNDiagram>
</bpmn:definitions>

В текущем lifecycle из PENDING разрешены ACCEPTED, DECLINED или CLOSED. Основное решение о доступе — принятие либо отказ; закрытие без перехода в профильный handler не является подтверждением активации права. Схема показывает рассмотрение и эти два профильных исхода. Чтение Ticket и право менять его статус проверяются отдельно; авторство само по себе не даёт права принять собственный запрос.

Уведомление или ответ текстом в XMPP-комнате не являются реализованным действием смены статуса в этом handler. Пользователь выполняет решение через разрешённую карточку/API; backend проверяет права и lifecycle, сохраняет статус и Event, после commit отправляет ticket.changed новому владельцу и ticket.moved прежнему. Ошибка доставки не отменяет сохранённое решение. Прежний in-flight worker учитывает pending discard после завершения прохода.

После ACCEPTED следующий handler проверяет связанную permission, обязательные requirements и результат активации; после DECLINED действует отдельная логика отказа/очистки. Само автоматическое принятие PENDING не доказывает наличия Permissions, выдачи роли или готовности всех требований.

Как устроено уведомление в этой реализации

notify_admins здесь использует комнату ticket_<id>_type_3 через ejabberd API. Участники формируются из активных пользователей группы METASERVICE-ADMIN, имеющих XMPP-реквизиты, JID текущего bot и report JID; повторы убираются. Локальный helper использует Django-контекст для поиска участников.

Поле decision_maker_group входит в текст уведомления, но в этом пути не является фильтром участников комнаты. Это отличается от адресного reviewer API профильных ST_REQUEST-проверок: нельзя автоматически переносить его правила получателей на данный handler. Участие в комнате не выдаёт права на Ticket.

Helper пытается создать members-only комнату, добавить/подписать/пригласить участников. Часть ошибок подготовки ловится и логируется, затем комната попадает в локальный cache; это не доказательство успешной доставки всем участникам. Само сообщение отправляется отдельно. В этом пути нет durable ack ключа, как у verification notifications: при повторных проходах ручной ветви сообщение может отправляться снова. Уведомление не гарантирует прочтение человеком.

Формирование сообщения использует AccessRequestTicket из JSON payload: в нём должны присутствовать обязательные реквизиты, включая requested_role. Пустой или несовместимый JSON не превращается в корректную заявку и может привести к общему retry до исправления данных. Промокод и комментарий существуют в payload, но этот handler не валидирует промокод и не использует его как основание автоматической выдачи права.

Таймеры и восстановление

Ситуация Поведение
Ручное рассмотрение ACCESS_REQUEST_PENDING_RECHECK_SECONDS, причина manual_access_decision
Ошибка обработки DEFERRED_TICKET_RECHECK_SECONDS, processing_error
Сверка очереди INTERVAL_TIME_BD_REQ, scoped PENDING-список

Defer хранится в памяти и освобождает worker. Срок означает готовность, а не точное время запуска. Новая authoritative revision снимает ожидание; повтор того же снимка — нет. После рестарта очередь заново получает актуальные Ticket. Ошибка API-списка не должна восприниматься как подтверждённое отсутствие заявок.

Что проверить при отсутствии движения

Различайте назначение assigned_to, решение PENDING→ACCEPTED/DECLINED и фактическую активацию permission. Проверьте выбранный Python/workspace, ACCREQ_AUTOACCEPT, JSON заявки, состав и доступность MUC-комнаты, права рассматривающего, scoped Ticket API и доставку commit-событий. Если Ticket уже ACCEPTED, диагностику требований и права продолжайте в следующей стадии, а не повторным принятием запроса.

Проверенные источники

В metadata и documentation BPMN закреплены Git SHA, SHA-256 и параметры моделей. Алгоритм проверен по Blockly/Python, внешние действия — по runtime, room helper и view/API/ACL. Схемы имеют isExecutable=false; код обработчиков во время анализа/генерации не запускается.

Связанные материалы

sharixopen/knowledge/scenarios/access_request_pending.1793216194.txt.gz · Последнее изменение: — sx_knowledge_api_open

© 2022 ShariX