| Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия |
| ru:rule:external_event [2024-08-28 14:24] – [Примечания] Anatoly Belaychuk | ru:rule:external_event [2024-10-05 13:31] (текущий) – [Моделируйте обработку события, инициированного внешним участником, отдельным процессом] Anatoly Belaychuk |
|---|
| ====== 0-TBD Моделируйте реакцию на событие, инициируемое внешним участником, отдельным процессом ====== | ====== Моделируйте обработку события, инициированного внешним участником, отдельным процессом ====== |
| |
| {{tag>ru-процесс}} | {{tag>процесс-ru взаимодействие}} |
| |
| {{:ru:v_razrabotke.png?nolink&200|}} | В момент, когда происходит внешнее событие (например, приходит груз от поставщика), оно еще не привязано к контексту (заказ, по которому осуществляется доставка). |
| | Это значит, что внешнее событие нельзя обработать в рамках экземпляра уже запущенного процесса (у нас множество заказов, ожидающих доставки) - |
| Краткое описание правила. | следовательно, его следует обрабатывать стартовым событием отдельного процесса-обработчика (не путать с подпроцессом-обработчиком). |
| |
| ===== ✔ Как надо ===== | ===== ✔ Как надо ===== |
| <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="http://bpmn.io" exporterVersion="0.10.1"> | <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="http://bpmn.io" exporterVersion="0.10.1"> |
| <collaboration id="Collaboration_0g7t6mq"> | <collaboration id="Collaboration_0g7t6mq"> |
| <participant id="Participant_144acff" name="Procure to pay" processRef="Process_1" /> | <participant id="Participant_144acff" name="От потребности до закупки" processRef="Process_1" /> |
| <participant id="Participant_04mf8ql" name="Goods acceptance" processRef="Process_0ath8fq" /> | <participant id="Participant_04mf8ql" name="Приемка товара от поставщика" processRef="Process_0ath8fq" /> |
| <messageFlow id="Flow_06phhio" sourceRef="Event_12lad3v" targetRef="Event_1nu1su1" /> | <messageFlow id="Flow_06phhio" sourceRef="Event_12lad3v" targetRef="Event_1nu1su1" /> |
| </collaboration> | </collaboration> |
| <sequenceFlow id="Flow_0fqr94i" sourceRef="Event_1ng94pf" targetRef="Activity_0xko542" /> | <sequenceFlow id="Flow_0fqr94i" sourceRef="Event_1ng94pf" targetRef="Activity_0xko542" /> |
| <sequenceFlow id="Flow_1qzqmrm" sourceRef="Activity_0xko542" targetRef="Event_1nu1su1" /> | <sequenceFlow id="Flow_1qzqmrm" sourceRef="Activity_0xko542" targetRef="Event_1nu1su1" /> |
| <intermediateCatchEvent id="Event_1nu1su1" name="Goods accepted"> | <intermediateCatchEvent id="Event_1nu1su1" name="Товар принят"> |
| <incoming>Flow_1qzqmrm</incoming> | <incoming>Flow_1qzqmrm</incoming> |
| <outgoing>Flow_0mvecfq</outgoing> | <outgoing>Flow_0mvecfq</outgoing> |
| <sequenceFlow id="Flow_0mvecfq" sourceRef="Event_1nu1su1" targetRef="Activity_1ashtyk" /> | <sequenceFlow id="Flow_0mvecfq" sourceRef="Event_1nu1su1" targetRef="Activity_1ashtyk" /> |
| <sequenceFlow id="Flow_1uu5pmf" sourceRef="Activity_1ashtyk" targetRef="Event_1kmjuhs" /> | <sequenceFlow id="Flow_1uu5pmf" sourceRef="Activity_1ashtyk" targetRef="Event_1kmjuhs" /> |
| <dataStoreReference id="DataStoreReference_0ptgekw" name="Purchase orders" /> | <dataStoreReference id="DataStoreReference_0ptgekw" name="Заказы на закупку" /> |
| <task id="Activity_1ashtyk" name="..."> | <task id="Activity_1ashtyk" name="..."> |
| <incoming>Flow_0mvecfq</incoming> | <incoming>Flow_0mvecfq</incoming> |
| </process> | </process> |
| <process id="Process_0ath8fq"> | <process id="Process_0ath8fq"> |
| <startEvent id="Event_0djxenp" name="Goods arrived"> | <startEvent id="Event_0djxenp" name="Товар доставлен"> |
| <outgoing>Flow_0za1h4b</outgoing> | <outgoing>Flow_0za1h4b</outgoing> |
| </startEvent> | </startEvent> |
| <sequenceFlow id="Flow_0za1h4b" sourceRef="Event_0djxenp" targetRef="Activity_16ezjxr" /> | <sequenceFlow id="Flow_0za1h4b" sourceRef="Event_0djxenp" targetRef="Activity_16ezjxr" /> |
| <sequenceFlow id="Flow_12cq0dp" sourceRef="Activity_16ezjxr" targetRef="Gateway_1gih9c0" /> | <sequenceFlow id="Flow_12cq0dp" sourceRef="Activity_16ezjxr" targetRef="Gateway_1gih9c0" /> |
| <sequenceFlow id="Flow_1or7fxn" name="no" sourceRef="Gateway_1m9hhay" targetRef="Event_1lai5qt" /> | <sequenceFlow id="Flow_1or7fxn" name="нет" sourceRef="Gateway_1m9hhay" targetRef="Event_1lai5qt" /> |
| <task id="Activity_1eay84c" name="Check quality and quantity"> | <task id="Activity_1eay84c" name="Проверить качество и количество"> |
| <incoming>Flow_0g7l5fa</incoming> | <incoming>Flow_0g7l5fa</incoming> |
| <outgoing>Flow_0xz7y35</outgoing> | <outgoing>Flow_0xz7y35</outgoing> |
| </task> | </task> |
| <sequenceFlow id="Flow_0g7l5fa" name="yes" sourceRef="Gateway_1gih9c0" targetRef="Activity_1eay84c" /> | <sequenceFlow id="Flow_0g7l5fa" name="да" sourceRef="Gateway_1gih9c0" targetRef="Activity_1eay84c" /> |
| <exclusiveGateway id="Gateway_1m9hhay" name="OK?"> | <exclusiveGateway id="Gateway_1m9hhay" name="В порядке?"> |
| <incoming>Flow_0xz7y35</incoming> | <incoming>Flow_0xz7y35</incoming> |
| <outgoing>Flow_1or7fxn</outgoing> | <outgoing>Flow_1or7fxn</outgoing> |
| </exclusiveGateway> | </exclusiveGateway> |
| <sequenceFlow id="Flow_0xz7y35" sourceRef="Activity_1eay84c" targetRef="Gateway_1m9hhay" /> | <sequenceFlow id="Flow_0xz7y35" sourceRef="Activity_1eay84c" targetRef="Gateway_1m9hhay" /> |
| <endEvent id="Event_1lai5qt" name="Goods not accepted"> | <endEvent id="Event_1lai5qt" name="Товар не принят"> |
| <incoming>Flow_1or7fxn</incoming> | <incoming>Flow_1or7fxn</incoming> |
| </endEvent> | </endEvent> |
| <sequenceFlow id="Flow_14lwxg3" name="no" sourceRef="Gateway_1gih9c0" targetRef="Event_1xx98wd" /> | <sequenceFlow id="Flow_14lwxg3" name="нет" sourceRef="Gateway_1gih9c0" targetRef="Event_1xx98wd" /> |
| <sequenceFlow id="Flow_1l6vlkb" name="yes" sourceRef="Gateway_1m9hhay" targetRef="Event_12lad3v" /> | <sequenceFlow id="Flow_1l6vlkb" name="да" sourceRef="Gateway_1m9hhay" targetRef="Event_12lad3v" /> |
| <endEvent id="Event_12lad3v" name="Gooods accepted"> | <endEvent id="Event_12lad3v" name="Товар принят"> |
| <incoming>Flow_1l6vlkb</incoming> | <incoming>Flow_1l6vlkb</incoming> |
| <messageEventDefinition id="MessageEventDefinition_0ypnf1d" /> | <messageEventDefinition id="MessageEventDefinition_0ypnf1d" /> |
| </endEvent> | </endEvent> |
| <task id="Activity_16ezjxr" name="Identify purchase"> | <task id="Activity_16ezjxr" name="Идентифицировать заказ"> |
| <incoming>Flow_0za1h4b</incoming> | <incoming>Flow_0za1h4b</incoming> |
| <outgoing>Flow_12cq0dp</outgoing> | <outgoing>Flow_12cq0dp</outgoing> |
| </dataInputAssociation> | </dataInputAssociation> |
| </task> | </task> |
| <exclusiveGateway id="Gateway_1gih9c0" name="Valid order found?"> | <exclusiveGateway id="Gateway_1gih9c0" name="Есть заказ на закупку?"> |
| <incoming>Flow_12cq0dp</incoming> | <incoming>Flow_12cq0dp</incoming> |
| <outgoing>Flow_0g7l5fa</outgoing> | <outgoing>Flow_0g7l5fa</outgoing> |
| <outgoing>Flow_14lwxg3</outgoing> | <outgoing>Flow_14lwxg3</outgoing> |
| </exclusiveGateway> | </exclusiveGateway> |
| <endEvent id="Event_1xx98wd" name="Wrong delivery"> | <endEvent id="Event_1xx98wd" name="Ошибочная доставка"> |
| <incoming>Flow_14lwxg3</incoming> | <incoming>Flow_14lwxg3</incoming> |
| </endEvent> | </endEvent> |
| <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="http://bpmn.io" exporterVersion="0.10.1"> | <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" id="sid-38422fae-e03e-43a3-bef4-bd33b32041b2" targetNamespace="http://bpmn.io/bpmn" exporter="http://bpmn.io" exporterVersion="0.10.1"> |
| <collaboration id="Collaboration_0g7t6mq"> | <collaboration id="Collaboration_0g7t6mq"> |
| <participant id="Participant_144acff" name="Procure to pay" processRef="Process_1" /> | <participant id="Participant_144acff" name="От потребности до закупки" processRef="Process_1" /> |
| <participant id="Participant_0pa16ys" name="Supplier" /> | <participant id="Participant_0pa16ys" name="Поставщик" /> |
| <messageFlow id="Flow_0sp4o62" name="Purchased goods" sourceRef="Participant_0pa16ys" targetRef="Event_1nu1su1" /> | <messageFlow id="Flow_0sp4o62" name="Доставленный товар" sourceRef="Participant_0pa16ys" targetRef="Event_1nu1su1" /> |
| </collaboration> | </collaboration> |
| <process id="Process_1" isExecutable="false"> | <process id="Process_1" isExecutable="false"> |
| <sequenceFlow id="Flow_0fqr94i" sourceRef="Event_1ng94pf" targetRef="Activity_0xko542" /> | <sequenceFlow id="Flow_0fqr94i" sourceRef="Event_1ng94pf" targetRef="Activity_0xko542" /> |
| <sequenceFlow id="Flow_1qzqmrm" sourceRef="Activity_0xko542" targetRef="Event_1nu1su1" /> | <sequenceFlow id="Flow_1qzqmrm" sourceRef="Activity_0xko542" targetRef="Event_1nu1su1" /> |
| <intermediateCatchEvent id="Event_1nu1su1" name="Goods delivered"> | <intermediateCatchEvent id="Event_1nu1su1" name="Товар доставлен"> |
| <incoming>Flow_1qzqmrm</incoming> | <incoming>Flow_1qzqmrm</incoming> |
| <outgoing>Flow_0mvecfq</outgoing> | <outgoing>Flow_0mvecfq</outgoing> |
| <outgoing>Flow_0fqr94i</outgoing> | <outgoing>Flow_0fqr94i</outgoing> |
| </startEvent> | </startEvent> |
| <task id="Activity_0b0ddht" name="Accept goods"> | <task id="Activity_0b0ddht" name="Принять товар"> |
| <incoming>Flow_0mvecfq</incoming> | <incoming>Flow_0mvecfq</incoming> |
| <outgoing>Flow_0o10xoz</outgoing> | <outgoing>Flow_0o10xoz</outgoing> |
| ===== Примечания ===== | ===== Примечания ===== |
| |
| * В приведенных примерах отсутствует таймер (процесс ждет доставки бесконечно) и другие подробности. | * Обратите внимание на задачу "Идентифицировать доставку" на диаграмме [[#как надо]]. Эта задача имеет место в реальности: когда на наш склад прибывает фура от поставщика, то первое, что делает наш сотрудник - проверяет сопроводительные документы и выясняет, заказывали ли мы этот груз (возможно, он доставлен по ошибке). Но на диаграмме [[#как не надо]] для этой задачи нет места! |
| * Два развернутых процесса на одной диаграмме [[#как надо]] в реальных моделях лучше не изображать, см. [[single_process]]. | * Еще одно преимущество схемы [[#как надо]] - она предусматривает возможность, что груз не был принят (например, из-за претензий по качеству и/или количеству) с первой попытке, но был благополучно принят при повторной доставке поставщиком. В этом случае просто будет два экземпляра процесса приемки груза на один экземпляр процесса закупки. |
| | * В приведенных примерах опущен таймер (процесс ждет доставки бесконечно) и другие подробности. |
| | * На диаграмме [[#как надо]] изображены два развернутых процесса. При моделировании реальных (а не учебных) процессов лучше изображать каждый процесс [[single_process|на отдельной диаграмме]]. |
| | * Для моделирования взаимодействия между процессами предпочтительнее использовать не событие-сообщение, а [[conditional_event_collaboration|событие-условие]]. |
| |
| ===== Исключения ===== | ===== Исключения ===== |
| |
| * Исключения из правила (если есть) | Процесс-обработчик может не потребоваться, если модель процесса является исполняемой, а внешний участник процесса - не человек, а робот (информационная система, веб-портал). |
| | Поток сообщений в этом случае моделирует вызов веб-сервиса. |
| |
| ===== Смотри также ===== | ===== Смотри также ===== |
| |
| * Ссылки на страницы со схожим контентом (опционально) | * [[single_process]] |
| | * [[conditional_event_collaboration]] |
| |
| ===== Автор(ы) ===== | ===== Автор(ы) ===== |
| |
| --- //[[user:bell|Anatoly Belaychuk]] 2024-08-27 17:17// | --- //[[user:bell|Anatoly Belaychuk]] 2024-08-27 17:17// |