audit(request, entity, type, "SUSPEND");
Entity entityObj = EntityUtil.getEntity(type, entity);
if (getWorkflowEngine().isActive(entityObj))
getWorkflowEngine().suspend(entityObj);
else
throw new IvoryException(entity + "(" + type + ") is not scheduled");
return new APIResult(APIResult.Status.SUCCEEDED, entity + "(" + type + ") suspended successfully");
} catch (Throwable e) {
LOG.error("Unable to suspend entity", e);
throw IvoryWebException.newException(e, Response.Status.BAD_REQUEST);
}