Package org.activiti.engine

Examples of org.activiti.engine.ProcessEngine


      if (!pathList.isEmpty()) {
        LOGGER.log(Level.FINE, "Found activiti process in bundle " + bundle.getSymbolicName()
                + " with paths: " +  pathList);

        ProcessEngine engine = (ProcessEngine) engineServiceTracker.waitForService(timeout);
        if (engine == null) {
          throw new IllegalStateException("Unable to find a ProcessEngine service");
        }

        RepositoryService service = engine.getRepositoryService();
        DeploymentBuilder builder = service.createDeployment();
        builder.name(bundle.getSymbolicName());
        for (URL url : pathList) {
          InputStream is = url.openStream();
          if (is == null) {
View Full Code Here


    ProcessEngineInfo processEngineInfo = processEngineInfos.get(0);
    assertNull(processEngineInfo.getException());
    assertNotNull(processEngineInfo.getName());
    assertNotNull(processEngineInfo.getResourceUrl());

    ProcessEngine processEngine = ProcessEngines.getProcessEngine(ProcessEngines.NAME_DEFAULT);
    assertNotNull(processEngine);
  }
View Full Code Here

    transactionsExternallyManaged = true;
  }
 
  @Override
  public ProcessEngine buildProcessEngine() {
    ProcessEngine processEngine = super.buildProcessEngine();
    autoDeployResources(processEngine);
    return processEngine;
  }
View Full Code Here

         || (beansOfType.isEmpty())
       ) {
      throw new ActivitiException("no "+ProcessEngine.class.getName()+" defined in the application context "+resource.toString());
    }
   
    ProcessEngine processEngine = beansOfType.values().iterator().next();

    log.fine("==== SPRING PROCESS ENGINE CREATED ==================================================================");
    return processEngine;
  }
View Full Code Here

  }
 
  protected static final Logger LOGGER = Logger.getLogger(ActivitiServletContextListener.class.getName());

  public void contextInitialized(ServletContextEvent event) {
    ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
    if (processEngine == null) {
      LOGGER.log(Level.SEVERE,"Could not start the Activiti Engine");
    }
  }
View Full Code Here

    @Override
    public boolean perform(AbstractBuild build, Launcher launcher, BuildListener listener) throws InterruptedException, FileNotFoundException {
        PrintStream log = listener.getLogger();
        BuildLoggerMap.put(build,log);
       
        ProcessEngine eng = JenkowEngine.getEngine();
        RuntimeService rtSvc = eng.getRuntimeService();
        String procId = null;
        boolean result = true;
        try {
            procId = WfUtil.launchWf(log,workflowName,build.getParent().getName(),build.getNumber());
           
            if (procId != null){
                // TODO 5: is there a better way than polling to detect the termination of a process?
                HistoryService hstSvc = eng.getHistoryService();
                while (true){
                    // TODO 8: can we get a hold of any exception the engine is throwing and show it at least in the log?
                    // TODO 8: builder should log each time the process makes a state change
                    HistoricProcessInstance hProcInst = hstSvc.createHistoricProcessInstanceQuery().processInstanceId(procId).singleResult();
                    if (hProcInst.getEndTime() != null){
View Full Code Here

      thread.interrupt();
    }
  }

  public static ProcessEngine getProcessEngine(String configurationResource) {
    ProcessEngine processEngine = processEngines.get(configurationResource);
    if (processEngine==null) {
      log.fine("==== BUILDING PROCESS ENGINE ========================================================================");
      processEngine = ProcessEngineConfiguration
        .createProcessEngineConfigurationFromResource(configurationResource)
        .buildProcessEngine();
View Full Code Here

    ProcessEngineConfigurationImpl config1 = (ProcessEngineConfigurationImpl) ProcessEngineConfigurationImpl
            .createStandaloneInMemProcessEngineConfiguration()
            .setDataSource(pooledDataSource)
            .setDatabaseSchemaUpdate("NO_CHECK"); // disable auto create/drop schema
    config1.setDatabaseTablePrefix("SCHEMA1.");
    ProcessEngine engine1 = config1.buildProcessEngine();
   
    ProcessEngineConfigurationImpl config2 = (ProcessEngineConfigurationImpl) ProcessEngineConfigurationImpl
            .createStandaloneInMemProcessEngineConfiguration()
            .setDataSource(pooledDataSource)
            .setDatabaseSchemaUpdate("NO_CHECK"); // disable auto create/drop schema       
    config2.setDatabaseTablePrefix("SCHEMA2.");
    ProcessEngine engine2 = config2.buildProcessEngine();
   
    // create the tables in SCHEMA1
    connection = pooledDataSource.getConnection();
    connection.createStatement().execute("set schema SCHEMA1");   
    engine1.getManagementService().databaseSchemaUpgrade(connection, "", "SCHEMA1");
    connection.close();

    // create the tables in SCHEMA2
    connection = pooledDataSource.getConnection();
    connection.createStatement().execute("set schema SCHEMA2");   
    engine2.getManagementService().databaseSchemaUpgrade(connection, "", "SCHEMA2");
    connection.close();

    // if I deploy a process to one engine, it is not visible to the other
    // engine:
    try {
      engine1.getRepositoryService()
        .createDeployment()
        .addClasspathResource("org/activiti/engine/test/db/oneJobProcess.bpmn20.xml")
        .deploy();

      assertEquals(1, engine1.getRepositoryService().createDeploymentQuery().count());
      assertEquals(0, engine2.getRepositoryService().createDeploymentQuery().count());

    } finally {
      engine1.close();
      engine2.close();
    }
  }
View Full Code Here

        }
        return obj;
    }

    protected Object executeCommand() throws Exception {
        ProcessEngine pe = this.getProcessEngine();
        if (pe == null) {
            out().println("Process Engine NOT Found!");
            return null;
        }
        if (this.instanceID == null || this.instanceID.trim().length() == 0) {
View Full Code Here

        this.getPrintHandler().printActivityData(out, this.isVerbose(), this.isQuiet(), actInst);
        out().println("-------------");
    }

    protected void printDetails(String pid) {
        ProcessEngine pe = this.getProcessEngine();
        RepositoryService repo = pe.getRepositoryService();
        RuntimeService rt = pe.getRuntimeService();
        HistoryService hs = pe.getHistoryService();

        ProcessInstance pi = rt.createProcessInstanceQuery().processInstanceId(pid).singleResult();
        HistoricProcessInstance hpi = hs.createHistoricProcessInstanceQuery().processInstanceId(pid)
            .singleResult();
        if (pi == null && hpi == null) {
View Full Code Here

TOP

Related Classes of org.activiti.engine.ProcessEngine

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.