private void archiveFlowNodeInstance(final SFlowNodeInstance flowNodeInstance, final ArchiveService archiveService, final long archiveDate) throws SArchivingException { try { final SAFlowNodeInstance saFlowNodeInstance = getArchivedObject(flowNodeInstance); if (saFlowNodeInstance != null) { final ArchiveInsertRecord insertRecord = new ArchiveInsertRecord(saFlowNodeInstance); archiveService.recordInsert(archiveDate, insertRecord); } } catch (final SBonitaException e) { throw new SArchivingException(e); } }
private void archiveFlowNodeInstance(final SFlowNodeInstance flowNodeInstance, final ArchiveService archiveService, final long archiveDate) throws SArchivingException { try { final SAFlowNodeInstance saFlowNodeInstance = getArchivedObject(flowNodeInstance); if (saFlowNodeInstance != null) { final ArchiveInsertRecord insertRecord = new ArchiveInsertRecord(saFlowNodeInstance); archiveService.recordInsert(archiveDate, insertRecord); } } catch (final SBonitaException e) { throw new SArchivingException(e); } }
private void archiveProcessInstance(final SProcessInstance processInstance) throws SProcessInstanceModificationException { final SAProcessInstance saProcessInstance = BuilderFactory.get(SAProcessInstanceBuilderFactory.class).createNewInstance(processInstance).done(); final ArchiveInsertRecord insertRecord = new ArchiveInsertRecord(saProcessInstance); try { archiveService.recordInsert(System.currentTimeMillis(), insertRecord); } catch (final SRecorderException e) { throw new SProcessInstanceModificationException(e); } }
private void archiveProcessInstance(final SProcessInstance processInstance) throws SProcessInstanceModificationException { final SAProcessInstance saProcessInstance = BuilderFactory.get(SAProcessInstanceBuilderFactory.class).createNewInstance(processInstance).done(); final ArchiveInsertRecord insertRecord = new ArchiveInsertRecord(saProcessInstance); try { archiveService.recordInsert(System.currentTimeMillis(), insertRecord); } catch (final SRecorderException e) { throw new SProcessInstanceModificationException(e); } }
private void archiveProcessInstance(final SProcessDefinition processDefinition, final SProcessInstance processInstance, final SAProcessInstance saProcessInstance, final long archiveDate, final ArchiveService archiveService, final ProcessInstanceService processInstanceService, final TechnicalLoggerService logger) throws SArchivingException { try { final ArchiveInsertRecord insertRecord = new ArchiveInsertRecord(saProcessInstance); archiveService.recordInsert(archiveDate, insertRecord); if (logger.isLoggable(ProcessArchiver.class, TechnicalLogSeverity.DEBUG)) { final StringBuilder builder = new StringBuilder(); builder.append("Archiving " + processInstance.getClass().getSimpleName()); builder.append("with id = <" + processInstance.getId() + ">"); logger.log(ProcessArchiver.class, TechnicalLogSeverity.DEBUG, MessageFormat.format(" and state {2}", processInstance.getStateId())); } try { processInstanceService.deleteProcessInstance(processInstance.getId()); } catch (final SBonitaException e) { throw new SArchivingException("Unable to delete the process instance during the archiving.", e); } } catch (final SRecorderException e) { setExceptionContext(processDefinition, processInstance, e); throw new SArchivingException("Unable to archive the process instance.", e); } }
private void archiveDataInstance(final SDataInstance sDataInstance) throws SDataInstanceException { if (!sDataInstance.isTransientData()) { try { final SADataInstance saDataInstance = BuilderFactory.get(SADataInstanceBuilderFactory.class).createNewInstance(sDataInstance).done(); final ArchiveInsertRecord archiveInsertRecord = new ArchiveInsertRecord(saDataInstance); archiveService.recordInsert(System.currentTimeMillis(), archiveInsertRecord); } catch (final SRecorderException e) { logOnExceptionMethod("updateDataInstance", e); throw new SDataInstanceException("Unable to create SADataInstance", e); } } }
private void archiveProcessInstance(final SProcessDefinition processDefinition, final SProcessInstance processInstance, final SAProcessInstance saProcessInstance, final long archiveDate, final ArchiveService archiveService, final ProcessInstanceService processInstanceService, final TechnicalLoggerService logger) throws SArchivingException { try { final ArchiveInsertRecord insertRecord = new ArchiveInsertRecord(saProcessInstance); archiveService.recordInsert(archiveDate, insertRecord); if (logger.isLoggable(ProcessArchiver.class, TechnicalLogSeverity.DEBUG)) { final StringBuilder builder = new StringBuilder(); builder.append("Archiving " + processInstance.getClass().getSimpleName()); builder.append("with id = <" + processInstance.getId() + ">"); logger.log(ProcessArchiver.class, TechnicalLogSeverity.DEBUG, MessageFormat.format(" and state {2}", processInstance.getStateId())); } try { processInstanceService.deleteProcessInstance(processInstance.getId()); } catch (final SBonitaException e) { throw new SArchivingException("Unable to delete the process instance during the archiving.", e); } } catch (final SRecorderException e) { setExceptionContext(processDefinition, processInstance, e); throw new SArchivingException("Unable to archive the process instance.", e); } }
private void archiveDataInstance(final SDataInstance sDataInstance) throws SDataInstanceException { if (!sDataInstance.isTransientData()) { try { final SADataInstance saDataInstance = BuilderFactory.get(SADataInstanceBuilderFactory.class).createNewInstance(sDataInstance).done(); final ArchiveInsertRecord archiveInsertRecord = new ArchiveInsertRecord(saDataInstance); archiveService.recordInsert(System.currentTimeMillis(), archiveInsertRecord); } catch (final SRecorderException e) { logOnExceptionMethod("updateDataInstance", e); throw new SDataInstanceException("Unable to create SADataInstance", e); } } }
@Override public void archiveRefBusinessDataInstance(SRefBusinessDataInstance businessDataInstance) throws SObjectModificationException { try { final SARefBusinessDataInstance saRefBusinessDataInstance = BuilderFactory.get(SARefBusinessDataInstanceBuilderFactory.class) .createNewInstance(businessDataInstance).done(); final ArchiveInsertRecord archiveInsertRecord = new ArchiveInsertRecord(saRefBusinessDataInstance); archiveService.recordInsert(0L, archiveInsertRecord); // no archived date (nor sourceObjectId) in this table, as it is not necessary (archived only once at end of process execution) } catch (final SRecorderException e) { throw new SObjectModificationException("Unable to archive RefBusinessDataInstance", e); } }
@Override public void archiveRefBusinessDataInstance(SRefBusinessDataInstance businessDataInstance) throws SObjectModificationException { try { final SARefBusinessDataInstance saRefBusinessDataInstance = BuilderFactory.get(SARefBusinessDataInstanceBuilderFactory.class) .createNewInstance(businessDataInstance).done(); final ArchiveInsertRecord archiveInsertRecord = new ArchiveInsertRecord(saRefBusinessDataInstance); archiveService.recordInsert(0L, archiveInsertRecord); // no archived date (nor sourceObjectId) in this table, as it is not necessary (archived only once at end of process execution) } catch (final SRecorderException e) { throw new SObjectModificationException("Unable to archive RefBusinessDataInstance", e); } }
@Override public void archive(final long archiveDate, final SComment sComment) throws SObjectModificationException { final SAComment saComment = BuilderFactory.get(SACommentBuilderFactory.class).createNewInstance(sComment).done(); if (saComment != null) { final ArchiveInsertRecord insertRecord = new ArchiveInsertRecord(saComment); try { archiveService.recordInsert(archiveDate, insertRecord); } catch (final SRecorderException e) { throw new SObjectModificationException("Unable to archive the comment with id = <" + sComment.getId() + ">", e); } } }
@Override public void archive(final long archiveDate, final SComment sComment) throws SObjectModificationException { final SAComment saComment = BuilderFactory.get(SACommentBuilderFactory.class).createNewInstance(sComment).done(); if (saComment != null) { final ArchiveInsertRecord insertRecord = new ArchiveInsertRecord(saComment); try { archiveService.recordInsert(archiveDate, insertRecord); } catch (final SRecorderException e) { throw new SObjectModificationException("Unable to archive the comment with id = <" + sComment.getId() + ">", e); } } }
@Override public void archiveConnectorInstance(final SConnectorInstance connectorInstance, final long archiveDate) throws SConnectorInstanceCreationException { if (connectorInstance != null) { final SAConnectorInstance saConnectorInstance = BuilderFactory.get(SAConnectorInstanceBuilderFactory.class) .createNewArchivedConnectorInstance(connectorInstance).done(); final ArchiveInsertRecord insertRecord = new ArchiveInsertRecord(saConnectorInstance); try { archiveService.recordInsert(archiveDate, insertRecord); } catch (final SBonitaException e) { throw new SConnectorInstanceCreationException("Unable to archive the connectorInstance instance with id " + connectorInstance.getId(), e); } } }
@Override public void archiveConnectorInstance(final SConnectorInstance connectorInstance, final long archiveDate) throws SConnectorInstanceCreationException { if (connectorInstance != null) { final SAConnectorInstance saConnectorInstance = BuilderFactory.get(SAConnectorInstanceBuilderFactory.class) .createNewArchivedConnectorInstance(connectorInstance).done(); final ArchiveInsertRecord insertRecord = new ArchiveInsertRecord(saConnectorInstance); try { archiveService.recordInsert(archiveDate, insertRecord); } catch (final SBonitaException e) { throw new SConnectorInstanceCreationException("Unable to archive the connectorInstance instance with id " + connectorInstance.getId(), e); } } }
@Override public void archive(final SDocumentMapping docMapping, final long archiveDate) throws SObjectModificationException { if (archiveService.isArchivable(SDocumentMapping.class)) { final SADocumentMappingImpl saDocumentMapping = new SADocumentMappingImpl(docMapping.getDocumentId(), docMapping.getProcessInstanceId(), archiveDate, docMapping.getId(), docMapping.getName(), docMapping.getDescription(), docMapping.getVersion()); saDocumentMapping.setIndex(docMapping.getIndex()); final ArchiveInsertRecord insertRecord = new ArchiveInsertRecord(saDocumentMapping); try { archiveService.recordInsert(archiveDate, insertRecord); } catch (final SBonitaException e) { throw new SObjectModificationException("Unable to archive the document with id = <" + docMapping.getId() + ">", e); } } }
@Override public void archive(final SDocumentMapping docMapping, final long archiveDate) throws SObjectModificationException { if (archiveService.isArchivable(SDocumentMapping.class)) { final SADocumentMappingImpl saDocumentMapping = new SADocumentMappingImpl(docMapping.getDocumentId(), docMapping.getProcessInstanceId(), archiveDate, docMapping.getId(), docMapping.getName(), docMapping.getDescription(), docMapping.getVersion()); saDocumentMapping.setIndex(docMapping.getIndex()); final ArchiveInsertRecord insertRecord = new ArchiveInsertRecord(saDocumentMapping); try { archiveService.recordInsert(archiveDate, insertRecord); } catch (final SBonitaException e) { throw new SObjectModificationException("Unable to archive the document with id = <" + docMapping.getId() + ">", e); } } }