Examples of ProcessEngine


Examples of org.camunda.bpm.engine.ProcessEngine

    return result;

  }

  public static void assertDiagramIsDeployed(boolean deployed, Class<?> clazz, String expectedDiagramResource, String processDefinitionKey) throws IOException {
    ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(ProcessEngine.class);
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery()
      .processDefinitionKey(processDefinitionKey)
      .singleResult();
    assertNotNull(processDefinition);
View Full Code Here

Examples of org.camunda.bpm.engine.ProcessEngine

  @Test
  @OperateOnDeployment("test1")
  public void testNonExistingEngineRetrieval() {
   
    ProcessEngineService engineService = BpmPlatform.getProcessEngineService();
    ProcessEngine engine = engineService.getProcessEngine("aNonExistingEngineName");
    Assert.assertNull(engine);
  }
View Full Code Here

Examples of org.camunda.bpm.engine.ProcessEngine

      .addAsLibrary(DeploymentHelper.getEngineCdi());
  }
 
  @Test
  public void testTwoPasAsLib() {
    ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(ProcessEngine.class);
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    long count = repositoryService.createProcessDefinitionQuery()
      .processDefinitionKey("process1")
      .count();   
    Assert.assertEquals(1, count);
   
View Full Code Here

Examples of org.camunda.bpm.engine.ProcessEngine

      .addAsLibrary(DeploymentHelper.getEngineCdi());
  }
 
  @Test
  public void testPaAsEjbModule() {
    ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(ProcessEngine.class);
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    long count = repositoryService.createProcessDefinitionQuery()
      .processDefinitionKey("paAsEjbModule-process")
      .count();   
    Assert.assertEquals(1, count);  
  }
View Full Code Here

Examples of org.camunda.bpm.engine.ProcessEngine

      .addAsLibrary(DeploymentHelper.getEngineCdi());
  }
     
  @Test
  public void testOnePaAsLib() {
    ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(ProcessEngine.class);
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    long count = repositoryService.createProcessDefinitionQuery()
      .processDefinitionKey("testDeployProcessArchive")
      .count();
   
    Assert.assertEquals(1, count);
View Full Code Here

Examples of org.camunda.bpm.engine.ProcessEngine

   
  }
 
  @Test
  public void testDeployProcessArchive() {
    ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(ProcessEngine.class);
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    long count = repositoryService.createProcessDefinitionQuery()
      .processDefinitionKey("testDeployProcessArchive")
      .count();
   
    Assert.assertEquals(1, count);
View Full Code Here

Examples of org.camunda.bpm.engine.ProcessEngine

    // start a spring application context
    AbstractApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/camunda/bpm/engine/spring/test/application/SpringProcessArchiveDeploymentTest-context.xml");
    applicationContext.start();

    // assert the process archive is deployed:
    ProcessEngine processEngine = BpmPlatform.getDefaultProcessEngine();
    Assert.assertNotNull(processEngine.getRepositoryService().createDeploymentQuery().deploymentName("pa").singleResult());

    applicationContext.close();

    // assert the process is undeployed
    Assert.assertNull(processEngine.getRepositoryService().createDeploymentQuery().deploymentName("pa").singleResult());

  }
View Full Code Here

Examples of org.camunda.bpm.engine.ProcessEngine

    // this test verifies that a process application is able to register a deployment from the @PostDeploy callback:

    AbstractApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/camunda/bpm/engine/spring/test/application/PostDeployRegistrationPaTest-context.xml");
    applicationContext.start();

    ProcessEngine processEngine = BpmPlatform.getDefaultProcessEngine();

    // create a manual deployment:
    Deployment deployment = processEngine.getRepositoryService()
      .createDeployment()
      .addClasspathResource("org/camunda/bpm/engine/spring/test/application/process.bpmn20.xml")
      .deploy();

    // lookup the process application spring bean:
    PostDeployRegistrationPa processApplication = applicationContext.getBean("customProcessApplicaiton", PostDeployRegistrationPa.class);

    Assert.assertFalse(processApplication.isPostDeployInvoked());
    processApplication.deploy();
    Assert.assertTrue(processApplication.isPostDeployInvoked());

    // the process application was not invoked
    Assert.assertFalse(processApplication.isInvoked());

    // start process instance:
    processEngine.getRuntimeService()
      .startProcessInstanceByKey("startToEnd");

    // now the process application was invoked:
    Assert.assertTrue(processApplication.isInvoked());

    // undeploy PA
    Assert.assertFalse(processApplication.isPreUndeployInvoked());
    processApplication.undeploy();
    Assert.assertTrue(processApplication.isPreUndeployInvoked());

    // manually undeploy the process
    processEngine.getRepositoryService()
      .deleteDeployment(deployment.getId(), true);

    applicationContext.close();

  }
View Full Code Here

Examples of org.camunda.bpm.engine.ProcessEngine

*/
public class CmmnDeployerTest extends PluggableProcessEngineTestCase {

  public void testCmmnDeployment() {
    ProcessEngineConfigurationImpl config = (ProcessEngineConfigurationImpl) ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("camunda.cfg.xml");
    ProcessEngine engine = config.buildProcessEngine();

    String deploymentId = engine
        .getRepositoryService()
        .createDeployment()
        .addClasspathResource("org/camunda/bpm/engine/test/cmmn/deployment/CmmnDeploymentTest.testSimpleDeployment.cmmn")
        .deploy()
        .getId();

    // there should be one deployment
    RepositoryService repositoryService = engine.getRepositoryService();
    DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();

    assertEquals(1, deploymentQuery.count());

    // there should be one case definition
    CaseDefinitionQuery query = engine.getRepositoryService().createCaseDefinitionQuery();
    assertEquals(1, query.count());

    CaseDefinition caseDefinition = query.singleResult();
    assertEquals("Case_1", caseDefinition.getKey());

    engine.getRepositoryService().deleteDeployment(deploymentId);
  }
View Full Code Here

Examples of org.camunda.bpm.engine.ProcessEngine

            .as(JavaArchive.class));
  }

  @Test
  public void testPAGroovyProcessEnginePlugin() {
    ProcessEngine groovyEngine = processEngineService.getProcessEngine("groovy");
    Assert.assertNotNull(groovyEngine);

    ProcessInstance pi = groovyEngine.getRuntimeService().startProcessInstanceByKey("groovy");
    HistoricProcessInstance hpi = groovyEngine.getHistoryService()
        .createHistoricProcessInstanceQuery().processDefinitionKey("groovy").finished().singleResult();
    assertEquals(pi.getId(), hpi.getId());
  }
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.