@Test public void deleteWorkflowsWithActionsFromMainTablesWorks() { List<Long> workflowIds = new ArrayList<>(); List<Long> actionIds = new ArrayList<>(); storeActions(storeActiveWorkflow(archiveTime1), 3); storeActions(storeActiveWorkflow(prodTime1), 1); storeActions(storePassiveWorkflow(prodTime1), 2); long archivable1 = storePassiveWorkflow(archiveTime1); long archivable2 = storePassiveWorkflow(archiveTime2); actionIds.addAll(storeActions(archivable1, 1)); actionIds.addAll(storeActions(archivable2, 3)); workflowIds.addAll(asList(archivable1, archivable2)); int actionCountBefore = getActiveActionCount(); assertEquals(workflowIds.size(), maintenanceDao.deleteWorkflows(MAIN, workflowIds)); int actionCountAfter = getActiveActionCount(); assertActiveWorkflowsRemoved(workflowIds); assertArchivedWorkflowsDoNotExist(workflowIds); assertActiveActionsRemoved(actionIds); assertArchiveActionsExist(actionIds, false); assertEquals(0, getArchiveActionCount()); assertEquals(actionCountAfter, actionCountBefore - actionIds.size()); }
@Transactional public int deleteWorkflows(TablePrefix table, Collection<Long> workflowIds) { String workflowIdParams = params(workflowIds); return deleteWorkflows(table, workflowIdParams); }
MaintenanceDao { @Transactional public int deleteWorkflows(TablePrefix table, Collection<Long> workflowIds) { String workflowIdParams = params(workflowIds); return deleteWorkflows(table, workflowIdParams); } }
MaintenanceDao { @Transactional public int deleteWorkflows(TablePrefix table, Collection<Long> workflowIds) { String workflowIdParams = params(workflowIds); return deleteWorkflows(table, workflowIdParams); } @Inject  MaintenanceDao(SQLVariants sqlVariants, @NFlow JdbcTemplate jdbcTemplate,
      @NFlow NamedParameterJdbcTemplate nflowNamedParameterJdbcTemplate); }
MaintenanceDao { @Transactional public int deleteWorkflows(TablePrefix table, Collection<Long> workflowIds) { String workflowIdParams = params(workflowIds); return deleteWorkflows(table, workflowIdParams); } @Inject  MaintenanceDao(SQLVariants sqlVariants, @NFlow JdbcTemplate jdbcTemplate,
      @NFlow NamedParameterJdbcTemplate nflowNamedParameterJdbcTemplate); List<Long> getOldWorkflowIds(TablePrefix table, DateTime before, int maxWorkflows, Set<String> workflowTypes); @Transactional int archiveWorkflows(Collection<Long> workflowIds); @Transactional int deleteWorkflows(TablePrefix table, Collection<Long> workflowIds); @Transactional void deleteActionAndStateHistory(long workflowInstanceId, DateTime olderThan); }
MaintenanceDao { @Transactional public int deleteWorkflows(TablePrefix table, Collection<Long> workflowIds) { String workflowIdParams = params(workflowIds); return deleteWorkflows(table, workflowIdParams); } @Inject  MaintenanceDao(SQLVariants sqlVariants, @NFlow JdbcTemplate jdbcTemplate,
      @NFlow NamedParameterJdbcTemplate nflowNamedParameterJdbcTemplate); List<Long> getOldWorkflowIds(TablePrefix table, DateTime before, int maxWorkflows, Set<String> workflowTypes); @Transactional int archiveWorkflows(Collection<Long> workflowIds); @Transactional int deleteWorkflows(TablePrefix table, Collection<Long> workflowIds); @Transactional void deleteActionAndStateHistory(long workflowInstanceId, DateTime olderThan);  }