Package org.camunda.bpm.engine.runtime

Examples of org.camunda.bpm.engine.runtime.Job


    // listeners should be fired by now
    assertListenerStartInvoked(pi);
    assertListenerEndInvoked(pi);

    // the process should wait *after* the catch event
    Job job = managementService.createJobQuery().singleResult();
    assertNotNull(job);

    // if the waiting job is executed, the process instance should end
    managementService.executeJob(job.getId());
    assertProcessEnded(pi.getId());
  }
View Full Code Here


    // the service task is not yet invoked
    assertNotListenerStartInvoked(pi);
    assertNotListenerEndInvoked(pi);

    Job job = managementService.createJobQuery().singleResult();
    assertNotNull(job);

    // if the job is executed
    managementService.executeJob(job.getId());

    // the manual task is invoked
    assertListenerStartInvoked(pi);
    assertListenerEndInvoked(pi);

    // and now the process is waiting *after* the manual task
    job = managementService.createJobQuery().singleResult();
    assertNotNull(job);

    // after executing the waiting job, the process instance will end
    managementService.executeJob(job.getId());
    assertProcessEnded(pi.getId());
  }
View Full Code Here

    // listeners should be fired by now
    assertListenerStartInvoked(pi);
    assertListenerEndInvoked(pi);

    // the process should wait *after* the catch event
    Job job = managementService.createJobQuery().singleResult();
    assertNotNull(job);

    // if the waiting job is executed, the process instance should end
    managementService.executeJob(job.getId());
    assertProcessEnded(pi.getId());
  }
View Full Code Here

    // check that no listener is invoked by now
    assertNotListenerStartInvoked(pi);
    assertNotListenerEndInvoked(pi);

    // the process is waiting before the message event
    Job job = managementService.createJobQuery().singleResult();
    assertNotNull(job);

    // execute job to get to the message event
    executeAvailableJobs();

    // now we need to trigger the message to proceed
    runtimeService.correlateMessage("testMessage1");

    // now the listener should be invoked
    assertListenerStartInvoked(pi);
    assertListenerEndInvoked(pi);

    // and now the process is waiting *after* the intermediate catch event
    job = managementService.createJobQuery().singleResult();
    assertNotNull(job);

    // after executing the waiting job, the process instance will end
    managementService.executeJob(job.getId());
    assertProcessEnded(pi.getId());
  }
View Full Code Here

    // listeners should be fired by now
    assertListenerStartInvoked(pi);
    assertListenerEndInvoked(pi);

    // the process should wait *after* the throw event
    Job job = managementService.createJobQuery().singleResult();
    assertNotNull(job);

    // if the waiting job is executed, the process instance should end
    managementService.executeJob(job.getId());
    assertProcessEnded(pi.getId());
  }
View Full Code Here

    // the throw event is not yet invoked
    assertNotListenerStartInvoked(pi);
    assertNotListenerEndInvoked(pi);

    Job job = managementService.createJobQuery().singleResult();
    assertNotNull(job);

    // if the job is executed
    managementService.executeJob(job.getId());

    // the listeners are invoked
    assertListenerStartInvoked(pi);
    assertListenerEndInvoked(pi);

    // and now the process is waiting *after* the throw event
    job = managementService.createJobQuery().singleResult();
    assertNotNull(job);

    // after executing the waiting job, the process instance will end
    managementService.executeJob(job.getId());
    assertProcessEnded(pi.getId());
  }
View Full Code Here

    // no listeners are fired:
    assertNotListenerStartInvoked(pi);
    assertNotListenerEndInvoked(pi);

    // we should wait *before* the gateway:
    Job job = managementService.createJobQuery().singleResult();
    assertNotNull(job);

    // after executing the gateway:
    managementService.executeJob(job.getId());

    // the listeners are fired:
    assertListenerStartInvoked(pi);
    assertListenerEndInvoked(pi);

View Full Code Here

    // no listeners are fired:
    assertNotListenerStartInvoked(pi);
    assertNotListenerEndInvoked(pi);

    // we should wait *before* the gateway:
    Job job = managementService.createJobQuery().singleResult();
    assertNotNull(job);

    // after executing the gateway:
    managementService.executeJob(job.getId());

    // the listeners are fired:
    assertListenerStartInvoked(pi);
    assertListenerEndInvoked(pi);

View Full Code Here

  @Deployment
  public void testAsyncAfterWithExecutionListener() {
    // given an async after job and an execution listener on that task
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testProcess");

    Job job = managementService.createJobQuery().singleResult();
    assertNotNull(job);

    assertNotListenerTakeInvoked(processInstance);

    // when the job is executed
    managementService.executeJob(job.getId());

    // then the process should advance and not recreate the job
    job = managementService.createJobQuery().singleResult();
    assertNull(job);
View Full Code Here

    Task subProcessTask = taskQuery.singleResult();
    assertEquals("Task in subprocess", subProcessTask.getName());

    // When the timer is fired (after 2 hours), two concurrent paths should be created
    Job job = managementService.createJobQuery().singleResult();
    managementService.executeJob(job.getId());

    List<Task> tasksAfterTimer = taskQuery.list();
    assertEquals(2, tasksAfterTimer.size());
    Task taskAfterTimer1 = tasksAfterTimer.get(0);
    Task taskAfterTimer2 = tasksAfterTimer.get(1);
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.runtime.Job

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.