Package org.activiti.engine.runtime

Examples of org.activiti.engine.runtime.JobQuery


    commandExecutor.execute(new CancelJobsCmd(messageId));
    super.tearDown();
  }
 
  public void testQueryByNoCriteria() {
    JobQuery query = managementService.createJobQuery();
    verifyQueryResults(query, 4);
  }
View Full Code Here


    JobQuery query = managementService.createJobQuery();
    verifyQueryResults(query, 4);
  }
 
  public void testQueryByProcessInstanceId() {
    JobQuery query = managementService.createJobQuery().processInstanceId(processInstanceIdOne);
    verifyQueryResults(query, 1);
  }
View Full Code Here

    JobQuery query = managementService.createJobQuery().processInstanceId(processInstanceIdOne);
    verifyQueryResults(query, 1);
  }
 
  public void testQueryByInvalidProcessInstanceId() {
    JobQuery query = managementService.createJobQuery().processInstanceId("invalid");
    verifyQueryResults(query, 0);
   
    try {
      managementService.createJobQuery().processInstanceId(null);
      fail();
View Full Code Here

    } catch (ActivitiIllegalArgumentException e) {}
  }
 
  public void testQueryByExecutionId() {
    Job job = managementService.createJobQuery().processInstanceId(processInstanceIdOne).singleResult();
    JobQuery query = managementService.createJobQuery().executionId(job.getExecutionId());
    assertEquals(query.singleResult().getId(), job.getId());
    verifyQueryResults(query, 1);
  }
View Full Code Here

    assertEquals(query.singleResult().getId(), job.getId());
    verifyQueryResults(query, 1);
  }
 
  public void testQueryByInvalidExecutionId() {
    JobQuery query = managementService.createJobQuery().executionId("invalid");
    verifyQueryResults(query, 0);
   
    try {
      managementService.createJobQuery().executionId(null).list();
      fail();
View Full Code Here

      fail();
    } catch (ActivitiIllegalArgumentException e) {}
  }
 
  public void testQueryByRetriesLeft() {
    JobQuery query = managementService.createJobQuery().withRetriesLeft();
    verifyQueryResults(query, 4);
   
    setRetries(processInstanceIdOne, 0);
    // Re-running the query should give only 3 jobs now, since one job has retries=0
    verifyQueryResults(query, 3);
View Full Code Here

    verifyQueryResults(query, 3);
  }
 
  public void testQueryByExecutable() {
    processEngineConfiguration.getClock().setCurrentTime(new Date(timerThreeFireTime.getTime() + ONE_SECOND)); // all jobs should be executable at t3 + 1hour.1second
    JobQuery query = managementService.createJobQuery().executable();
    verifyQueryResults(query, 4);
   
    // Setting retries of one job to 0, makes it non-executable
    setRetries(processInstanceIdOne, 0);
    verifyQueryResults(query, 3);
View Full Code Here

    processEngineConfiguration.getClock().setCurrentTime(testStartTime);
    verifyQueryResults(query, 1); // 1, since a message is always executable when retries > 0
  }
 
  public void testQueryByOnlyTimers() {
    JobQuery query = managementService.createJobQuery().timers();
    verifyQueryResults(query, 3);
  }
View Full Code Here

    JobQuery query = managementService.createJobQuery().timers();
    verifyQueryResults(query, 3);
  }
 
  public void testQueryByOnlyMessages() {
    JobQuery query = managementService.createJobQuery().messages();
    verifyQueryResults(query, 1);
  }
View Full Code Here

      assertTextPresent("Cannot combine onlyTimers() with onlyMessages() in the same query", e.getMessage());
    }
  }
 
  public void testQueryByDuedateLowerThan() {
    JobQuery query = managementService.createJobQuery().duedateLowerThan(testStartTime);
    verifyQueryResults(query, 0);
   
    query = managementService.createJobQuery().duedateLowerThan(new Date(timerOneFireTime.getTime() + ONE_SECOND));
    verifyQueryResults(query, 1);
   
View Full Code Here

TOP

Related Classes of org.activiti.engine.runtime.JobQuery

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.