Package org.activiti.engine

Examples of org.activiti.engine.ProcessEngineConfiguration


      throw new ActivitiIllegalArgumentException("duedate is null");
    }

    timer.insert();
   
    ProcessEngineConfiguration engineConfiguration = Context.getProcessEngineConfiguration();
    if (engineConfiguration.isAsyncExecutorEnabled() == false &&
        timer.getDuedate().getTime() <= (engineConfiguration.getClock().getCurrentTime().getTime())) {
     
      hintJobExecutor(timer);
    }
  }
View Full Code Here


    return (JobEntity) getDbSqlSession().selectOne("selectJob", jobId);
  }
 
  @SuppressWarnings("unchecked")
  public List<JobEntity> findNextJobsToExecute(Page page) {
    ProcessEngineConfiguration processEngineConfig = Context.getProcessEngineConfiguration();
    Date now = processEngineConfig.getClock().getCurrentTime();
    return getDbSqlSession().selectList("selectNextJobsToExecute", now, page);
  }
View Full Code Here

    return getDbSqlSession().selectList("selectNextJobsToExecute", now, page);
  }
 
  @SuppressWarnings("unchecked")
  public List<JobEntity> findNextTimerJobsToExecute(Page page) {
    ProcessEngineConfiguration processEngineConfig = Context.getProcessEngineConfiguration();
    Date now = processEngineConfig.getClock().getCurrentTime();
    return getDbSqlSession().selectList("selectNextTimerJobsToExecute", now, page);
  }
View Full Code Here

    return getDbSqlSession().selectList("selectNextTimerJobsToExecute", now, page);
  }
 
  @SuppressWarnings("unchecked")
  public List<JobEntity> findAsyncJobsDueToExecute(Page page) {
    ProcessEngineConfiguration processEngineConfig = Context.getProcessEngineConfiguration();
    Date now = processEngineConfig.getClock().getCurrentTime();
    return getDbSqlSession().selectList("selectAsyncJobsDueToExecute", now, page);
  }
View Full Code Here

    message.setJobHandlerType(ProcessEventJobHandler.TYPE);
    message.setJobHandlerConfiguration(id);
    message.setTenantId(getTenantId());
   
    GregorianCalendar expireCal = new GregorianCalendar();
    ProcessEngineConfiguration processEngineConfig = Context.getCommandContext().getProcessEngineConfiguration();
    expireCal.setTime(processEngineConfig.getClock().getCurrentTime());
    expireCal.add(Calendar.SECOND, processEngineConfig.getLockTimeAsyncJobWaitTime());
    message.setLockExpirationTime(expireCal.getTime());

    // TODO: support payload
//    if(payload != null) {
//      message.setEventPayload(payload);
View Full Code Here

        imageHeader.addStyleName(ExplorerLayout.STYLE_DETAIL_BLOCK);
        imageHeader.addStyleName(ExplorerLayout.STYLE_NO_LINE);
        addDetailComponent(imageHeader);
      }

      ProcessEngineConfiguration processEngineConfig = ((ProcessEngineImpl) ProcessEngines.getDefaultProcessEngine()).getProcessEngineConfiguration();
      ProcessDiagramGenerator diagramGenerator = processEngineConfig.getProcessDiagramGenerator();

      StreamResource diagram = new ProcessDefinitionImageStreamResourceBuilder()
          .buildStreamResource(processInstance.getId(), processInstance.getProcessDefinitionId(),
              repositoryService, runtimeService, diagramGenerator, processEngineConfig);
