try { session.save(entry); tx.commit();
if (entry.getHistorySteps() == null) { ArrayList hSteps = new ArrayList(1); hSteps.add(hStep); entry.setHistorySteps(hSteps); } else { entry.getHistorySteps().add(hStep); }
	public void moveToHistory(Step step) throws StoreException	{		HibernateWorkflowEntry entry;		Transaction tx;		try		{			tx = session.beginTransaction();			entry = (HibernateWorkflowEntry) session.find("FROM entry IN CLASS " + HibernateWorkflowEntry.class.getName() + " WHERE entry.id = ?", new Long(step.getEntryId()), Hibernate.LONG).get(0);		}		catch (HibernateException he)		{			log.error("Looking for workflow entry " + step.getEntryId(), he);			throw new StoreException("Looking for workflow entry " + step.getEntryId(), he);		}		HibernateHistoryStep hStep = new HibernateHistoryStep((HibernateStep) step);		entry.getCurrentSteps().remove(step);		if (entry.getHistorySteps() == null)		{			ArrayList hSteps = new ArrayList(1);			hSteps.add(hStep);			entry.setHistorySteps(hSteps);		}		else		{			entry.getHistorySteps().add(hStep);		}		try		{			session.save(entry);			tx.commit();			//session.delete(step);			//session.save(hStep, new Long(hStep.getId()));		}		catch (HibernateException he)		{			log.error("Saving workflow entry " + entry.getId(), he);			throw new StoreException("Saving workflow entry " + entry.getId(), he);		}	}