@Override public void onDelete(BatchJobConfiguration configuration, JobEntity jobEntity) { String byteArrayId = configuration.getConfigurationByteArrayId(); if (byteArrayId != null) { Context.getCommandContext().getByteArrayManager() .deleteByteArrayById(byteArrayId); } }
@Override public void onDelete(BatchJobConfiguration configuration, JobEntity jobEntity) { String byteArrayId = configuration.getConfigurationByteArrayId(); if (byteArrayId != null) { Context.getCommandContext().getByteArrayManager() .deleteByteArrayById(byteArrayId); } }
public Void execute(CommandContext commandContext) { commandContext.getByteArrayManager() .deleteByteArrayById(historicByteArrayId[0]); return null; } });
/** * create ByteArrayEntity with specified name and payload and make sure it's * persisted * * used in Jobs and ExternalTasks * * @param name - type\source of the exception * @param byteArray - payload of the exception * @param type - resource type of the exception * @return persisted entity */ public static ByteArrayEntity createExceptionByteArray(String name, byte[] byteArray, ResourceType type) { ByteArrayEntity result = null; if (byteArray != null) { result = new ByteArrayEntity(name, byteArray, type); Context.getCommandContext() .getByteArrayManager() .insertByteArray(result); } return result; }
protected void deleteFromExecutionAndRuntimeTable() { getExecution().removeExternalTask(this); CommandContext commandContext = Context.getCommandContext(); commandContext .getExternalTaskManager() .delete(this); // Also delete the external tasks's error details byte array if (errorDetailsByteArrayId != null) { commandContext.getByteArrayManager().deleteByteArrayById(errorDetailsByteArrayId); } }
protected void deleteFromExecutionAndRuntimeTable() { getExecution().removeExternalTask(this); CommandContext commandContext = Context.getCommandContext(); commandContext .getExternalTaskManager() .delete(this); // Also delete the external tasks's error details byte array if (errorDetailsByteArrayId != null) { commandContext.getByteArrayManager().deleteByteArrayById(errorDetailsByteArrayId); } }
public Void execute(CommandContext commandContext) { ensureNotNull("UserId", userId); IdentityInfoEntity infoEntity = commandContext.getIdentityInfoManager() .findUserInfoByUserIdAndKey(userId, "picture"); if(infoEntity != null) { String byteArrayId = infoEntity.getValue(); if(byteArrayId != null) { commandContext.getByteArrayManager() .deleteByteArrayById(byteArrayId); } commandContext.getIdentityInfoManager() .delete(infoEntity); } return null; }
public Void execute(CommandContext commandContext) { ensureNotNull("UserId", userId); IdentityInfoEntity infoEntity = commandContext.getIdentityInfoManager() .findUserInfoByUserIdAndKey(userId, "picture"); if(infoEntity != null) { String byteArrayId = infoEntity.getValue(); if(byteArrayId != null) { commandContext.getByteArrayManager() .deleteByteArrayById(byteArrayId); } commandContext.getIdentityInfoManager() .delete(infoEntity); } return null; }
@Override public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { ByteArrayEntity configurationEntity = commandContext .getDbEntityManager() .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId()); BatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes()); boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers(); commandContext.disableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true); try { commandContext.getProcessEngineConfiguration() .getHistoryService() .deleteHistoricProcessInstances(batchConfiguration.getIds()); } finally { commandContext.enableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions); } commandContext.getByteArrayManager().delete(configurationEntity); }
@Override public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { ByteArrayEntity configurationEntity = commandContext .getDbEntityManager() .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId()); BatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes()); boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers(); commandContext.disableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true); try { commandContext.getProcessEngineConfiguration() .getHistoryService() .deleteHistoricDecisionInstancesBulk(batchConfiguration.getIds()); } finally { commandContext.enableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions); } commandContext.getByteArrayManager().delete(configurationEntity); }
public Object execute(CommandContext commandContext) { AttachmentEntity attachment = commandContext .getDbEntityManager() .selectById(AttachmentEntity.class, attachmentId); commandContext .getDbEntityManager() .delete(attachment); if (attachment.getContentId() != null) { commandContext .getByteArrayManager() .deleteByteArrayById(attachment.getContentId()); } if (attachment.getTaskId()!=null) { TaskEntity task = commandContext .getTaskManager() .findTaskById(attachment.getTaskId()); PropertyChange propertyChange = new PropertyChange("name", null, attachment.getName()); commandContext.getOperationLogManager() .logAttachmentOperation(UserOperationLogEntry.OPERATION_TYPE_DELETE_ATTACHMENT, task, propertyChange); } return null; }
@Override public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { ByteArrayEntity configurationEntity = commandContext .getDbEntityManager() .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId()); SetRetriesBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes()); boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers(); commandContext.disableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true); try { commandContext.getProcessEngineConfiguration() .getManagementService() .setJobRetries(batchConfiguration.getIds(), batchConfiguration.getRetries()); } finally { commandContext.enableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions); } commandContext.getByteArrayManager().delete(configurationEntity); } }
@Override public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { ByteArrayEntity configurationEntity = commandContext .getDbEntityManager() .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId()); SetRetriesBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes()); boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers(); commandContext.disableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true); try { commandContext.getProcessEngineConfiguration() .getExternalTaskService() .setRetries(batchConfiguration.getIds(), batchConfiguration.getRetries()); } finally { commandContext.enableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions); } commandContext.getByteArrayManager().delete(configurationEntity); }
@Override public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { ByteArrayEntity configurationEntity = commandContext .getDbEntityManager() .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId()); SetRetriesBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes()); boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers(); commandContext.disableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true); try { commandContext.getProcessEngineConfiguration() .getExternalTaskService() .setRetries(batchConfiguration.getIds(), batchConfiguration.getRetries()); } finally { commandContext.enableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions); } commandContext.getByteArrayManager().delete(configurationEntity); }
@Override public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { ByteArrayEntity configurationEntity = commandContext .getDbEntityManager() .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId()); SetRetriesBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes()); boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers(); commandContext.disableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true); try { commandContext.getProcessEngineConfiguration() .getManagementService() .setJobRetries(batchConfiguration.getIds(), batchConfiguration.getRetries()); } finally { commandContext.enableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions); } commandContext.getByteArrayManager().delete(configurationEntity); } }
@Override public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { ByteArrayEntity configurationEntity = commandContext .getDbEntityManager() .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId()); DeleteProcessInstanceBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes()); boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers(); commandContext.disableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true); try { commandContext.getProcessEngineConfiguration() .getRuntimeService() .deleteProcessInstances(batchConfiguration.getIds(), batchConfiguration.deleteReason, batchConfiguration.isSkipCustomListeners(), true, batchConfiguration.isSkipSubprocesses()); } finally { commandContext.enableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions); } commandContext.getByteArrayManager().delete(configurationEntity); }
@Override public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { ByteArrayEntity configurationEntity = commandContext .getDbEntityManager() .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId()); DeleteProcessInstanceBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes()); boolean initialLegacyRestrictions = commandContext.isRestrictUserOperationLogToAuthenticatedUsers(); commandContext.disableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(true); try { commandContext.getProcessEngineConfiguration() .getRuntimeService() .deleteProcessInstances(batchConfiguration.getIds(), batchConfiguration.deleteReason, batchConfiguration.isSkipCustomListeners(), true, batchConfiguration.isSkipSubprocesses()); } finally { commandContext.enableUserOperationLog(); commandContext.setRestrictUserOperationLogToAuthenticatedUsers(initialLegacyRestrictions); } commandContext.getByteArrayManager().delete(configurationEntity); }
@Override public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { ByteArrayEntity configurationEntity = commandContext .getDbEntityManager() .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId()); MigrationBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes()); MigrationPlanExecutionBuilder executionBuilder = commandContext.getProcessEngineConfiguration() .getRuntimeService() .newMigration(batchConfiguration.getMigrationPlan()) .processInstanceIds(batchConfiguration.getIds()); if (batchConfiguration.isSkipCustomListeners()) { executionBuilder.skipCustomListeners(); } if (batchConfiguration.isSkipIoMappings()) { executionBuilder.skipIoMappings(); } // uses internal API in order to skip writing user operation log (CommandContext#disableUserOperationLog // is not sufficient with legacy engine config setting "restrictUserOperationLogToAuthenticatedUsers" = false) ((MigrationPlanExecutionBuilderImpl) executionBuilder).execute(false); commandContext.getByteArrayManager().delete(configurationEntity); }
@Override public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { ByteArrayEntity configurationEntity = commandContext .getDbEntityManager() .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId()); ModificationBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes()); ModificationBuilderImpl executionBuilder = (ModificationBuilderImpl) commandContext.getProcessEngineConfiguration() .getRuntimeService() .createModification(batchConfiguration.getProcessDefinitionId()) .processInstanceIds(batchConfiguration.getIds()); executionBuilder.setInstructions(batchConfiguration.getInstructions()); if (batchConfiguration.isSkipCustomListeners()) { executionBuilder.skipCustomListeners(); } if (batchConfiguration.isSkipIoMappings()) { executionBuilder.skipIoMappings(); } executionBuilder.execute(false); commandContext.getByteArrayManager().delete(configurationEntity); }
@Override public void execute(BatchJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { ByteArrayEntity configurationEntity = commandContext .getDbEntityManager() .selectById(ByteArrayEntity.class, configuration.getConfigurationByteArrayId()); ModificationBatchConfiguration batchConfiguration = readConfiguration(configurationEntity.getBytes()); ModificationBuilderImpl executionBuilder = (ModificationBuilderImpl) commandContext.getProcessEngineConfiguration() .getRuntimeService() .createModification(batchConfiguration.getProcessDefinitionId()) .processInstanceIds(batchConfiguration.getIds()); executionBuilder.setInstructions(batchConfiguration.getInstructions()); if (batchConfiguration.isSkipCustomListeners()) { executionBuilder.skipCustomListeners(); } if (batchConfiguration.isSkipIoMappings()) { executionBuilder.skipIoMappings(); } executionBuilder.execute(false); commandContext.getByteArrayManager().delete(configurationEntity); }