Examples of CommandExecutor


Examples of org.camunda.bpm.engine.impl.interceptor.CommandExecutor

    }
  }

  private void cleanDB() {
    String jobId = managementService.createJobQuery().singleResult().getId();
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
    commandExecutor.execute(new DeleteJobsCmd(jobId));
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.interceptor.CommandExecutor

      fail();
    } catch (ProcessEngineException e) {}
  }

  private void createJobWithoutExceptionMsg() {
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
    commandExecutor.execute(new Command<Void>() {
      public Void execute(CommandContext commandContext) {
        JobManager jobManager = commandContext.getJobManager();

        timerEntity = new TimerEntity();
        timerEntity.setLockOwner(UUID.randomUUID().toString());
View Full Code Here

Examples of org.camunda.bpm.engine.impl.interceptor.CommandExecutor

    });

  }

  private void createJobWithoutExceptionStacktrace() {
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
    commandExecutor.execute(new Command<Void>() {
      public Void execute(CommandContext commandContext) {
        JobManager jobManager = commandContext.getJobManager();

        timerEntity = new TimerEntity();
        timerEntity.setLockOwner(UUID.randomUUID().toString());
View Full Code Here

Examples of org.camunda.bpm.engine.impl.interceptor.CommandExecutor

    });

  }

  private void deleteJobInDatabase() {
      CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
      commandExecutor.execute(new Command<Void>() {
        public Void execute(CommandContext commandContext) {

          timerEntity.delete();

          List<HistoricIncident> historicIncidents = Context
View Full Code Here

Examples of org.camunda.bpm.engine.impl.interceptor.CommandExecutor

      jobExecutionFailed = false;

      if (currentProcessEngine != null) {

        try {
          final CommandExecutor commandExecutor = currentProcessEngine.getProcessEngineConfiguration()
              .getCommandExecutorTxRequired();

          AcquiredJobs acquiredJobs = commandExecutor.execute(jobExecutor.getAcquireJobsCmd());

          for (List<String> jobIds : acquiredJobs.getJobIdBatches()) {
            jobExecutor.executeJobs(jobIds, currentProcessEngine);
          }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.interceptor.CommandExecutor

    Job job1 = managementService.createJobQuery().processInstanceId(instance1.getId()).singleResult();
    Job job2 = managementService.createJobQuery().processInstanceId(instance2.getId()).singleResult();


    // the deployment aware configuration should only return the jobs of the registered deployments
    CommandExecutor commandExecutor = engine1Configuration.getCommandExecutorTxRequired();
    AcquiredJobs acquiredJobs = commandExecutor.execute(new AcquireJobsCmd(jobExecutor1));

    Assert.assertEquals(1, acquiredJobs.size());
    Assert.assertTrue(acquiredJobs.contains(job1.getId()));
    Assert.assertFalse(acquiredJobs.contains(job2.getId()));
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.interceptor.CommandExecutor

    Job job1 = managementService.createJobQuery().processInstanceId(instance1.getId()).singleResult();
    Job job2 = managementService.createJobQuery().processInstanceId(instance2.getId()).singleResult();

    // the deployment unaware configuration should return both jobs
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();
    processEngineConfiguration.setJobExecutorDeploymentAware(false);
    try {
      AcquiredJobs acquiredJobs = commandExecutor.execute(new AcquireJobsCmd(defaultJobExecutor));

      Assert.assertEquals(2, acquiredJobs.size());
      Assert.assertTrue(acquiredJobs.contains(job1.getId()));
      Assert.assertTrue(acquiredJobs.contains(job2.getId()));
    } finally {
View Full Code Here

Examples of org.camunda.bpm.engine.impl.interceptor.CommandExecutor

    final ExceptionThrowingCmd innerCommand2 = new ExceptionThrowingCmd(new IdentifiableRuntimeException(2));

    try {
      processEngineConfiguration.getCommandExecutorTxRequired().execute(new Command<Object>() {
        public Object execute(CommandContext commandContext) {
          CommandExecutor commandExecutor = Context.getProcessEngineConfiguration().getCommandExecutorTxRequired();

          commandExecutor.execute(innerCommand1);
          commandExecutor.execute(innerCommand2);

          return null;
        }
      });
View Full Code Here

Examples of org.camunda.bpm.engine.impl.interceptor.CommandExecutor

  public void testCommandContextNestedTryCatch() {
    final ExceptionThrowingCmd innerCommand = new ExceptionThrowingCmd(new IdentifiableRuntimeException(1));

    processEngineConfiguration.getCommandExecutorTxRequired().execute(new Command<Object>() {
      public Object execute(CommandContext commandContext) {
        CommandExecutor commandExecutor = Context.getProcessEngineConfiguration().getCommandExecutorTxRequired();

        try {
          commandExecutor.execute(innerCommand);
          fail("exception expected to pop up during execution of inner command");
        } catch (IdentifiableRuntimeException e) {
          // happy path
          assertNull("the exception should not have been propagated to this command's context",
              Context.getCommandInvocationContext().getThrowable());
View Full Code Here

Examples of org.camunda.bpm.engine.impl.interceptor.CommandExecutor

    public Void execute(CommandContext commandContext) {
      assertEquals(this, Context.getCommandInvocationContext().getCommand());

      if (innerCommand != null) {
        CommandExecutor commandExecutor = Context.getProcessEngineConfiguration().getCommandExecutorTxRequired();
        commandExecutor.execute(innerCommand);

        // should still be correct after command invocation
        assertEquals(this, Context.getCommandInvocationContext().getCommand());
      }
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.