cancel
Showing results for 
Search instead for 
Did you mean: 

Inclusive Gateway Support?

tidetom
Champ in-the-making
Champ in-the-making
Hello,

I was wondering if anyone has an idea of when the Inclusive Gateway will be available for use in Activiti?  Currently we can use a Parallel Gateway, however any conditionExpressions placed on outgoing sequenceFlows from the Parallel Gateway are not evaluated.  This forces us to put an Exclusive Gateway after our Parallel Gateway in order for the expressions to get evaluated properly. 

While this may seem like a worthy workaround, when you have any more than a couple possible output paths, this process becomes tedious, and more importantly takes away one of the main reasons we love Activiti so much – it's ability to give us visibility into our business processes – because the processes get very cluttered with a mess of exclusive gateways. (note, it is not uncommon for us to have 15-20 possible conditional paths out of a gateway, thus the cluttering).

If anyone could answer regarding a timeframe for inclusive gateway support, or if there's a different workaround that I'm not considering, please let me know.  I'd love to be able to clean up our process flows and switch over to an inclusive gateway.

Thanks,
Tom
23 REPLIES 23

trademak
Star Contributor
Star Contributor
Hi Tom,

The current implementation of the inclusive gateway is only valid when there's one incoming sequence flow (one process token).
When there are multiple process tokens the current implementation is not sufficient.
The InclusiveGatewayTest method testMergingInclusiveGateway could be a first start to get it right.
There should be only one user task there in stead of 3.

The ParallelGatewayActivityBehavior contains logic in the execute method that could help you to get started.
Instead of comparing the outcome of the findInactiveConcurrentExecutions() method with the execution.getActivity().getIncomingTransitions().size() the inclusive gateway should have some more complex logic.

The findInactiveConcurrentExecutions() method in the ExecutionImpl class is a good start. For every execution in getParent().getExecutions() the activity should be equal to the inclusive gateway activity. If this is false, the inclusive gateway should not be executed. If it's true it can be executed.

Let me know what you think about this.

Best regards,

trademak
Star Contributor
Star Contributor
Hi,

I've implemented the logic based on my previous post.
So now the InclusiveGateway also checks if all incoming sequence flows with a proces token have finished.

Best regards,

tidetom
Champ in-the-making
Champ in-the-making
Hi Tijs,

Thanks so much for finishing this off.  I haven't had a chance to check the code yet, but I'm looking forward to seeing it.  Sorry I couldn't be of more help on the incoming token piece … things have gotten busy the past couple of weeks.

Thanks again,
Tom

trademak
Star Contributor
Star Contributor
Hi Tom,

No problem, thanks to you the inclusive gateway is included in Activiti.
We also implemented another complex scenario for the inclusive gateway where you can have multiple process tokens and not every process token reaching the inclusive gateway.
So I think we're pretty solid in the implementation now.
Today I'll add the documentation for the inclusive gateway.

Best regards,