I'm modeling a process in BPMN and I have a doubt about this portion of the process.
Specifically I have a multiple instance pool and an another pool. When the first message from the multi instance pool is received by the actor "A", the activity C is performed and then the process must terminate. In any case after 3 days, the activity D is performed and then the process ends. Is the modeling correct? Or should I do differently?
M. Zschuckelt on
I understand your gateway in process A behaves like a parallel gateway and produces 1 token on each branch?
I understand that D will be performed 3 days after process instantiation, no matter if a message from an instance of B is received? Or do you intend to say that "must terminate" implies killing the token on the D branch? In this case your end event would have to be a "Terminate" end event.
Any further messages generated by an instance of B would be discarded, since they don't find the process A waiting at the Intermediate Receive Message Event.
if you have a Terminate end event and while C is being performed the timer event times out, D will be performed and it will become a race, if C or D finishes first and kills the other activity. You get a similar race condition, if while processing D a message arrives and activity C is started.
Without a terminate event the timer D would expire, but the message receive event will continue waiting for the first message. A simple end event consumes the process tokens as they arrive and the process ends with the consumption of the last token.
Here is an example how you might achieve what you want.
This is quite elegant, because the timer event directly kills the activity of waiting for messages and continues with D. No risk of C being started by an incoming message while processing D. And neither will the timer trigger after a message was received in time.