Skip to content

Commit

Permalink
fix: correctly join
Browse files Browse the repository at this point in the history
  • Loading branch information
barmac committed Nov 20, 2023
1 parent 1d3bc34 commit a7e4b20
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions lib/simulator/behaviors/InclusiveGatewayBehavior.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ InclusiveGatewayBehavior.prototype.enter = function(context) {
element
} = context;

if (this._isGuaranteedToJoin(context)) {
return this._join(context);
}

const {
parent: parentScope
} = scope;
Expand Down Expand Up @@ -73,17 +69,6 @@ InclusiveGatewayBehavior.prototype.exit = function(context) {
}
};

/**
* Number of tokens waiting at the gateway cannot be higher than the number of incoming flows.
*/
InclusiveGatewayBehavior.prototype._isGuaranteedToJoin = function(context) {
const elementScopes = this._getElementScopes(context);

const incomingSequenceFlows = filterSequenceFlows(context.element.incoming);

return elementScopes.length >= incomingSequenceFlows.length;
};

InclusiveGatewayBehavior.prototype._join = function(context) {
const elementScopes = this._getElementScopes(context);

Expand All @@ -102,11 +87,11 @@ InclusiveGatewayBehavior.prototype._join = function(context) {
InclusiveGatewayBehavior.prototype._getElementScopes = function(context) {
const {
element,
parent
scope
} = context;

return this._simulator.findScopes({
parent,
parent: scope.parent,
element
});
};
Expand Down

0 comments on commit a7e4b20

Please sign in to comment.