public Object execute(CommandContext commandContext) { ensureNotNull("taskId", taskId); HistoricTaskInstanceEntity task = commandContext.getHistoricTaskInstanceManager().findHistoricTaskInstanceById(taskId); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkDeleteHistoricTaskInstance(task); } commandContext .getHistoricTaskInstanceManager() .deleteHistoricTaskInstanceById(taskId); return null; }
public long findHistoricTaskInstanceCountByQueryCriteria(final HistoricTaskInstanceQueryImpl historicTaskInstanceQuery) { if (isHistoryEnabled()) { configureQuery(historicTaskInstanceQuery); return (Long) getDbEntityManager().selectOne("selectHistoricTaskInstanceCountByQueryCriteria",historicTaskInstanceQuery); } return 0; }
@Override public void performExecution(ActivityExecution execution) throws Exception { TaskEntity task = TaskEntity.createAndInsert(execution); taskDecorator.decorate(task, execution); Context.getCommandContext() .getHistoricTaskInstanceManager() .createHistoricTask(task); // All properties set, now firing 'create' event task.fireEvent(TaskListener.EVENTNAME_CREATE); }
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); } } }
commandContext .getHistoricTaskInstanceManager() .deleteHistoricTaskInstanceById(taskId); } else { commandContext .getHistoricTaskInstanceManager() .markTaskInstanceEnded(taskId, deleteReason); if (TaskEntity.DELETE_REASON_COMPLETED.equals(deleteReason)) { task.createHistoricTaskDetails(UserOperationLogEntry.OPERATION_TYPE_COMPLETE);
public Object execute(CommandContext commandContext) { commandContext.getHistoricTaskInstanceManager().deleteHistoricTaskInstanceById(taskId); commandContext.getHistoricIdentityLinkManager().deleteHistoricIdentityLinksLogByTaskId(taskId); return null; } });
public Void execute(CommandContext commandContext) { commandContext.getHistoricActivityInstanceManager() .deleteHistoricActivityInstancesByProcessInstanceIds(Collections.singletonList(processInstanceId)); commandContext.getHistoricTaskInstanceManager() .deleteHistoricTaskInstancesByProcessInstanceIds(Collections.singletonList(processInstanceId), true); List<HistoricJobLog> historicJobLogs = commandContext.getHistoricJobLogManager() .findHistoricJobLogsByQueryCriteria(new HistoricJobLogQueryImpl(), new Page(0, 100)); for (HistoricJobLog historicJobLog : historicJobLogs) { commandContext.getHistoricJobLogManager().deleteHistoricJobLogByJobId(historicJobLog.getJobId()); } return null; } });
public long executeCount(CommandContext commandContext, Map<String, Object> parameterMap) { return commandContext .getHistoricTaskInstanceManager() .findHistoricTaskInstanceCountByNativeQuery(parameterMap); }
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); } }
@Override public long executeCount(CommandContext commandContext) { ensureVariablesInitialized(); checkQueryOk(); return commandContext .getHistoricTaskInstanceManager() .findHistoricTaskInstanceCountByQueryCriteria(this); }
.addRemovalTimeToTaskInstancesByRootProcessInstanceId(rootProcessInstanceId, removalTime);
.deleteHistoricTaskInstancesByRemovalTime(removalTime, minuteFrom, minuteTo, batchSize);
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); } } }
commandContext .getHistoricTaskInstanceManager() .deleteHistoricTaskInstanceById(taskId); } else { commandContext .getHistoricTaskInstanceManager() .markTaskInstanceEnded(taskId, deleteReason); if (TaskEntity.DELETE_REASON_COMPLETED.equals(deleteReason)) { task.createHistoricTaskDetails(UserOperationLogEntry.OPERATION_TYPE_COMPLETE);
protected void deleteTask(String taskId, CommandContext commandContext) { TaskManager taskManager = commandContext.getTaskManager(); TaskEntity task = taskManager.findTaskById(taskId); if (task != null) { if(task.getExecutionId() != null) { throw new ProcessEngineException("The task cannot be deleted because is part of a running process"); } else if (task.getCaseExecutionId() != null) { throw new ProcessEngineException("The task cannot be deleted because is part of a running case instance"); } checkDeleteTask(task, commandContext); String reason = (deleteReason == null || deleteReason.length() == 0) ? TaskEntity.DELETE_REASON_DELETED : deleteReason; task.delete(reason, cascade); } else if (cascade) { Context .getCommandContext() .getHistoricTaskInstanceManager() .deleteHistoricTaskInstanceById(taskId); } }
public void deleteHistoricProcessInstanceByIds(List<String> processInstanceIds) { CommandContext commandContext = Context.getCommandContext(); commandContext.getHistoricDetailManager().deleteHistoricDetailsByProcessInstanceIds(processInstanceIds); commandContext.getHistoricVariableInstanceManager().deleteHistoricVariableInstanceByProcessInstanceIds(processInstanceIds); commandContext.getCommentManager().deleteCommentsByProcessInstanceIds(processInstanceIds); commandContext.getAttachmentManager().deleteAttachmentsByProcessInstanceIds(processInstanceIds); commandContext.getHistoricTaskInstanceManager().deleteHistoricTaskInstancesByProcessInstanceIds(processInstanceIds, false); commandContext.getHistoricActivityInstanceManager().deleteHistoricActivityInstancesByProcessInstanceIds(processInstanceIds); commandContext.getHistoricIncidentManager().deleteHistoricIncidentsByProcessInstanceIds(processInstanceIds); commandContext.getHistoricJobLogManager().deleteHistoricJobLogsByProcessInstanceIds(processInstanceIds); commandContext.getHistoricExternalTaskLogManager().deleteHistoricExternalTaskLogsByProcessInstanceIds(processInstanceIds); commandContext.getDbEntityManager().deletePreserveOrder(HistoricProcessInstanceEntity.class, "deleteHistoricProcessInstances", processInstanceIds); }
public long executeCount(CommandContext commandContext, Map<String, Object> parameterMap) { return commandContext .getHistoricTaskInstanceManager() .findHistoricTaskInstanceCountByNativeQuery(parameterMap); }
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); } }
@Override public long executeCount(CommandContext commandContext) { ensureVariablesInitialized(); checkQueryOk(); return commandContext .getHistoricTaskInstanceManager() .findHistoricTaskInstanceCountByQueryCriteria(this); }
.addRemovalTimeToTaskInstancesByRootProcessInstanceId(rootProcessInstanceId, removalTime);