/** * Deprecated: use {@link #getProcessEngines()} instead */ @Deprecated public CommandExecutor getCommandExecutor() { if(processEngines.isEmpty()) { return null; } else { return processEngines.get(0).getProcessEngineConfiguration().getCommandExecutorTxRequired(); } }
protected List<JobEntity> findAndLockAcquirableJobs() { return processEngineConfiguration.getCommandExecutorTxRequired().execute(new Command<List<JobEntity>>() { @Override public List<JobEntity> execute(CommandContext commandContext) { List<JobEntity> jobs = commandContext.getJobManager().findNextJobsToExecute(new Page(0, 100)); for (JobEntity job : jobs) { job.setLockOwner("test"); } return jobs; } }); }
protected List<JobEntity> findAcquirableJobs() { return processEngineConfiguration.getCommandExecutorTxRequired().execute(new Command<List<JobEntity>>() { @Override public List<JobEntity> execute(CommandContext commandContext) { return commandContext .getJobManager() .findNextJobsToExecute(new Page(0, 100)); } }); }
protected List<JobEntity> findAcquirableJobs() { return configuration.getCommandExecutorTxRequired().execute(new Command<List<JobEntity>>() { @Override public List<JobEntity> execute(CommandContext commandContext) { return commandContext .getJobManager() .findNextJobsToExecute(new Page(0, 100)); } }); }
@Override public void tearDown() throws Exception { CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired(); commandExecutor.execute(new Command<Object>() { public Object execute(CommandContext commandContext) { commandContext.getHistoricJobLogManager().deleteHistoricJobLogsByHandlerType(TimerActivateJobDefinitionHandler.TYPE); return null; } }); }
@Override public void tearDown() throws Exception { CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired(); commandExecutor.execute(new Command<Object>() { public Object execute(CommandContext commandContext) { commandContext.getHistoricJobLogManager().deleteHistoricJobLogsByHandlerType(TimerActivateProcessDefinitionHandler.TYPE); return null; } }); }
@Override public void tearDown() throws Exception { CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired(); commandExecutor.execute(new Command<Object>() { public Object execute(CommandContext commandContext) { commandContext.getHistoricJobLogManager().deleteHistoricJobLogsByHandlerType(TimerActivateProcessDefinitionHandler.TYPE); commandContext.getHistoricJobLogManager().deleteHistoricJobLogsByHandlerType(TimerSuspendProcessDefinitionHandler.TYPE); return null; } }); }
protected List<JobEntity> findAcquirableJobs() { return engineRule.getProcessEngineConfiguration().getCommandExecutorTxRequired().execute(new Command<List<JobEntity>>() { @Override public List<JobEntity> execute(CommandContext commandContext) { return commandContext .getJobManager() .findNextJobsToExecute(new Page(0, 100)); } }); } }
protected void decorate(TaskEntity task, TaskDecorator decorator) { processEngineConfiguration .getCommandExecutorTxRequired() .execute(new DecorateTaskCommand(task, decorator)); }
protected void clearAttachment(final Attachment attachment) { CommandExecutor commandExecutor = engineRule.getProcessEngineConfiguration().getCommandExecutorTxRequired(); commandExecutor.execute(new Command<Object>() { public Object execute(CommandContext commandContext) { commandContext.getAttachmentManager().delete((AttachmentEntity) attachment); return null; } }); }
protected void clearHistoricTaskInst(final String taskId) { CommandExecutor commandExecutor = engineRule.getProcessEngineConfiguration().getCommandExecutorTxRequired(); commandExecutor.execute(new Command<Object>() { public Object execute(CommandContext commandContext) { commandContext.getHistoricTaskInstanceManager().deleteHistoricTaskInstanceById(taskId); commandContext.getHistoricIdentityLinkManager().deleteHistoricIdentityLinksLogByTaskId(taskId); return null; } }); }
protected void clearHistoricIncident(final HistoricIncident historicIncident) { CommandExecutor commandExecutor = engineRule.getProcessEngineConfiguration().getCommandExecutorTxRequired(); commandExecutor.execute(new Command<Object>() { public Object execute(CommandContext commandContext) { commandContext.getHistoricIncidentManager().delete((HistoricIncidentEntity) historicIncident); return null; } }); }
protected void cleanupJobLog() { engineRule.getProcessEngineConfiguration().getCommandExecutorTxRequired() .execute(new Command<Void>() { public Void execute(CommandContext commandContext) { for (String jobId : jobIds) { commandContext.getHistoricJobLogManager() .deleteHistoricJobLogByJobId(jobId); } return null; } }); }
private void verifyByteArraysWereRemoved(final String... errorDetailsByteArrayIds) { engineRule.getProcessEngineConfiguration().getCommandExecutorTxRequired().execute(new Command<Void>() { public Void execute(CommandContext commandContext) { for (String errorDetailsByteArrayId : errorDetailsByteArrayIds) { assertNull(commandContext.getDbEntityManager().selectOne("selectByteArray", errorDetailsByteArrayId)); } return null; } }); }
protected void setUp() throws Exception { super.setUp(); this.commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired(); processEngine.getProcessEngineConfiguration().setSkipHistoryOptimisticLockingExceptions(true); }
@Override public void tearDown() { super.tearDown(); CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired(); commandExecutor.execute(new Command<Object>() { public Object execute(CommandContext commandContext) { commandContext.getHistoricJobLogManager().deleteHistoricJobLogsByHandlerType(TimerSuspendJobDefinitionHandler.TYPE); return null; } }); deleteDeployment(deploymentId); }
public void run() { try { processEngineConfiguration .getCommandExecutorTxRequired() .execute(new ControlledCommand(activeThread, new CompleteTaskCmd(taskId, null))); } catch (OptimisticLockingException e) { this.exception = e; } LOG.debug(getName()+" ends"); } }
@Override public void run() { try { processEngineConfiguration .getCommandExecutorTxRequired() .execute(new ControlledCommand(activeThread, new CompleteTaskCmd(taskId, null))); } catch (ProcessEngineException e) { this.exception = e; } LOG.debug(getName() + " ends."); } }
@Override public void run() { try { processEngineConfiguration.getCommandExecutorTxRequired() .execute(new ControlledCommand<Void>(activeThread, new SetJobDefinitionPriorityCmd(jobDefinitionId, priority, cascade))); } catch (OptimisticLockingException e) { this.exception = e; } } }
public void run() { try { JobExecutor jobExecutor = processEngineConfiguration.getJobExecutor(); jobs = (AcquiredJobs) processEngineConfiguration .getCommandExecutorTxRequired() .execute(new ControlledCommand(activeThread, new AcquireJobsCmd(jobExecutor))); } catch (OptimisticLockingException e) { this.exception = e; } LOG.debug(getName()+" ends"); } }