/** @return The first join gateway found, that has another join gateway as successor. */ private Gateway getSequentialJoinGateways() { List<Gateway> joinGateways = getJoinGateways(false); for (Iterator<Gateway> it = joinGateways.iterator(); it.hasNext(); ) { Gateway gateway = it.next(); Activity successor = gateway.getSuccessor(); if ((successor instanceof Gateway) && (isJoinGateway((Gateway) gateway.getSuccessor()))) { return gateway; } } return null; }