@Override
	public void removeSubProcess(ProductType productType, SubProcess subProcess) {
		productType.removeSubProcess(subProcess);
		tx.begin();
		for (Stock s : subProcess.getStocks()) {
			subProcess.removeStock(s);
		}
		TypedQuery<State> q = em.createQuery(
				"SELECT s FROM states s WHERE s.subProcess=:sp", State.class);
		q.setParameter("sp", subProcess);
		List<State> states = q.getResultList();
		for (State state : states) {
			em.remove(state);
		}
		em.merge(subProcess);
		em.remove(subProcess);
		tx.commit();
	}