public static FlowResult processDeleteVersions(Context context, int itemId, String[] versionIDs) throws SQLException, AuthorizeException, IOException, UIException {
FlowResult result = new FlowResult();
try {
result.setContinue(false);
VersioningService versioningService = new DSpace().getSingletonService(VersioningService.class);
VersionHistory versionHistory = versioningService.findVersionHistory(context, itemId);
for (String id : versionIDs) {
versioningService.removeVersion(context, Integer.parseInt(id));
}
context.commit();
//Retrieve the latest version of our history (IF any is even present)
Version latestVersion = versionHistory.getLatestVersion();