protected void ensureExecutionInitialized() { if (execution == null && executionId != null) { execution = Context .getCommandContext() .getExecutionManager() .findExecutionById(executionId); } }
public void updateExecutionSuspensionStateByProcessDefinitionId(String processDefinitionId, SuspensionState suspensionState) { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("processDefinitionId", processDefinitionId); parameters.put("suspensionState", suspensionState.getStateCode()); getDbEntityManager().update(ExecutionEntity.class, "updateExecutionSuspensionStateByParameters", configureParameterizedQuery(parameters)); }
@SuppressWarnings("unchecked") public List<String> findProcessInstancesIdsByQueryCriteria(ProcessInstanceQueryImpl processInstanceQuery) { configureQuery(processInstanceQuery); return getDbEntityManager().selectList("selectProcessInstanceIdsByQueryCriteria", processInstanceQuery); }
public void insertExecution(ExecutionEntity execution) { getDbEntityManager().insert(execution); createDefaultAuthorizations(execution); }
@SuppressWarnings("unchecked") public void deleteProcessInstancesByProcessDefinition(String processDefinitionId, String deleteReason, boolean cascade, boolean skipCustomListeners, boolean skipIoMappings) { List<String> processInstanceIds = getDbEntityManager() .selectList("selectProcessInstanceIdsByProcessDefinitionId", processDefinitionId); for (String processInstanceId: processInstanceIds) { deleteProcessInstance(processInstanceId, deleteReason, cascade, skipCustomListeners, false, skipIoMappings, false); } if (cascade) { getHistoricProcessInstanceManager().deleteHistoricProcessInstanceByProcessDefinitionId(processDefinitionId); } }
final ExecutionEntity execution = executionManager.findExecutionById(processInstanceId); .deleteProcessInstance(processInstanceId, deleteReason, false, skipCustomListeners, externallyTerminated, skipIoMappings, skipSubprocesses);
protected List<ExecutionEntity> loadFromDb(final String processInstanceId, final CommandContext commandContext) { List<ExecutionEntity> executions = commandContext.getExecutionManager().findExecutionsByProcessInstanceId(processInstanceId); ExecutionEntity processInstance = commandContext.getExecutionManager().findExecutionById(processInstanceId); // initialize parent/child sets if (processInstance != null) { processInstance.restoreProcessInstance(executions, null, null, null, null, null, null); } return executions; }
public void deleteExecution(ExecutionEntity execution) { getDbEntityManager().delete(execution); if (execution.isProcessInstanceExecution()) { deleteAuthorizations(Resources.PROCESS_INSTANCE, execution.getProcessInstanceId()); } }
@Override public void execute(DelegateExecution execution) throws Exception { ExecutionManager executionManager = Context.getCommandContext().getExecutionManager(); ExecutionEntity execution1 = executionManager.findExecutionById(ENTITY_ID1); ExecutionEntity execution2 = executionManager.findExecutionById(ENTITY_ID2); executionManager.delete(execution1); executionManager.delete(execution2); executionThreadControl.sync(); }
public long executeCount(CommandContext commandContext, Map<String, Object> parameterMap) { return commandContext .getExecutionManager() // can use execution count, since the result type doesn't matter .findExecutionCountByNativeQuery(parameterMap); }
/** * Cascades the deletion of the process definition to the process instances. * Skips the custom listeners if the flag was set to true. * * @param processDefinitionId the process definition id * @param skipCustomListeners true if the custom listeners should be skipped at process instance deletion * @param skipIoMappings specifies whether input/output mappings for tasks should be invoked */ protected void cascadeDeleteProcessInstancesForProcessDefinition(String processDefinitionId, boolean skipCustomListeners, boolean skipIoMappings) { getProcessInstanceManager() .deleteProcessInstancesByProcessDefinition(processDefinitionId, "deleted process definition", true, skipCustomListeners, skipIoMappings); }
public void deleteProcessInstance(String processInstanceId, String deleteReason, boolean cascade, boolean skipCustomListeners) { deleteProcessInstance(processInstanceId, deleteReason, cascade, skipCustomListeners, false, false, false); }
protected void ensureExecutionsInitialized() { if (executions == null) { if (isExecutionTreePrefetchEnabled()) { ensureExecutionTreeInitialized(); } else { this.executions = Context.getCommandContext().getExecutionManager().findChildExecutionsByParentExecutionId(id); } } }
@Override public void remove() { super.remove(); // removes jobs, incidents and tasks, and // clears the variable store clearExecution(); // remove all event subscriptions for this scope, if the scope has event // subscriptions: removeEventSubscriptions(); // finally delete this execution Context.getCommandContext().getExecutionManager().deleteExecution(this); }
@SuppressWarnings("unchecked") public void deleteProcessInstancesByProcessDefinition(String processDefinitionId, String deleteReason, boolean cascade, boolean skipCustomListeners, boolean skipIoMappings) { List<String> processInstanceIds = getDbEntityManager() .selectList("selectProcessInstanceIdsByProcessDefinitionId", processDefinitionId); for (String processInstanceId: processInstanceIds) { deleteProcessInstance(processInstanceId, deleteReason, cascade, skipCustomListeners, false, skipIoMappings, false); } if (cascade) { getHistoricProcessInstanceManager().deleteHistoricProcessInstanceByProcessDefinitionId(processDefinitionId); } }
final ExecutionEntity execution = executionManager.findExecutionById(processInstanceId); .deleteProcessInstance(processInstanceId, deleteReason, false, skipCustomListeners, externallyTerminated, skipIoMappings, skipSubprocesses);
protected List<ExecutionEntity> loadFromDb(final String processInstanceId, final CommandContext commandContext) { List<ExecutionEntity> executions = commandContext.getExecutionManager().findExecutionsByProcessInstanceId(processInstanceId); ExecutionEntity processInstance = commandContext.getExecutionManager().findExecutionById(processInstanceId); // initialize parent/child sets if (processInstance != null) { processInstance.restoreProcessInstance(executions, null, null, null, null, null, null); } return executions; }
public void deleteExecution(ExecutionEntity execution) { getDbEntityManager().delete(execution); if (execution.isProcessInstanceExecution()) { deleteAuthorizations(Resources.PROCESS_INSTANCE, execution.getProcessInstanceId()); } }
public void insertExecution(ExecutionEntity execution) { getDbEntityManager().insert(execution); createDefaultAuthorizations(execution); }
public long executeCount(CommandContext commandContext, Map<String, Object> parameterMap) { return commandContext .getExecutionManager() .findExecutionCountByNativeQuery(parameterMap); }