Package org.activiti.engine.impl.interceptor

Examples of org.activiti.engine.impl.interceptor.CommandExecutor.execute()


  }

  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(DbSqlSession.class)
          .dbSchemaUpdate();
        return null;
View Full Code Here


//        while (!isInterrupted) {
              isWaiting.set(false);
          int maxJobsPerAcquisition = jobExecutor.getMaxJobsPerAcquisition();

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

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

             
              isJobAdded = false;
             
              // check if the next timer should fire before the normal sleep time is over
              Date duedate = new Date(SimulationRunContext.getClock().getCurrentTime().getTime() + millisToWait);
              List<TimerEntity> nextTimers = commandExecutor.execute(new GetUnlockedTimersByDuedateCmd(duedate, new Page(0, 1)));
             
              if (!nextTimers.isEmpty()) {
              long millisTillNextTimer = nextTimers.get(0).getDuedate().getTime() - SimulationRunContext.getClock().getCurrentTime().getTime();
                if (millisTillNextTimer < millisToWait && millisTillNextTimer != 0) {
                  millisToWait = millisTillNextTimer;
View Full Code Here

   
    @Override
    public void run() {
      CommandExecutor commandExecutor = ((ProcessEngineConfigurationImpl) ProcessEngines.getDefaultProcessEngine()
          .getProcessEngineConfiguration()).getCommandExecutor();
      commandExecutor.execute(new ExecuteAsyncJobCmd(job));
    }
   
  }

  public String getLockOwner() {
View Full Code Here

      log.error(outputMessage.toString());
     
      log.info("dropping and recreating db");
     
      CommandExecutor commandExecutor = ((ProcessEngineImpl)processEngine).getProcessEngineConfiguration().getCommandExecutor();
      commandExecutor.execute(new Command<Object>() {
        public Object execute(CommandContext commandContext) {
          DbSqlSession session = commandContext.getSession(DbSqlSession.class);
          session.dbSchemaDrop();
          session.dbSchemaCreate();
          return null;
View Full Code Here

    // Acquire job by running the acquire command manually
    ProcessEngineImpl processEngineImpl = (ProcessEngineImpl) processEngine;
    AcquireTimerJobsCmd acquireJobsCmd = new AcquireTimerJobsCmd("testLockOwner", 60000, 5);
    CommandExecutor commandExecutor = processEngineImpl.getProcessEngineConfiguration().getCommandExecutor();
    commandExecutor.execute(acquireJobsCmd);
   
    // Try to delete the job. This should fail.
    try {
      managementService.deleteJob(timerJob.getId());
      fail();
View Full Code Here

    } catch (ActivitiException e) {}
  }
 
  private void createJobWithoutExceptionMsg() {
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
    commandExecutor.execute(new Command<Void>() {
      public Void execute(CommandContext commandContext) {
        JobEntityManager jobManager = commandContext.getJobEntityManager();
       
        timerEntity = new TimerEntity();
        timerEntity.setLockOwner(UUID.randomUUID().toString());
View Full Code Here

   
  }
 
  private void createJobWithoutExceptionStacktrace() {
    CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
    commandExecutor.execute(new Command<Void>() {
      public Void execute(CommandContext commandContext) {
        JobEntityManager jobManager = commandContext.getJobEntityManager();
       
        timerEntity = new TimerEntity();
        timerEntity.setLockOwner(UUID.randomUUID().toString());
View Full Code Here

   
 
 
  private void deleteJobInDatabase() {
      CommandExecutor commandExecutor = processEngineConfiguration.getCommandExecutor();
      commandExecutor.execute(new Command<Void>() {
        public Void execute(CommandContext commandContext) {
         
          timerEntity.delete();         
          return null;
        }
View Full Code Here

     
      log.info("dropping and recreating db");
     
      CommandExecutor commandExecutor = ((ProcessEngineImpl) processEngine).getProcessEngineConfiguration().getCommandExecutor();
      CommandConfig config = new CommandConfig().transactionNotSupported();
      commandExecutor.execute(config, new Command<Object>() {
        public Object execute(CommandContext commandContext) {
          DbSqlSession session = commandContext.getSession(DbSqlSession.class);
          session.dbSchemaDrop();
          session.dbSchemaCreate();
          return null;
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.