/** * @see org.openmrs.api.FormService#purgeForm(org.openmrs.Form) */ @Override public void purgeForm(Form form) throws APIException { checkIfFormsAreLocked(); Context.getFormService().purgeForm(form, false); }
/** * @see FormService#purgeForm(Form) * @throws FormsLockedException */ @Test(expected = FormsLockedException.class) public void purgeForm_shouldThrowAnErrorWhenTryingToDeleteFormWhileFormsAreLocked() { FormService fs = Context.getFormService(); createFormsLockedGPAndSetValue("true"); Form form = fs.getForm(1); fs.purgeForm(form); }
/** * @see FormService#purgeForm(Form) */ @Test public void purgeForm_shouldDeleteGivenFormSuccessfully() { FormService fs = Context.getFormService(); createFormsLockedGPAndSetValue("false"); Form form = fs.getForm(1); fs.purgeForm(form); assertNull(fs.getForm(1)); }
/** * @see org.openmrs.module.webservices.rest.web.resource.impl.BaseDelegatingResource#purge(java.lang.Object, * org.openmrs.module.webservices.rest.web.RequestContext) */ @Override public void purge(Form delegate, RequestContext context) throws ResponseException { if (delegate == null) return; Context.getFormService().purgeForm(delegate); }
Context.getFormService().purgeForm(form);
formService.purgeForm(form2);