View Full Code Here

          LOGGER.error("Error loading process diagram component", e);
        }
      }
     
      if(!didDrawImage && processDefinitionEntity.isGraphicalNotationDefined()) {
        ProcessEngineConfiguration processEngineConfiguration = ProcessEngines.getDefaultProcessEngine().getProcessEngineConfiguration();
        ProcessDiagramGenerator diagramGenerator = processEngineConfiguration.getProcessDiagramGenerator();
        StreamResource diagram = new ProcessDefinitionImageStreamResourceBuilder()
          .buildStreamResource(processInstance, repositoryService, runtimeService, diagramGenerator, processEngineConfiguration);
 
        if(diagram != null) {
          Label header = new Label(i18nManager.getMessage(Messages.PROCESS_HEADER_DIAGRAM));
View Full Code Here

    return parsedModel;
  }
 
  protected void deployProcess(BpmnModel bpmnModel)  {
    byte[] xml = new BpmnXMLConverter().convertToXML(bpmnModel);
    ProcessEngineConfiguration configuration = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
    ProcessEngine processEngine = configuration.buildProcessEngine();
    try {
      Deployment deployment = processEngine.getRepositoryService().createDeployment().name("test").addString("test.bpmn20.xml", new String(xml)).deploy();
      processEngine.getRepositoryService().deleteDeployment(deployment.getId());
    } finally {
      processEngine.close();
View Full Code Here

public class ProcessTestTimeBoundaryEvent {

  private String filename = "/Users/henryyan/work/projects/activiti/activiti-study/src/test/resources/diagrams/TimeBoundaryEvent.bpmn";

  public void startProcessWithJob() throws Exception {
    ProcessEngineConfiguration createStandaloneInMemProcessEngineConfiguration = StandaloneInMemProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
    createStandaloneInMemProcessEngineConfiguration.setJobExecutorActivate(true);
    ProcessEngine processEngine = createStandaloneInMemProcessEngineConfiguration.buildProcessEngine();
    RepositoryService repositoryService = processEngine.getRepositoryService();
    repositoryService.createDeployment().addInputStream("TimeBoundaryEvent.bpmn20.xml",
        new FileInputStream(filename)).deploy();
    RuntimeService runtimeService = processEngine.getRuntimeService();
    Map<String, Object> variableMap = new HashMap<String, Object>();
View Full Code Here

  public static ProcessEngine getEngine(){
    if (engine == null){
      Database ec = JenkowBuilder.descriptor().getDatabase();
      LOG.info("engineConfig="+ec);

      ProcessEngineConfiguration cfg;
      // context for *all* processes. available in exppressions and scripts in the process.
      Map<Object,Object> ctxBeans = new HashMap<Object,Object>();
      ctxBeans.put("log",LOG);
     
      if (ec instanceof H2DemoDatabase) {
        cfg = ProcessEngineConfiguration.createStandaloneInMemProcessEngineConfiguration();
                // we will be sharing this database with Activiti Explorer, so don't force re-creation of the whole DB
                // and honor what's already there
                cfg.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
      } else {
        cfg = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();
       
        Mailer.DescriptorImpl md = Mailer.descriptor();
             System.out.println("mailer config");
        System.out.println("md.getSmtpServer()     -> "+md.getSmtpServer());
        System.out.println("md.getDefaultSuffix()  -> "+md.getDefaultSuffix());
        System.out.println("md.getReplyToAddress() -> "+md.getReplyToAddress());
        System.out.println("md.getSmtpPort()       -> "+md.getSmtpPort());
       
        // set database config
                try {
                    cfg.setDataSource(ec.getDataSource());
                } catch (SQLException e) {
                    throw new Error(e); // TODO: what's the error handling strategy in this method?
                }

                // set other engine config
        cfg.setDatabaseSchemaUpdate("true");
      }
      cfg.setHistory("full"); // so that workflow variables are getting persisted in history
      cfg.setJobExecutorActivate(true);
     
      ClassLoader peCL = JenkowEngine.class.getClassLoader();
      ClassLoader oldCL = Thread.currentThread().getContextClassLoader();
      Thread.currentThread().setContextClassLoader(peCL);
      // set common cfg here.
      ProcessEngineConfigurationImpl peCfg = (ProcessEngineConfigurationImpl)cfg;
            peCfg.setIdentityService(new IdentityServiceImpl());
      peCfg.setBeans(ctxBeans);
      List<BpmnParseListener> preParseListeners = peCfg.getPreParseListeners();
      if (preParseListeners == null){
        preParseListeners = new ArrayList<BpmnParseListener>();
        peCfg.setPreParseListeners(preParseListeners);
      }
      preParseListeners.add(new JenkowBpmnParseListener());
      cfg.setClassLoader(peCL);
      // build engine
      engine = cfg.buildProcessEngine();
      Thread.currentThread().setContextClassLoader(oldCL);
      LOG.info("created Activiti workflow engine v"+engine.VERSION);
      WfUtil.deployAllToEngine();
    }
   
View Full Code Here

TOP

Related Classes of org.activiti.engine.ProcessEngineConfiguration

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.