private ArchiveInsertRecord[] buildArchiveProcessRecords(final List<SProcessContractData> processContractData) { final ArchiveInsertRecord[] records = new ArchiveInsertRecord[processContractData.size()]; int i = 0; for (final SProcessContractData data : processContractData) { if (data != null) { final SAProcessContractData aData = new SAProcessContractData(data); records[i] = new ArchiveInsertRecord(aData); i++; } } return records; }
/** * @param records * @return */ protected List<ArchivedPersistentObject> createArchivedObjectsList(final ArchiveInsertRecord... records) { final List<ArchivedPersistentObject> archivedObjects = new ArrayList<>(); for (final ArchiveInsertRecord record : records) { if (record != null) { archivedObjects.add(record.getEntity()); } } return archivedObjects; }
private ArchiveInsertRecord[] buildArchiveProcessRecords(final List<SProcessContractData> processContractData) { final ArchiveInsertRecord[] records = new ArchiveInsertRecord[processContractData.size()]; int i = 0; for (final SProcessContractData data : processContractData) { if (data != null) { final SAProcessContractData aData = new SAProcessContractData(data); records[i] = new ArchiveInsertRecord(aData); i++; } } return records; }
/** * @param records * @return */ protected List<ArchivedPersistentObject> createArchivedObjectsList(final ArchiveInsertRecord... records) { final List<ArchivedPersistentObject> archivedObjects = new ArrayList<>(); for (final ArchiveInsertRecord record : records) { if (record != null) { archivedObjects.add(record.getEntity()); } } return archivedObjects; }
private ArchiveInsertRecord[] buildArchiveUserTaskRecords(final List<STaskContractData> taskContractData) { final ArchiveInsertRecord[] records = new ArchiveInsertRecord[taskContractData.size()]; int i = 0; for (final STaskContractData data : taskContractData) { if (data != null) { final SATaskContractData aData = new SATaskContractData(data); records[i] = new ArchiveInsertRecord(aData); i++; } } return records; }
private void assignArchiveDate(final long time, final ArchiveInsertRecord... records) throws SRecorderException { for (final ArchiveInsertRecord record : records) { if (record != null) { setArchiveDate(record.getEntity(), time); } } }
private ArchiveInsertRecord[] buildArchiveUserTaskRecords(final List<STaskContractData> taskContractData) { final ArchiveInsertRecord[] records = new ArchiveInsertRecord[taskContractData.size()]; int i = 0; for (final STaskContractData data : taskContractData) { if (data != null) { final SATaskContractData aData = new SATaskContractData(data); records[i] = new ArchiveInsertRecord(aData); i++; } } return records; }
private void assignArchiveDate(final long time, final ArchiveInsertRecord... records) throws SRecorderException { for (final ArchiveInsertRecord record : records) { if (record != null) { setArchiveDate(record.getEntity(), time); } } }
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); } }
@Override public void recordInsert(final long time, final ArchiveInsertRecord record) throws SRecorderException { if (isArchivable(record.getEntity().getPersistentObjectInterface())) { recordInserts(time, record); } }
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); } }
@Override public void recordInsert(final long time, final ArchiveInsertRecord record) throws SRecorderException { if (isArchivable(record.getEntity().getPersistentObjectInterface())) { recordInserts(time, record); } }
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); } }