Search in sources :

Example 36 with RepositoryService

use of org.camunda.bpm.engine.RepositoryService in project camunda-bpm-platform by camunda.

the class InvoiceProcessApplication method createDeployment.

@Override
public void createDeployment(String processArchiveName, DeploymentBuilder deploymentBuilder) {
    ProcessEngine processEngine = BpmPlatform.getProcessEngineService().getProcessEngine("default");
    // is deployed the first time
    if (processEngine != null) {
        RepositoryService repositoryService = processEngine.getRepositoryService();
        if (!isProcessDeployed(repositoryService, "invoice")) {
            ClassLoader classLoader = getProcessApplicationClassloader();
            repositoryService.createDeployment(this.getReference()).addInputStream("invoice.v1.bpmn", classLoader.getResourceAsStream("invoice.v1.bpmn")).addInputStream("invoiceBusinessDecisions.dmn", classLoader.getResourceAsStream("invoiceBusinessDecisions.dmn")).addInputStream("review-invoice.cmmn", classLoader.getResourceAsStream("review-invoice.cmmn")).deploy();
        }
    }
}
Also used : ProcessEngine(org.camunda.bpm.engine.ProcessEngine) RepositoryService(org.camunda.bpm.engine.RepositoryService)

Example 37 with RepositoryService

use of org.camunda.bpm.engine.RepositoryService in project camunda-bpm-platform by camunda.

the class TestMultipleClasspathRoots method testMultipleClasspathRoots.

@Test
public void testMultipleClasspathRoots() {
    ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(ProcessEngine.class);
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    ProcessDefinitionQuery query = repositoryService.createProcessDefinitionQuery();
    long count = query.count();
    Assert.assertEquals(1, count);
}
Also used : ProcessDefinitionQuery(org.camunda.bpm.engine.repository.ProcessDefinitionQuery) ProcessEngine(org.camunda.bpm.engine.ProcessEngine) RepositoryService(org.camunda.bpm.engine.RepositoryService) Test(org.junit.Test) AbstractFoxPlatformIntegrationTest(org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)

Example 38 with RepositoryService

use of org.camunda.bpm.engine.RepositoryService in project camunda-bpm-platform by camunda.

the class TestWarDeployment method testDeployProcessArchive.

@Test
public void testDeployProcessArchive() {
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    long count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchive").count();
    Assert.assertEquals(1, count);
}
Also used : RepositoryService(org.camunda.bpm.engine.RepositoryService) AbstractFoxPlatformIntegrationTest(org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest) Test(org.junit.Test)

Example 39 with RepositoryService

use of org.camunda.bpm.engine.RepositoryService in project camunda-bpm-platform by camunda.

the class TestWarDeploymentDeployAllOnSingleChange method testDeployProcessArchive.

@Test
@OperateOnDeployment(value = PA2)
public void testDeployProcessArchive() {
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    long count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchive").count();
    Assert.assertEquals(2, count);
    count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchiveUnchanged").count();
    Assert.assertEquals(2, count);
}
Also used : RepositoryService(org.camunda.bpm.engine.RepositoryService) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) AbstractFoxPlatformIntegrationTest(org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest) Test(org.junit.Test)

Example 40 with RepositoryService

use of org.camunda.bpm.engine.RepositoryService in project camunda-bpm-platform by camunda.

the class TestWarDeploymentDeployChangedOnlyWithJarAsLib method testDeployProcessArchive.

@Test
@OperateOnDeployment(value = PA2)
public void testDeployProcessArchive() {
    ProcessEngine processEngine = ProgrammaticBeanLookup.lookup(ProcessEngine.class);
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    long count = repositoryService.createProcessDefinitionQuery().processDefinitionKey("testDeployProcessArchiveUnchanged").count();
    Assert.assertEquals(1, count);
}
Also used : ProcessEngine(org.camunda.bpm.engine.ProcessEngine) RepositoryService(org.camunda.bpm.engine.RepositoryService) OperateOnDeployment(org.jboss.arquillian.container.test.api.OperateOnDeployment) Test(org.junit.Test) AbstractFoxPlatformIntegrationTest(org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)

Aggregations

RepositoryService (org.camunda.bpm.engine.RepositoryService)57 Test (org.junit.Test)24 AbstractFoxPlatformIntegrationTest (org.camunda.bpm.integrationtest.util.AbstractFoxPlatformIntegrationTest)23 ProcessEngine (org.camunda.bpm.engine.ProcessEngine)13 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)10 OperateOnDeployment (org.jboss.arquillian.container.test.api.OperateOnDeployment)9 InvalidRequestException (org.camunda.bpm.engine.rest.exception.InvalidRequestException)8 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)6 ProcessApplicationService (org.camunda.bpm.ProcessApplicationService)5 ProcessApplicationDeploymentInfo (org.camunda.bpm.application.ProcessApplicationDeploymentInfo)5 ProcessApplicationInfo (org.camunda.bpm.application.ProcessApplicationInfo)5 CommandContext (org.camunda.bpm.engine.impl.interceptor.CommandContext)5 ProcessApplicationReference (org.camunda.bpm.application.ProcessApplicationReference)4 RuntimeService (org.camunda.bpm.engine.RuntimeService)4 Deployment (org.camunda.bpm.engine.repository.Deployment)4 ProcessDefinitionQuery (org.camunda.bpm.engine.repository.ProcessDefinitionQuery)4 InputStream (java.io.InputStream)3 ArrayList (java.util.ArrayList)3 NotFoundException (org.camunda.bpm.engine.exception.NotFoundException)3 NotValidException (org.camunda.bpm.engine.exception.NotValidException)3