Package org.activiti.engine

Examples of org.activiti.engine.ProcessEngine


  public void afterDeploymentValidation(@Observes AfterDeploymentValidation event, BeanManager beanManager) {
    try {  
      logger.info("Initializing activiti-cdi.");     
      // initialize the process engine
      ProcessEngine processEngine = lookupProcessEngine(beanManager);     
      // deploy the processes if engine was set up correctly
      deployProcesses(processEngine);     
    } catch (Exception e) {
      // interpret engine initialization problems as definition errors
      event.addDeploymentProblem(e);
View Full Code Here


      public int compare(ProcessEngineLookup o1, ProcessEngineLookup o2) {      
        return (-1)*((Integer)o1.getPrecedence()).compareTo(o2.getPrecedence());
      }     
    });
   
    ProcessEngine processEngine = null;
   
    for (ProcessEngineLookup processEngineLookup : discoveredLookups) {
      processEngine = processEngineLookup.getProcessEngine();
      if(processEngine != null) {
        this.processEngineLookup = processEngineLookup;
View Full Code Here

      }

      if (!pathList.isEmpty()) {
        LOGGER.debug("Found activiti process in bundle {} with paths: {}", bundle.getSymbolicName(),  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

    protected void initializeProcessEngine() {
        ContextConfiguration contextConfiguration = getClass().getAnnotation(ContextConfiguration.class);
        String[] value = contextConfiguration.value();
        boolean hasOneArg = value != null && value.length == 1;
        String key = hasOneArg ? value[0] : ProcessEngine.class.getName();
        ProcessEngine engine = this.cachedProcessEngines.containsKey(key) ?
                this.cachedProcessEngines.get(key) : this.applicationContext.getBean(ProcessEngine.class);

        this.cachedProcessEngines.put(key, engine);
        this.processEngine = engine;
    }
View Full Code Here

    public void mvcEndpoint() throws Throwable {

        AnnotationConfigEmbeddedWebApplicationContext applicationContext =
            new AnnotationConfigEmbeddedWebApplicationContext(CallbackEmbeddedContainerCustomizer.class, EmbeddedContainerConfiguration.class, EndpointConfiguration.class);

        ProcessEngine processEngine = applicationContext.getBean(ProcessEngine.class);
        org.junit.Assert.assertNotNull("the processEngine should not be null", processEngine);

        ProcessEngineEndpoint processEngineEndpoint =
                applicationContext.getBean(ProcessEngineEndpoint.class);
        org.junit.Assert.assertNotNull("the processEngineEndpoint should not be null", processEngineEndpoint);
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.debug("==== SPRING PROCESS ENGINE CREATED ==================================================================");
        return processEngine;
    }
View Full Code Here

    public void testLaunchingGatewayProcessDefinition() throws Exception {
        AnnotationConfigApplicationContext applicationContext = this.context(InboundGatewayConfiguration.class);

        RepositoryService repositoryService = applicationContext.getBean(RepositoryService.class);
        RuntimeService runtimeService = applicationContext.getBean(RuntimeService.class);
        ProcessEngine processEngine = applicationContext.getBean(ProcessEngine.class);

        Assert.assertNotNull("the process engine should not be null", processEngine);
        Assert.assertNotNull("we should have a default repositoryService included", repositoryService);
        String integrationGatewayProcess = "integrationGatewayProcess";
        List<ProcessDefinition> processDefinitionList = repositoryService.createProcessDefinitionQuery()
View Full Code Here

  }
 
  // WARNING!!! DemoWare!!!
  public static void generateTaskDurationReport(String processDefinitionId) {
   
    ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
    RepositoryService repositoryService = processEngine.getRepositoryService();
   
    // Fetch process definition
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
            .processDefinitionId(processDefinitionId).singleResult();
   
View Full Code Here

 
  @Test
  public void http() throws Exception {
    Assert.assertTrue(muleContext.isStarted());
   
    ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
    Deployment deployment = processEngine.getRepositoryService().createDeployment()
        .addClasspathResource("org/activiti/mule/testHttp.bpmn20.xml")
        .deploy();
    RuntimeService runtimeService = processEngine.getRuntimeService();
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("muleProcess");
    Assert.assertFalse(processInstance.isEnded());
    Object result = runtimeService.getVariable(processInstance.getProcessInstanceId(), "theVariable");
    Assert.assertEquals(20, result);
    runtimeService.deleteProcessInstance(processInstance.getId(), "test");
    processEngine.getHistoryService().deleteHistoricProcessInstance(processInstance.getId());
    processEngine.getRepositoryService().deleteDeployment(deployment.getId());
    assertAndEnsureCleanDb(processEngine);
    ProcessEngines.destroy();
  }
View Full Code Here

 
  @Test
  public void httpWithBasicAuth() throws Exception {
    Assert.assertTrue(muleContext.isStarted());
   
    ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
    Deployment deployment = processEngine.getRepositoryService().createDeployment()
         .addClasspathResource("org/activiti/mule/testHttpBasicAuth.bpmn20.xml")
         .deploy();
    RuntimeService runtimeService = processEngine.getRuntimeService();
    ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("muleProcess");
    Assert.assertFalse(processInstance.isEnded());
    Object result = runtimeService.getVariable(processInstance.getProcessInstanceId(), "theVariable");
    Assert.assertEquals(10, result);
    runtimeService.deleteProcessInstance(processInstance.getId(), "test");
    processEngine.getHistoryService().deleteHistoricProcessInstance(processInstance.getId());
    processEngine.getRepositoryService().deleteDeployment(deployment.getId());
    assertAndEnsureCleanDb(processEngine);
    ProcessEngines.destroy();
  }
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.