workflow.getModel().setCurrentState( stateModel );  getWorkflowModelDao().save( workflow.getModel() );
    private void enterState(Date now,                             Workflow workflow,                             State state)    {        StateModel stateModel = new StateModel();        stateModel.setName( state.getName() );        stateModel.setEnteredDate( now );        stateModel.setWorkflow( workflow.getModel() );        getStateModelDao().save( stateModel );                Action action = state.getAction();        if ( action != null )        {            try            {                action.execute( workflow,                                null );            }            catch (Exception e)            {                e.printStackTrace();            }        }        if ( state.getTransitions().isEmpty() )        {            exitState( now,                       workflow );        }    }