bpxe.ex icon indicating copy to clipboard operation
bpxe.ex copied to clipboard

Problem: non-standard gateways

Open yrashk opened this issue 4 years ago • 0 comments

Currently, BPXE has two gateways that were designed to make implementation of the flow node operations forward-flowing (so there's no need to check for anything that happened prior to the current node to make decisions).

One is precedence gateway. It takes N inputs and N outputs and assuming a first token arrives at Input[k] (k <= N), it'll be sent to Output[k] and nothing else will happen thereafter (tokens arriving later will be discarded). It is used for event-based gateways to determine the winner of the race, should multiple events occur.

The other one is sensor gateway. It takes N+1 inputs and N+1 outputs, where N is the number of regular flows which are are mapped Input[k] => Output[k] and tokens are sent through as they come. Once a token arrives through N+1th flow, it's considered a signal of "completion" and N+1th output gets a new token with a payload that contains the list of flows that were fired before the completion flow signaled. This is used for inclusive gateways so that the joining ones can know which flows were successful at the preceding fork.

I am not 100% sure this is the best way going forward. I mean, for now this allowed me to implement the aforementioned gateways with simple flows (originally some of this required some really weird back-flows), but considering that these are not part of BPMN 2.0, should we try and get rid of them?

It's very likely going to take finding new mechanisms for achieving the functionality described above, which might or might not be beneficial.

yrashk avatar Jan 03 '21 18:01 yrashk