public void setCurrentState(CaseExecutionState currentState) {
   if (!isSuspending() && !isTerminating()) {
     // do not reset the previous state, if this case execution
     // is currently terminating or suspending. otherwise the
     // "real" previous state is lost.
     previousState = this.currentState;
   }
   this.currentState = currentState.getStateCode();
 }
 public void setCurrentState(CaseExecutionState currentState) {
   previousState = this.currentState;
   this.currentState = currentState.getStateCode();
 }