public List<Batch> executeList(CommandContext commandContext, Page page) { checkQueryOk(); return commandContext.getBatchManager() .findBatchesByQueryCriteria(this, page); }
public long executeCount(CommandContext commandContext) { checkQueryOk(); return commandContext.getBatchManager() .findBatchCountByQueryCriteria(this); }
public long executeCount(CommandContext commandContext) { checkQueryOk(); return commandContext.getBatchManager() .findBatchCountByQueryCriteria(this); }
public List<Batch> executeList(CommandContext commandContext, Page page) { checkQueryOk(); return commandContext.getBatchManager() .findBatchesByQueryCriteria(this, page); }
@Override public Void execute(CommandContext commandContext) { ensureNotNull(BadUserRequestException.class, "Batch id must not be null", "batch id", batchId); BatchEntity batchEntity = commandContext.getBatchManager().findBatchById(batchId); ensureNotNull(BadUserRequestException.class, "Batch for id '" + batchId + "' cannot be found", "batch", batchEntity); checkAccess(commandContext, batchEntity); batchEntity.delete(cascadeToHistory); return null; }
@Override public Void execute(CommandContext commandContext) { ensureNotNull(BadUserRequestException.class, "Batch id must not be null", "batch id", batchId); BatchEntity batchEntity = commandContext.getBatchManager().findBatchById(batchId); ensureNotNull(BadUserRequestException.class, "Batch for id '" + batchId + "' cannot be found", "batch", batchEntity); checkAccess(commandContext, batchEntity); batchEntity.delete(cascadeToHistory); return null; }
public void execute(BatchMonitorJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { String batchId = configuration.getBatchId(); BatchEntity batch = commandContext.getBatchManager().findBatchById(configuration.getBatchId()); ensureNotNull("Batch with id '" + batchId + "' cannot be found", "batch", batch); boolean completed = batch.isCompleted(); if (!completed) { batch.createMonitorJob(true); } else { batch.delete(false); } }
public void execute(BatchMonitorJobConfiguration configuration, ExecutionEntity execution, CommandContext commandContext, String tenantId) { String batchId = configuration.getBatchId(); BatchEntity batch = commandContext.getBatchManager().findBatchById(configuration.getBatchId()); ensureNotNull("Batch with id '" + batchId + "' cannot be found", "batch", batch); boolean completed = batch.isCompleted(); if (!completed) { batch.createMonitorJob(true); } else { batch.delete(false); } }
protected BatchEntity createBatch(CommandContext commandContext, Collection<String> processInstanceIds) { ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration(); BatchJobHandler<SetRetriesBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration); SetRetriesBatchConfiguration configuration = new SetRetriesBatchConfiguration(new ArrayList<String>(processInstanceIds), builder.getRetries()); BatchEntity batch = new BatchEntity(); batch.setType(batchJobHandler.getType()); batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration)); batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed()); batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob()); batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration)); commandContext.getBatchManager().insertBatch(batch); return batch; }
protected BatchEntity createBatch(CommandContext commandContext, Collection<String> processInstanceIds) { ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration(); BatchJobHandler<SetRetriesBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration); SetRetriesBatchConfiguration configuration = new SetRetriesBatchConfiguration(new ArrayList<String>(processInstanceIds), builder.getRetries()); BatchEntity batch = new BatchEntity(); batch.setType(batchJobHandler.getType()); batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration)); batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed()); batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob()); batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration)); commandContext.getBatchManager().insertBatch(batch); return batch; }
protected BatchEntity createBatch(CommandContext commandContext, Collection<String> processInstanceIds) { ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration(); BatchJobHandler batchJobHandler = getBatchJobHandler(processEngineConfiguration); BatchConfiguration configuration = getAbstractIdsBatchConfiguration(new ArrayList<String>(processInstanceIds)); BatchEntity batch = new BatchEntity(); batch.setType(batchJobHandler.getType()); batch.setTotalJobs(calculateSize(processEngineConfiguration, (UpdateProcessInstancesSuspendStateBatchConfiguration) configuration)); batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed()); batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob()); batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration)); commandContext.getBatchManager().insertBatch(batch); return batch; }
protected BatchEntity createBatch(CommandContext commandContext, Collection<String> processInstanceIds) { ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration(); BatchJobHandler batchJobHandler = getBatchJobHandler(processEngineConfiguration); BatchConfiguration configuration = getAbstractIdsBatchConfiguration(new ArrayList<String>(processInstanceIds)); BatchEntity batch = new BatchEntity(); batch.setType(batchJobHandler.getType()); batch.setTotalJobs(calculateSize(processEngineConfiguration, (UpdateProcessInstancesSuspendStateBatchConfiguration) configuration)); batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed()); batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob()); batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration)); commandContext.getBatchManager().insertBatch(batch); return batch; }
protected BatchEntity createBatch(CommandContext commandContext, List<AbstractProcessInstanceModificationCommand> instructions, Collection<String> processInstanceIds, ProcessDefinitionEntity processDefinition) { ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration(); BatchJobHandler<ModificationBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration); ModificationBatchConfiguration configuration = new ModificationBatchConfiguration(new ArrayList<String>(processInstanceIds), builder.getProcessDefinitionId(), instructions, builder.isSkipCustomListeners(), builder.isSkipIoMappings()); BatchEntity batch = new BatchEntity(); batch.setType(batchJobHandler.getType()); batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration)); batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed()); batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob()); batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration)); batch.setTenantId(processDefinition.getTenantId()); commandContext.getBatchManager().insertBatch(batch); return batch; }
protected BatchEntity createBatch(CommandContext commandContext, List<AbstractProcessInstanceModificationCommand> instructions, Collection<String> processInstanceIds, ProcessDefinitionEntity processDefinition) { ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration(); BatchJobHandler<ModificationBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration); ModificationBatchConfiguration configuration = new ModificationBatchConfiguration(new ArrayList<String>(processInstanceIds), builder.getProcessDefinitionId(), instructions, builder.isSkipCustomListeners(), builder.isSkipIoMappings()); BatchEntity batch = new BatchEntity(); batch.setType(batchJobHandler.getType()); batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration)); batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed()); batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob()); batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration)); batch.setTenantId(processDefinition.getTenantId()); commandContext.getBatchManager().insertBatch(batch); return batch; }
public Void execute(CommandContext commandContext) { ensureNotNull(BadUserRequestException.class, "Batch id must not be null", "batch id", batchId); BatchManager batchManager = commandContext.getBatchManager(); BatchEntity batch = batchManager.findBatchById(batchId); ensureNotNull(BadUserRequestException.class, "Batch for id '" + batchId + "' cannot be found", "batch", batch); checkAccess(commandContext, batch); setJobDefinitionState(commandContext, batch.getSeedJobDefinitionId()); setJobDefinitionState(commandContext, batch.getMonitorJobDefinitionId()); setJobDefinitionState(commandContext, batch.getBatchJobDefinitionId()); batchManager.updateBatchSuspensionStateById(batchId, getNewSuspensionState()); logUserOperation(commandContext); return null; }
public Void execute(CommandContext commandContext) { ensureNotNull(BadUserRequestException.class, "Batch id must not be null", "batch id", batchId); BatchManager batchManager = commandContext.getBatchManager(); BatchEntity batch = batchManager.findBatchById(batchId); ensureNotNull(BadUserRequestException.class, "Batch for id '" + batchId + "' cannot be found", "batch", batch); checkAccess(commandContext, batch); setJobDefinitionState(commandContext, batch.getSeedJobDefinitionId()); setJobDefinitionState(commandContext, batch.getMonitorJobDefinitionId()); setJobDefinitionState(commandContext, batch.getBatchJobDefinitionId()); batchManager.updateBatchSuspensionStateById(batchId, getNewSuspensionState()); logUserOperation(commandContext); return null; }
protected BatchEntity createBatch(CommandContext commandContext, List<String> ids) { ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration(); BatchJobHandler batchJobHandler = getBatchJobHandler(processEngineConfiguration); BatchConfiguration configuration = getAbstractIdsBatchConfiguration(ids); BatchEntity batch = new BatchEntity(); batch.setType(batchJobHandler.getType()); batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration)); batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed()); batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob()); batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration)); commandContext.getBatchManager().insertBatch(batch); return batch; }
protected BatchEntity createBatch(CommandContext commandContext, List<String> ids) { ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration(); BatchJobHandler batchJobHandler = getBatchJobHandler(processEngineConfiguration); BatchConfiguration configuration = getAbstractIdsBatchConfiguration(ids); BatchEntity batch = new BatchEntity(); batch.setType(batchJobHandler.getType()); batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration)); batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed()); batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob()); batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration)); commandContext.getBatchManager().insertBatch(batch); return batch; }
protected BatchEntity createBatch(CommandContext commandContext, List<AbstractProcessInstanceModificationCommand> instructions, List<String> processInstanceIds, ProcessDefinitionEntity processDefinition) { ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration(); BatchJobHandler<RestartProcessInstancesBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration); RestartProcessInstancesBatchConfiguration configuration = new RestartProcessInstancesBatchConfiguration( processInstanceIds, instructions, builder.getProcessDefinitionId(), builder.isInitialVariables(), builder.isSkipCustomListeners(), builder.isSkipIoMappings(), builder.isWithoutBusinessKey()); BatchEntity batch = new BatchEntity(); batch.setType(batchJobHandler.getType()); batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration)); batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed()); batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob()); batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration)); batch.setTenantId(processDefinition.getTenantId()); commandContext.getBatchManager().insertBatch(batch); return batch; }
protected BatchEntity createBatch(CommandContext commandContext, List<AbstractProcessInstanceModificationCommand> instructions, List<String> processInstanceIds, ProcessDefinitionEntity processDefinition) { ProcessEngineConfigurationImpl processEngineConfiguration = commandContext.getProcessEngineConfiguration(); BatchJobHandler<RestartProcessInstancesBatchConfiguration> batchJobHandler = getBatchJobHandler(processEngineConfiguration); RestartProcessInstancesBatchConfiguration configuration = new RestartProcessInstancesBatchConfiguration( processInstanceIds, instructions, builder.getProcessDefinitionId(), builder.isInitialVariables(), builder.isSkipCustomListeners(), builder.isSkipIoMappings(), builder.isWithoutBusinessKey()); BatchEntity batch = new BatchEntity(); batch.setType(batchJobHandler.getType()); batch.setTotalJobs(calculateSize(processEngineConfiguration, configuration)); batch.setBatchJobsPerSeed(processEngineConfiguration.getBatchJobsPerSeed()); batch.setInvocationsPerBatchJob(processEngineConfiguration.getInvocationsPerBatchJob()); batch.setConfigurationBytes(batchJobHandler.writeConfiguration(configuration)); batch.setTenantId(processDefinition.getTenantId()); commandContext.getBatchManager().insertBatch(batch); return batch; }