public void updateState(int state) {
		if( isValidStateToGo(state) ) {
			setState(state);
			
			switch (state) {
			case CREATED:
				setCreateTime(new Date());
			case RUNNING:
				setStartTime(new Date());
			case ENDED:
			case ENDED_CANCELLED:
			case ENDED_TIMEOUT:
				setEndTime(new Date());
			default:
			}		
		} else {
			InvalidStateException.throwWith(this, getState(), state);			
		}
	}