Unfortunately I can't upload a diagram picture here so I'll have to explain my problem.
A start event is connected to a timer and a user-task. Both the timer and the user-task are connected to an exclusive gateway. The exclusive gateway is connected to an end event too.
My understanding is that the exclusive gateway should only allow either the flow from the timer or the user-task, not both which is what I am experiencing in Activiti.
Can someone please clarify what is really supposed to happen in such a model.
If you have two outgoing sequential flows to the timer and the user task, you've effectively creating TWO parallel executions in the process instance. The exclusive gateway does not merge any parallel paths, that's what other gateways are for.
When the execution arrives in the exclusive gateway, it will just make that execution pass through the right outgoing flow.
My boss thought that only one 'done' user task would be created. In fact there are two that are created. We wanted the timer task to stop if the 'user task' completed before the timer expired. Clearly this doesn't happen - it just keeps running and creates another 'done' task after it expires.
Yep, we were figured out that we needed a timer boundary event on the user-task. The ability to put a timer boundary event on a sub-process is something that I haven't tried until now. Thanks for mentioning it.
P.S. I thought a chicken avatar would be funny. *lol*