private Object getState(BpelInstanceWorker worker, ProcessInstanceDAO instanceDAO) {
ExecutionQueueImpl state = (ExecutionQueueImpl) worker.getCachedState(instanceDAO.getExecutionStateCounter());
if (state != null) return state;
if (isInMemory()) {
ProcessInstanceDaoImpl inmem = (ProcessInstanceDaoImpl) instanceDAO;
if (inmem.getSoup() != null) {
state = (ExecutionQueueImpl) inmem.getSoup();
}
} else {
byte[] daoState = instanceDAO.getExecutionState();
if (daoState != null) {
state = new ExecutionQueueImpl(getClass().getClassLoader());