Examples of AcquiredJobs


Examples of org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs

    String lockOwner = jobExecutor.getLockOwner();
    int lockTimeInMillis = jobExecutor.getLockTimeInMillis();
    int maxNonExclusiveJobsPerAcquisition = jobExecutor.getMaxJobsPerAcquisition();

    acquiredJobs = new AcquiredJobs();
    List<JobEntity> jobs = commandContext
      .getJobManager()
      .findNextJobsToExecute(new Page(0, maxNonExclusiveJobsPerAcquisition));

    for (JobEntity job: jobs) {
View Full Code Here

Examples of org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs

        commandContext.getJobManager().send(message);
        return message.getId();
      }
    });

    AcquiredJobs acquiredJobs = commandExecutor.execute(new AcquireJobsCmd(jobExecutor));
    List<List<String>> jobIdsList = acquiredJobs.getJobIdBatches();
    assertEquals(1, jobIdsList.size());

    List<String> jobIds = jobIdsList.get(0);

    List<String> expectedJobIds = new ArrayList<String>();
View Full Code Here

Examples of org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs

        commandContext.getJobManager().schedule(timer);
        return timer.getId();
      }
    });

    AcquiredJobs acquiredJobs = commandExecutor.execute(new AcquireJobsCmd(jobExecutor));
    List<List<String>> jobIdsList = acquiredJobs.getJobIdBatches();
    assertEquals(0, jobIdsList.size());

    List<String> expectedJobIds = new ArrayList<String>();

    ClockUtil.setCurrentTime(new Date(SOME_TIME + (20 * SECOND)));

    acquiredJobs = commandExecutor.execute(new AcquireJobsCmd(jobExecutor));
    jobIdsList = acquiredJobs.getJobIdBatches();
    assertEquals(1, jobIdsList.size());

    List<String> jobIds = jobIdsList.get(0);

    expectedJobIds.add(jobId);
View Full Code Here

Examples of org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs

    Assert.assertTrue(jobDeploymentIds.contains(deploymentId));
    Assert.assertTrue(jobDeploymentIds.contains(otherDeploymentId));

    // select executable jobs for executor of first engine
    AcquiredJobs acquiredJobs = getExecutableJobs(processEngineConfiguration.getJobExecutor());
    Assert.assertEquals(1, acquiredJobs.size());
    Assert.assertTrue(acquiredJobs.contains(executableJob.getId()));

    repositoryService.deleteDeployment(otherDeploymentId, true);
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs

    processEngine.getManagementService().registerDeploymentForJobExecutor(otherDeploymentId);

    List<Job> jobs = managementService.createJobQuery().list();

    AcquiredJobs acquiredJobs = getExecutableJobs(processEngineConfiguration.getJobExecutor());
    Assert.assertEquals(2, acquiredJobs.size());
    for (Job job : jobs) {
      Assert.assertTrue(acquiredJobs.contains(job.getId()));
    }

    repositoryService.deleteDeployment(otherDeploymentId, true);
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs

  public void testExplicitDeploymentUnregistration() {
    runtimeService.startProcessInstanceByKey("simpleAsyncProcess");

    processEngine.getManagementService().unregisterDeploymentForJobExecutor(deploymentId);

    AcquiredJobs acquiredJobs = getExecutableJobs(processEngineConfiguration.getJobExecutor());
    Assert.assertEquals(0, acquiredJobs.size());
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs

        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));
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs

    // if I start a new instance
    runtimeService.startProcessInstanceByKey("simpleAsyncProcess");

    // then the new job executor will not acquire the job:
    AcquiredJobs acquiredJobs = acquireJobs();
    assertEquals(0, acquiredJobs.size());

    // -------------------------

    // given a active job definition:
    managementService.activateJobDefinitionByProcessDefinitionKey("simpleAsyncProcess", true);

    // then the new job executor will not acquire the job:
    acquiredJobs = acquireJobs();
    assertEquals(1, acquiredJobs.size());

  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs

  public void testAcquiredJobs() {
    List<String> firstBatch = new ArrayList<String>(Arrays.asList("a", "b", "c"));
    List<String> secondBatch = new ArrayList<String>(Arrays.asList("d", "e", "f"));
    List<String> thirdBatch = new ArrayList<String>(Arrays.asList("g"));

    AcquiredJobs acquiredJobs = new AcquiredJobs();
    acquiredJobs.addJobIdBatch(firstBatch);
    acquiredJobs.addJobIdBatch(secondBatch);
    acquiredJobs.addJobIdBatch(thirdBatch);

    assertEquals(firstBatch, acquiredJobs.getJobIdBatches().get(0));
    assertEquals(secondBatch, acquiredJobs.getJobIdBatches().get(1));
    assertEquals(thirdBatch, acquiredJobs.getJobIdBatches().get(2));

    acquiredJobs.removeJobId("a");
    assertEquals(Arrays.asList("b", "c"), acquiredJobs.getJobIdBatches().get(0));
    assertEquals(secondBatch, acquiredJobs.getJobIdBatches().get(1));
    assertEquals(thirdBatch, acquiredJobs.getJobIdBatches().get(2));

    assertEquals(3, acquiredJobs.getJobIdBatches().size());
    acquiredJobs.removeJobId("g");
    assertEquals(2, acquiredJobs.getJobIdBatches().size());
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs

    String lockOwner = jobExecutor.getLockOwner();
    int lockTimeInMillis = jobExecutor.getLockTimeInMillis();
    int maxNonExclusiveJobsPerAcquisition = jobExecutor.getMaxJobsPerAcquisition();

    acquiredJobs = new AcquiredJobs();
    List<JobEntity> jobs = commandContext
      .getJobManager()
      .findNextJobsToExecute(new Page(0, maxNonExclusiveJobsPerAcquisition));

    for (JobEntity job: jobs) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.