activiti6定时开始事件使用

activiti6定时器
xml:



  
    
    
    
    
    
    
      
        
      
    
    
    
    
  
  
    
      
        
        
          
        
      
      
        
        
          
        
      
      
        
        
          
        
      
      
        
        
          
        
      
      
        
        
          
        
      
      
        
        
        
          
        
      
      
        
        
        
        
          
        
      
      
        
        
        
          
        
      
      
        
        
        
          
        
      
    
  

正常部署启动即可:0/60 * * * * ?为cron表达式,意思为每60秒自动发起一次流程实例。

DeploymentBuilder deploymentBuilder = processEngine.getRepositoryService()
                    .createDeployment()
                    .addClasspathResource("test.bpmn")
            Deployment deployment = deploymentBuilder.deploy();
            ProcessDefinition processDefinition = processEngine.getRepositoryService().createProcessDefinitionQuery().deploymentId(deployment.getId()).singleResult();
            System.out.println("==============" + processDefinition.getId());
            processEngine.getProcessEngineConfiguration().getAsyncExecutor().start();//注意这句话开启定时器,一定要加

你可能感兴趣的:(activiti)