Search in sources :

Example 1 with DeleteJobsCmd

use of org.camunda.bpm.engine.impl.cmd.DeleteJobsCmd in project camunda-bpm-platform by camunda.

the class JobQueryTest method tearDown.

@Override
protected void tearDown() throws Exception {
    repositoryService.deleteDeployment(deploymentId, true);
    commandExecutor.execute(new DeleteJobsCmd(messageId, true));
    super.tearDown();
}
Also used : DeleteJobsCmd(org.camunda.bpm.engine.impl.cmd.DeleteJobsCmd)

Example 2 with DeleteJobsCmd

use of org.camunda.bpm.engine.impl.cmd.DeleteJobsCmd in project camunda-bpm-platform by camunda.

the class StartTimerEventTest method cleanDB.

private void cleanDB() {
    String jobId = managementService.createJobQuery().singleResult().getId();
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
    commandExecutor.execute(new DeleteJobsCmd(jobId, true));
}
Also used : CommandExecutor(org.camunda.bpm.engine.impl.interceptor.CommandExecutor) DeleteJobsCmd(org.camunda.bpm.engine.impl.cmd.DeleteJobsCmd)

Example 3 with DeleteJobsCmd

use of org.camunda.bpm.engine.impl.cmd.DeleteJobsCmd in project camunda-bpm-platform by camunda.

the class DeploymentAwareJobExecutorTest method testJobsWithoutDeploymentIdAreAlwaysProcessed.

public void testJobsWithoutDeploymentIdAreAlwaysProcessed() {
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
    String messageId = commandExecutor.execute(new Command<String>() {

        public String execute(CommandContext commandContext) {
            MessageEntity message = new MessageEntity();
            commandContext.getJobManager().send(message);
            return message.getId();
        }
    });
    AcquiredJobs acquiredJobs = getExecutableJobs(processEngineConfiguration.getJobExecutor());
    Assert.assertEquals(1, acquiredJobs.size());
    Assert.assertTrue(acquiredJobs.contains(messageId));
    commandExecutor.execute(new DeleteJobsCmd(messageId, true));
}
Also used : MessageEntity(org.camunda.bpm.engine.impl.persistence.entity.MessageEntity) CommandContext(org.camunda.bpm.engine.impl.interceptor.CommandContext) CommandExecutor(org.camunda.bpm.engine.impl.interceptor.CommandExecutor) AcquiredJobs(org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs) DeleteJobsCmd(org.camunda.bpm.engine.impl.cmd.DeleteJobsCmd)

Aggregations

DeleteJobsCmd (org.camunda.bpm.engine.impl.cmd.DeleteJobsCmd)3 CommandExecutor (org.camunda.bpm.engine.impl.interceptor.CommandExecutor)2 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)1 AcquiredJobs (org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs)1 MessageEntity (org.camunda.bpm.engine.impl.persistence.entity.MessageEntity)1