Package org.camunda.bpm.engine.impl.interceptor

Examples of org.camunda.bpm.engine.impl.interceptor.CommandExecutor.execute()


    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


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

    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

      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

    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

    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

  }

  public static void main(String[] args) {
    ProcessEngineImpl processEngine = (ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine();
    CommandExecutor commandExecutor = processEngine.getProcessEngineConfiguration().getCommandExecutorTxRequired();
    commandExecutor.execute(new Command<Object> (){
      public Object execute(CommandContext commandContext) {
        commandContext
          .getSession(PersistenceSession.class)
          .dbSchemaPrune();
        return null;
View Full Code Here

    final CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutorTxRequired();

    try {
      // we create a timer entity
      commandExecutor.execute(new Command<Void>() {
        public Void execute(CommandContext commandContext) {
          commandContext.getJobManager().insert(timer);
          return null;
        }
      });
View Full Code Here

          return null;
        }
      });

      // we change the suspension state to null
      commandExecutor.execute(new Command<Void>() {
        public Void execute(CommandContext commandContext) {
          Connection connection = null;
          Statement statement = null;
          ResultSet rs = null;
View Full Code Here

          return null;
        }
      });

      // it is picked up by the acquisition queries
      commandExecutor.execute(new Command<Void>() {
        public Void execute(CommandContext commandContext) {
          JobManager jobManager = commandContext.getJobManager();

          List<JobEntity> executableJobs = jobManager.findNextJobsToExecute(new Page(0, 1));
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.