Package org.camunda.bpm.engine.impl.jobexecutor

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


    // 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

  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

    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

Related Classes of org.camunda.bpm.engine.impl.jobexecutor.AcquiredJobs

Copyright © 2018 www.massapicom. 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.