I have following BPM diagram.
During testing I was suprissed that when process enter in timer wait state and event wait state and for example message event occurs then process go to the “mark customer” but timer dosen’t cancel, it still works (wait 5 days) which is strange because exclusive gateway should cancel unfinished paths. Of course the same behaviour when timer event occurs first. If I’m thinking wrong so how to model this situation
The parallel gateway will create two, parallel executions. Both remain active unless cancelled. The exclusive gateway does not cancel unfinished paths when joining. It simply allows “either” path to continue through with this model. That means potentially you will have two instances of the user task. Only if the user task mark customer is completed before the second event occurs, will the original one be canceled because you have a terminate end event.
I made the assumption that what you want is that whether the offer is accepted or the 5 days expire, you create a single instance of the task mark customer to handle it. The other events should then now longer be able to occur. If that’s what you intend, either one of these alternatives could work:
Practically, these work the same way. Semantically, the top one with the event based gateway equates the occurrence of the two events, whereas the bottom one models the acceptance as the happy flow and the timeout as an exception. In both models, you could remove the implicit merge by the mark customer task by placing an exclusive gateway just before it. That is mainly down to taste.