* @throws Exception
*
* @return the saved status entity object
*/
public MetadataStatus setStatusExt(ServiceContext context, int id, int status, ISODate changeDate, String changeMessage) throws Exception {
final StatusValueRepository statusValueRepository = _applicationContext.getBean(StatusValueRepository.class);
MetadataStatus metatatStatus = new MetadataStatus();
metatatStatus.setChangeMessage(changeMessage);
metatatStatus.setStatusValue(statusValueRepository.findOne(status));
int userId = context.getUserSession().getUserIdAsInt();
MetadataStatusId mdStatusId = new MetadataStatusId()
.setStatusId(status)
.setMetadataId(id)
.setChangeDate(changeDate)