@SuppressWarnings("unchecked") public List<HistoricDetail> findHistoricDetailsByQueryCriteria(HistoricDetailQueryImpl historicVariableUpdateQuery, Page page) { configureQuery(historicVariableUpdateQuery); return getDbEntityManager().selectList("selectHistoricDetailsByQueryCriteria", historicVariableUpdateQuery, page); }
public void deleteHistoricDetailsByProcessInstanceIds(List<String> historicProcessInstanceIds) { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("processInstanceIds", historicProcessInstanceIds); deleteHistoricDetails(parameters); }
public Void execute(CommandContext commandContext) { Map<String, Object> formProperties = new HashMap<String, Object>(); formProperties.put("formProp1", "value1"); ProcessInstance processInstance = new SubmitStartFormCmd(processDefinitionId, null, formProperties).execute(commandContext); // two historic details should be in cache: one form property and one variable update commandContext.getHistoricDetailManager().deleteHistoricDetailsByProcessInstanceIds(Arrays.asList(processInstance.getId())); return null; } });
public void deleteHistoricCaseInstancesByIds(List<String> historicCaseInstanceIds) { if (isHistoryEnabled()) { getHistoricDetailManager().deleteHistoricDetailsByCaseInstanceIds(historicCaseInstanceIds); getHistoricVariableInstanceManager().deleteHistoricVariableInstancesByCaseInstanceIds(historicCaseInstanceIds); getHistoricCaseActivityInstanceManager().deleteHistoricCaseActivityInstancesByCaseInstanceIds(historicCaseInstanceIds); getHistoricTaskInstanceManager().deleteHistoricTaskInstancesByCaseInstanceIds(historicCaseInstanceIds); getDbEntityManager().delete(HistoricCaseInstanceEntity.class, "deleteHistoricCaseInstancesByIds", historicCaseInstanceIds); } }
public void deleteHistoricTaskInstancesByCaseInstanceIds(List<String> caseInstanceIds) { CommandContext commandContext = Context.getCommandContext(); getHistoricDetailManager() .deleteHistoricDetailsByTaskCaseInstanceIds(caseInstanceIds); commandContext .getCommentManager() .deleteCommentsByTaskCaseInstanceIds(caseInstanceIds); getAttachmentManager() .deleteAttachmentsByTaskCaseInstanceIds(caseInstanceIds); getHistoricIdentityLinkManager() .deleteHistoricIdentityLinksLogByTaskCaseInstanceIds(caseInstanceIds); getDbEntityManager().deletePreserveOrder(HistoricTaskInstanceEntity.class, "deleteHistoricTaskInstanceByCaseInstanceIds", caseInstanceIds); }
/** * Deletes all data related with tasks, which belongs to specified process instance ids. * @param processInstanceIds * @param deleteVariableInstances when true, will also delete variable instances. Can be false when variable instances were deleted separately. */ public void deleteHistoricTaskInstancesByProcessInstanceIds(List<String> processInstanceIds, boolean deleteVariableInstances) { CommandContext commandContext = Context.getCommandContext(); if (deleteVariableInstances) { getHistoricVariableInstanceManager().deleteHistoricVariableInstancesByTaskProcessInstanceIds(processInstanceIds); } getHistoricDetailManager() .deleteHistoricDetailsByTaskProcessInstanceIds(processInstanceIds); commandContext .getCommentManager() .deleteCommentsByTaskProcessInstanceIds(processInstanceIds); getAttachmentManager() .deleteAttachmentsByTaskProcessInstanceIds(processInstanceIds); getHistoricIdentityLinkManager() .deleteHistoricIdentityLinksLogByTaskProcessInstanceIds(processInstanceIds); getDbEntityManager().deletePreserveOrder(HistoricTaskInstanceEntity.class, "deleteHistoricTaskInstanceByProcessInstanceIds", processInstanceIds); }
public void deleteHistoricTaskInstanceById(final String taskId) { if (isHistoryEnabled()) { HistoricTaskInstanceEntity historicTaskInstance = findHistoricTaskInstanceById(taskId); if (historicTaskInstance != null) { CommandContext commandContext = Context.getCommandContext(); commandContext .getHistoricDetailManager() .deleteHistoricDetailsByTaskId(taskId); commandContext .getHistoricVariableInstanceManager() .deleteHistoricVariableInstancesByTaskId(taskId); commandContext .getCommentManager() .deleteCommentsByTaskId(taskId); commandContext .getAttachmentManager() .deleteAttachmentsByTaskId(taskId); commandContext .getHistoricIdentityLinkManager() .deleteHistoricIdentityLinksLogByTaskId(taskId); getDbEntityManager().delete(historicTaskInstance); } } }
.addRemovalTimeToDetailsByRootProcessInstanceId(rootProcessInstanceId, removalTime);
.deleteHistoricDetailsByRemovalTime(removalTime, minuteFrom, minuteTo, batchSize);
@Override public Void execute(CommandContext commandContext) { ensureNotEmpty(BadUserRequestException.class,"variableInstanceId", variableInstanceId); HistoricVariableInstanceEntity variable = commandContext.getHistoricVariableInstanceManager().findHistoricVariableInstanceByVariableInstanceId(variableInstanceId); ensureNotNull(NotFoundException.class, "No historic variable instance found with id: " + variableInstanceId, "variable", variable); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkDeleteHistoricVariableInstance(variable); } commandContext .getHistoricDetailManager() .deleteHistoricDetailsByVariableInstanceId(variableInstanceId); commandContext .getHistoricVariableInstanceManager() .deleteHistoricVariableInstanceByVariableInstanceId(variableInstanceId); return null; } }
@Override public Void execute(CommandContext commandContext) { ensureNotEmpty(BadUserRequestException.class,"processInstanceId", processInstanceId); HistoricProcessInstanceEntity instance = commandContext.getHistoricProcessInstanceManager().findHistoricProcessInstance(processInstanceId); ensureNotNull(NotFoundException.class, "No historic process instance found with id: " + processInstanceId, "instance", instance); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkDeleteHistoricVariableInstancesByProcessInstance(instance); } commandContext.getHistoricDetailManager().deleteHistoricDetailsByProcessInstanceIds(Arrays.asList(processInstanceId)); commandContext.getHistoricVariableInstanceManager().deleteHistoricVariableInstanceByProcessInstanceIds(Arrays.asList(processInstanceId)); return null; } }
public void deleteHistoricCaseInstancesByIds(List<String> historicCaseInstanceIds) { if (isHistoryEnabled()) { getHistoricDetailManager().deleteHistoricDetailsByCaseInstanceIds(historicCaseInstanceIds); getHistoricVariableInstanceManager().deleteHistoricVariableInstancesByCaseInstanceIds(historicCaseInstanceIds); getHistoricCaseActivityInstanceManager().deleteHistoricCaseActivityInstancesByCaseInstanceIds(historicCaseInstanceIds); getHistoricTaskInstanceManager().deleteHistoricTaskInstancesByCaseInstanceIds(historicCaseInstanceIds); getDbEntityManager().delete(HistoricCaseInstanceEntity.class, "deleteHistoricCaseInstancesByIds", historicCaseInstanceIds); } }
public void deleteHistoricTaskInstancesByCaseInstanceIds(List<String> caseInstanceIds) { CommandContext commandContext = Context.getCommandContext(); getHistoricDetailManager() .deleteHistoricDetailsByTaskCaseInstanceIds(caseInstanceIds); commandContext .getCommentManager() .deleteCommentsByTaskCaseInstanceIds(caseInstanceIds); getAttachmentManager() .deleteAttachmentsByTaskCaseInstanceIds(caseInstanceIds); getHistoricIdentityLinkManager() .deleteHistoricIdentityLinksLogByTaskCaseInstanceIds(caseInstanceIds); getDbEntityManager().deletePreserveOrder(HistoricTaskInstanceEntity.class, "deleteHistoricTaskInstanceByCaseInstanceIds", caseInstanceIds); }
/** * Deletes all data related with tasks, which belongs to specified process instance ids. * @param processInstanceIds * @param deleteVariableInstances when true, will also delete variable instances. Can be false when variable instances were deleted separately. */ public void deleteHistoricTaskInstancesByProcessInstanceIds(List<String> processInstanceIds, boolean deleteVariableInstances) { CommandContext commandContext = Context.getCommandContext(); if (deleteVariableInstances) { getHistoricVariableInstanceManager().deleteHistoricVariableInstancesByTaskProcessInstanceIds(processInstanceIds); } getHistoricDetailManager() .deleteHistoricDetailsByTaskProcessInstanceIds(processInstanceIds); commandContext .getCommentManager() .deleteCommentsByTaskProcessInstanceIds(processInstanceIds); getAttachmentManager() .deleteAttachmentsByTaskProcessInstanceIds(processInstanceIds); getHistoricIdentityLinkManager() .deleteHistoricIdentityLinksLogByTaskProcessInstanceIds(processInstanceIds); getDbEntityManager().deletePreserveOrder(HistoricTaskInstanceEntity.class, "deleteHistoricTaskInstanceByProcessInstanceIds", processInstanceIds); }
public void deleteHistoricTaskInstanceById(final String taskId) { if (isHistoryEnabled()) { HistoricTaskInstanceEntity historicTaskInstance = findHistoricTaskInstanceById(taskId); if (historicTaskInstance != null) { CommandContext commandContext = Context.getCommandContext(); commandContext .getHistoricDetailManager() .deleteHistoricDetailsByTaskId(taskId); commandContext .getHistoricVariableInstanceManager() .deleteHistoricVariableInstancesByTaskId(taskId); commandContext .getCommentManager() .deleteCommentsByTaskId(taskId); commandContext .getAttachmentManager() .deleteAttachmentsByTaskId(taskId); commandContext .getHistoricIdentityLinkManager() .deleteHistoricIdentityLinksLogByTaskId(taskId); getDbEntityManager().delete(historicTaskInstance); } } }
.addRemovalTimeToDetailsByRootProcessInstanceId(rootProcessInstanceId, removalTime);
.deleteHistoricDetailsByRemovalTime(removalTime, minuteFrom, minuteTo, batchSize);
@Override public Void execute(CommandContext commandContext) { ensureNotEmpty(BadUserRequestException.class,"variableInstanceId", variableInstanceId); HistoricVariableInstanceEntity variable = commandContext.getHistoricVariableInstanceManager().findHistoricVariableInstanceByVariableInstanceId(variableInstanceId); ensureNotNull(NotFoundException.class, "No historic variable instance found with id: " + variableInstanceId, "variable", variable); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkDeleteHistoricVariableInstance(variable); } commandContext .getHistoricDetailManager() .deleteHistoricDetailsByVariableInstanceId(variableInstanceId); commandContext .getHistoricVariableInstanceManager() .deleteHistoricVariableInstanceByVariableInstanceId(variableInstanceId); return null; } }
@SuppressWarnings("unchecked") public List<HistoricDetail> findHistoricDetailsByQueryCriteria(HistoricDetailQueryImpl historicVariableUpdateQuery, Page page) { configureQuery(historicVariableUpdateQuery); return getDbEntityManager().selectList("selectHistoricDetailsByQueryCriteria", historicVariableUpdateQuery, page); }
@Override public Void execute(CommandContext commandContext) { ensureNotEmpty(BadUserRequestException.class,"processInstanceId", processInstanceId); HistoricProcessInstanceEntity instance = commandContext.getHistoricProcessInstanceManager().findHistoricProcessInstance(processInstanceId); ensureNotNull(NotFoundException.class, "No historic process instance found with id: " + processInstanceId, "instance", instance); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkDeleteHistoricVariableInstancesByProcessInstance(instance); } commandContext.getHistoricDetailManager().deleteHistoricDetailsByProcessInstanceIds(Arrays.asList(processInstanceId)); commandContext.getHistoricVariableInstanceManager().deleteHistoricVariableInstanceByProcessInstanceIds(Arrays.asList(processInstanceId)); return null; } }