Package org.camunda.bpm.engine.management

Examples of org.camunda.bpm.engine.management.JobDefinitionQuery


    // suspend the job definition
    managementService.suspendJobDefinitionByProcessDefinitionKey(processDefinition.getKey(), false);

    // then
    // there exists a suspended job definition
    JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery().suspended();

    assertEquals(1, jobDefinitionQuery.count());

    JobDefinition suspendedJobDefinition = jobDefinitionQuery.singleResult();

    assertEquals(jobDefinition.getId(), suspendedJobDefinition.getId());
    assertTrue(suspendedJobDefinition.isSuspended());

    // the corresponding job is still active
View Full Code Here


    // the process definition will be activated
    repositoryService.activateProcessDefinitionByKey(processDefinition.getKey(), true, null);

    // then
    // the job definition should be activated...
    JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery();

    assertEquals(0, jobDefinitionQuery.suspended().count());
    assertEquals(1, jobDefinitionQuery.active().count());

    JobDefinition suspendedJobDefinition = jobDefinitionQuery.active().singleResult();

    assertEquals(jobDefinition.getId(), suspendedJobDefinition.getId());
    assertFalse(suspendedJobDefinition.isSuspended());

    // ...and the corresponding job should be activated too
View Full Code Here

    // suspend the job definition
    managementService.suspendJobDefinitionByProcessDefinitionKey(processDefinition.getKey(), true);

    // then
    // there exists a suspended job definition...
    JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery().suspended();

    assertEquals(1, jobDefinitionQuery.count());

    JobDefinition suspendedJobDefinition = jobDefinitionQuery.singleResult();

    assertEquals(jobDefinition.getId(), suspendedJobDefinition.getId());
    assertTrue(suspendedJobDefinition.isSuspended());

    // ...and a suspended job of the provided job definition
View Full Code Here

    // suspend the job definition
    managementService.suspendJobDefinitionByProcessDefinitionKey(processDefinition.getKey(), false, null);

    // then
    // there exists a suspended job definition
    JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery().suspended();

    assertEquals(1, jobDefinitionQuery.count());

    JobDefinition suspendedJobDefinition = jobDefinitionQuery.singleResult();

    assertEquals(jobDefinition.getId(), suspendedJobDefinition.getId());
    assertTrue(suspendedJobDefinition.isSuspended());

    // the corresponding job is still active
View Full Code Here

    // activate the job definition
    managementService.activateJobDefinitionById(jobDefinition.getId());

    // then
    // there exists a active job definition
    JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery();

    assertEquals(1, jobDefinitionQuery.active().count());
    assertEquals(0, jobDefinitionQuery.suspended().count());

    JobDefinition activeJobDefinition = jobDefinitionQuery.active().singleResult();

    assertEquals(jobDefinition.getId(), activeJobDefinition.getId());

    // the corresponding job is still suspended
    JobQuery jobQuery = managementService.createJobQuery();
View Full Code Here

    // activate the job definition
    managementService.activateJobDefinitionById(jobDefinition.getId(), false);

    // then
    // there exists a active job definition
    JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery();

    assertEquals(0, jobDefinitionQuery.suspended().count());
    assertEquals(1, jobDefinitionQuery.active().count());

    JobDefinition activeJobDefinition = jobDefinitionQuery.active().singleResult();

    assertEquals(jobDefinition.getId(), activeJobDefinition.getId());
    assertFalse(activeJobDefinition.isSuspended());

    // the corresponding job is still suspended
View Full Code Here

    // activate the job definition
    managementService.activateJobDefinitionById(jobDefinition.getId(), true);

    // then
    // there exists an active job definition...
    JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery();

    assertEquals(0, jobDefinitionQuery.suspended().count());
    assertEquals(1, jobDefinitionQuery.active().count());

    JobDefinition activeJobDefinition = jobDefinitionQuery.active().singleResult();

    assertEquals(jobDefinition.getId(), activeJobDefinition.getId());
    assertFalse(activeJobDefinition.isSuspended());

    // ...and a active job of the provided job definition
View Full Code Here

    // activate the job definition
    managementService.activateJobDefinitionById(jobDefinition.getId(), false, null);

    // then
    // there exists an active job definition
    JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery();

    assertEquals(0, jobDefinitionQuery.suspended().count());
    assertEquals(1, jobDefinitionQuery.active().count());

    JobDefinition activeJobDefinition = jobDefinitionQuery.active().singleResult();

    assertEquals(jobDefinition.getId(), activeJobDefinition.getId());
    assertFalse(activeJobDefinition.isSuspended());

    // the corresponding job is still suspended
View Full Code Here

    // activate the job definition
    managementService.activateJobDefinitionById(jobDefinition.getId(), true, null);

    // then
    // there exists an active job definition...
    JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery();

    assertEquals(0, jobDefinitionQuery.suspended().count());
    assertEquals(1, jobDefinitionQuery.active().count());

    JobDefinition activeJobDefinition = jobDefinitionQuery.active().singleResult();

    assertEquals(jobDefinition.getId(), activeJobDefinition.getId());
    assertFalse(activeJobDefinition.isSuspended());

    // ...and an active job of the provided job definition
View Full Code Here

    // activate the job definition
    managementService.activateJobDefinitionById(jobDefinition.getId(), false, new Date(oneWeekFromStartTime));

    // then
    // the job definition is still suspended
    JobDefinitionQuery jobDefinitionQuery = managementService.createJobDefinitionQuery();
    assertEquals(0, jobDefinitionQuery.active().count());
    assertEquals(1, jobDefinitionQuery.suspended().count());

    // there exists a job for the delayed activation execution
    JobQuery jobQuery = managementService.createJobQuery();

    Job delayedActivationJob = jobQuery.timers().active().singleResult();
    assertNotNull(delayedActivationJob);

    // execute job
    managementService.executeJob(delayedActivationJob.getId());

    // the job definition should be suspended
    assertEquals(1, jobDefinitionQuery.active().count());
    assertEquals(0, jobDefinitionQuery.suspended().count());

    JobDefinition activeJobDefinition = jobDefinitionQuery.active().singleResult();

    assertEquals(jobDefinition.getId(), activeJobDefinition.getId());
    assertFalse(activeJobDefinition.isSuspended());

    // the corresponding job is still suspended
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.management.JobDefinitionQuery

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.