====== Use a dedicated process to catch the event initiated by external participant ======
{{tag>process collaboration}}
When an event initiated by external participant occurs (e.g. ordered goods are delivered by supplier), it isn't tied to the context (specific purchase order) yet.
It means it's impossible to process such event withing a running instance of a process (we have more than one purchase order awaiting delivery).
Therefore it should be processed by a dedicated event process (not to be confused with event subprocess).
===== ✔ How to =====
Flow_0fqr94i
Flow_1qzqmrm
DataStoreReference_0ptgekw
Flow_1qzqmrm
Flow_0mvecfq
Flow_0fqr94i
Flow_0mvecfq
Flow_1uu5pmf
Flow_1uu5pmf
Flow_0za1h4b
Flow_0g7l5fa
Flow_0xz7y35
Flow_0xz7y35
Flow_1or7fxn
Flow_1l6vlkb
Flow_1or7fxn
Flow_1l6vlkb
Flow_0za1h4b
Flow_12cq0dp
DataStoreReference_0ptgekw
Property_1tojodc
Flow_12cq0dp
Flow_0g7l5fa
Flow_14lwxg3
Flow_14lwxg3
===== ✘ How NOT to =====
Flow_0fqr94i
Flow_1qzqmrm
Flow_1qzqmrm
Flow_0mvecfq
Flow_0fqr94i
Flow_0mvecfq
Flow_0o10xoz
Flow_0o10xoz
Flow_1uu5pmf
Flow_1uu5pmf
===== Notes =====
* Please pay attention to the "Identify purchase" task at the [[#how to]] diagram. This task does exist in reality: when goods from a supplier arrives at our warehouse, the first thing our supervisor does is check the accompanying documents to find out whether we ordered this (it may have been delivered by mistake). But there is no room for this task at the [[#how not to]] diagram!
* Another advantage of the [[#how to]] diagram is that it covers the possibility for goods not to be accepted (for example, due to quality and/or quantity issues) on the first attempt, but be accepted upon re-delivery. In this case, there will simply be two instances of the goods acceptance process for one instance of the purchasing process.
* The examples presented omit the timer (the process waits for delivery indefinitely) and other details.
* The [[#how to]] diagram depicts two expanded processes. When modeling real (not educational) processes, it is recommended to expand each process [[single_process|on a separate diagram]].
* Better use [[conditional_evingent_collaboration|conditional event]] instead of messages to model collaboration.
===== Exceptions =====
The event process may be redundand if the process model is executable and the external participant is not a human being but a robot (automated system, web portal).
In this case the message flow would model a web service call.
===== See also =====
* [[single_process]]
* [[conditional_event_collaboration]]
===== Author(s) =====
--- //[[user:bell|Anatoly Belaychuk]] 2024-08-28 15:35//