Modeling asynchonous catch message with timeout
I have a business case in which my process is calling a backend system and then is waiting during a certain time for an asynchonous message/event coming from that system.
My concern is how do I model this timeout on the catch message task.
I first thought to a service task sending the message, then a parallel gateway with 2 branches connected to a timer for timeout, and message catch task, and then an exclusive join to process the first task to finish.
But it's a bad design to have a parallel gateway with an exclusive join gateway, because what will happen if the catch message task finishes after the timeout ?
I imagine that it is a common pattern, but I cannot figure out how to model it.
Can you provide me with advices ?
Thanks in advance
You are correct, using a parallel gateway will not solve your issue.
There is no solution using Bonita based on a Catch Message. Because in Bonita, messages do not expire. imagine you wait for a catch message, and you go out the task due to the timeout: when the sender finally sends the message, there is no more any listener, and the message will stay forever.
You should use a Human task (then you can use a timer event) and do not send a message, but search the task and execute it. If you can't find the task, that's mean the timeout was fired.
This is the way we integrate a "timeout receive message".
Hope this help,