/** * Checks if the gateway is a join gateway and if this gateway type is allowed in a generalized * flow pattern. * * @param gateway The gateway to check * @return True, if the gateway is an inclusive or parallel join gateway. False, otherwise. */ private boolean isJoinGateway(Gateway gateway) { if (gateway.getGatewayType().equals(Gateway.TYPE_AND) || gateway.getGatewayType().equals(Gateway.TYPE_OR)) { if (gateway.getTargetFor().size() > 1) { return true; } } return false; }
/** @return All join gateways that have an incoming transition from a fork gateway. */ private List<Gateway> getDirectJoinGateways() { List<Gateway> result = new ArrayList<Gateway>(); List<Gateway> joinGateways = getJoinGateways(true); for (Iterator<Gateway> it = joinGateways.iterator(); it.hasNext(); ) { Gateway gateway = it.next(); for (Iterator<Transition> itTrans = gateway.getTargetFor().iterator(); itTrans.hasNext(); ) { // check if source of one of the incoming transitions // is a fork gateway Transition trans = itTrans.next(); if ((trans.getSource() instanceof Gateway) && (isForkGateway((Gateway) trans.getSource()))) { result.add(gateway); } } } return result; }