public void deleteReservation(String id, String componentId) { Connection con = initCon(); try { deleteIndex(id, "Reservation", componentId); // delete attached file AttachmentController.deleteAttachmentByCustomerPK(new ForeignPK(id, componentId)); ResourcesManagerDAO.deleteReservation(con, id); } catch (Exception e) { throw new ResourcesManagerRuntimeException( "ResourcesManagerBmEJB.deleteReservation()", SilverpeasRuntimeException.ERROR, "resourcesManager.EX_DELETE_RESERVATION", e); } finally { fermerCon(con); } }
public void removeProcessInstanceData(ProcessInstance instance) throws WorkflowException { SilverTrace.info( "worflowEngine", "ProcessInstanceManagerImpl.removeProcessInstanceData()", "root.MSG_GEN_ENTER_METHOD"); ForeignPK foreignPK = new ForeignPK(instance.getInstanceId(), instance.getModelId()); // delete attachments SilverTrace.info( "worflowEngine", "ProcessInstanceManagerImpl.removeProcessInstanceData()", "root.MSG_GEN_PARAM_VALUE", "Delete attachments foreignPK = " + foreignPK); AttachmentController.deleteAttachmentByCustomerPK(foreignPK); // delete versioning SilverTrace.info( "worflowEngine", "ProcessInstanceManagerImpl.removeProcessInstanceData()", "root.MSG_GEN_PARAM_VALUE", "Delete versiong foreignPK = " + foreignPK); try { getVersioningBm().deleteDocumentsByForeignPK(foreignPK); } catch (Exception e) { throw new WorkflowException( "ProcessInstanceManagerImpl.removeProcessInstanceData", "EX_ERR_CANT_REMOVE_VERSIONNING_FILES", e); } // delete folder SilverTrace.info( "worflowEngine", "ProcessInstanceManagerImpl.removeProcessInstanceData()", "root.MSG_GEN_PARAM_VALUE", "Delete folder"); try { RecordSet folderRecordSet = instance.getProcessModel().getFolderRecordSet(); folderRecordSet.delete(instance.getFolder()); } catch (FormException e) { throw new WorkflowException( "ProcessInstanceManagerImpl.removeProcessInstanceData", "EX_ERR_CANT_REMOVE_FOLDER", e); } // delete history steps SilverTrace.info( "worflowEngine", "ProcessInstanceManagerImpl.removeProcessInstanceData()", "root.MSG_GEN_PARAM_VALUE", "Delete history steps"); HistoryStep[] steps = instance.getHistorySteps(); for (int i = 0; steps != null && i < steps.length; i++) { if (!steps[i].getAction().equals("#question#") && !steps[i].getAction().equals("#response#")) steps[i].deleteActionRecord(); } // delete associated todos SilverTrace.info( "worflowEngine", "ProcessInstanceManagerImpl.removeProcessInstanceData()", "root.MSG_GEN_PARAM_VALUE", "Delete associated todos"); TodoBackboneAccess tbba = new TodoBackboneAccess(); tbba.removeEntriesFromExternal("useless", foreignPK.getInstanceId(), foreignPK.getId() + "##%"); SilverTrace.info( "worflowEngine", "ProcessInstanceManagerImpl.removeProcessInstanceData()", "root.MSG_GEN_EXIT_METHOD"); }