Search in sources :

Example 16 with DeploymentBuilder

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

the class ProcessDefinitionCandidateTest method shouldPropagateTenantIdToCandidateStarterUser.

@Test
public void shouldPropagateTenantIdToCandidateStarterUser() {
    // when
    DeploymentBuilder builder = repositoryService.createDeployment().addClasspathResource(CANDIDATE_STARTER_USER).tenantId(TENANT_ONE);
    testRule.deploy(builder);
    // then
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
    List<IdentityLink> links = repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId());
    assertEquals(1, links.size());
    IdentityLink link = links.get(0);
    assertNotNull(link.getTenantId());
    assertEquals(TENANT_ONE, link.getTenantId());
}
Also used : ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) IdentityLink(org.camunda.bpm.engine.task.IdentityLink) DeploymentBuilder(org.camunda.bpm.engine.repository.DeploymentBuilder) Test(org.junit.Test)

Example 17 with DeploymentBuilder

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

the class ProcessDefinitionCandidateTest method shouldPropagateTenantIdToCandidateStarterGroup.

@Test
public void shouldPropagateTenantIdToCandidateStarterGroup() {
    // when
    DeploymentBuilder builder = repositoryService.createDeployment().addClasspathResource(CANDIDATE_STARTER_GROUP).tenantId(TENANT_ONE);
    testRule.deploy(builder);
    // then
    ProcessDefinition processDefinition = repositoryService.createProcessDefinitionQuery().singleResult();
    List<IdentityLink> links = repositoryService.getIdentityLinksForProcessDefinition(processDefinition.getId());
    assertEquals(1, links.size());
    IdentityLink link = links.get(0);
    assertNotNull(link.getTenantId());
    assertEquals(TENANT_ONE, link.getTenantId());
}
Also used : ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) IdentityLink(org.camunda.bpm.engine.task.IdentityLink) DeploymentBuilder(org.camunda.bpm.engine.repository.DeploymentBuilder) Test(org.junit.Test)

Example 18 with DeploymentBuilder

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

the class DeploymentCacheCfgTest method deploy.

protected Deployment deploy(BpmnModelInstance modelInstance) {
    DeploymentBuilder deploymentbuilder = processEngineConfiguration.getRepositoryService().createDeployment();
    deploymentbuilder.addModelInstance("process0.bpmn", modelInstance);
    return testRule.deploy(deploymentbuilder);
}
Also used : DeploymentBuilder(org.camunda.bpm.engine.repository.DeploymentBuilder)

Example 19 with DeploymentBuilder

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

the class JobDefinitionCreationAndDeletionWithParseListenerTest method testDeleteJobDefinitionWithParseListenerAndAsyncInXml.

@Test
public void testDeleteJobDefinitionWithParseListenerAndAsyncInXml() {
    // given the asyncBefore is set in the xml
    String modelFileName = "jobAsyncBeforeCreationWithinParseListener.bpmn20.xml";
    InputStream in = JobDefinitionCreationWithParseListenerTest.class.getResourceAsStream(modelFileName);
    DeploymentBuilder builder = engineRule.getRepositoryService().createDeployment().addInputStream(modelFileName, in);
    // when the asyncBefore is set to false and the asyncAfter to true in the parse listener
    Deployment deployment = builder.deploy();
    engineRule.manageDeployment(deployment);
    // then there exists one job definition
    JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
    JobDefinition jobDef = query.singleResult();
    assertNotNull(jobDef);
    assertEquals(jobDef.getProcessDefinitionKey(), "oneTaskProcess");
    assertEquals(jobDef.getActivityId(), "servicetask1");
    assertEquals(jobDef.getJobConfiguration(), MessageJobDeclaration.ASYNC_AFTER);
}
Also used : JobDefinitionQuery(org.camunda.bpm.engine.management.JobDefinitionQuery) InputStream(java.io.InputStream) Deployment(org.camunda.bpm.engine.repository.Deployment) DeploymentBuilder(org.camunda.bpm.engine.repository.DeploymentBuilder) JobDefinition(org.camunda.bpm.engine.management.JobDefinition) Test(org.junit.Test)

Example 20 with DeploymentBuilder

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

the class JobDefinitionCreationAndDeletionWithParseListenerTest method testDeleteJobDefinitionWithParseListenerAndAsyncBothInXml.

@Test
public void testDeleteJobDefinitionWithParseListenerAndAsyncBothInXml() {
    // given the asyncBefore AND asyncAfter is set in the xml
    String modelFileName = "jobAsyncBothCreationWithinParseListener.bpmn20.xml";
    InputStream in = JobDefinitionCreationWithParseListenerTest.class.getResourceAsStream(modelFileName);
    DeploymentBuilder builder = engineRule.getRepositoryService().createDeployment().addInputStream(modelFileName, in);
    // when the asyncBefore is set to false and the asyncAfter to true in the parse listener
    Deployment deployment = builder.deploy();
    engineRule.manageDeployment(deployment);
    // then there exists one job definition
    JobDefinitionQuery query = engineRule.getManagementService().createJobDefinitionQuery();
    JobDefinition jobDef = query.singleResult();
    assertNotNull(jobDef);
    assertEquals(jobDef.getProcessDefinitionKey(), "oneTaskProcess");
    assertEquals(jobDef.getActivityId(), "servicetask1");
    assertEquals(jobDef.getJobConfiguration(), MessageJobDeclaration.ASYNC_AFTER);
}
Also used : JobDefinitionQuery(org.camunda.bpm.engine.management.JobDefinitionQuery) InputStream(java.io.InputStream) Deployment(org.camunda.bpm.engine.repository.Deployment) DeploymentBuilder(org.camunda.bpm.engine.repository.DeploymentBuilder) JobDefinition(org.camunda.bpm.engine.management.JobDefinition) Test(org.junit.Test)

Aggregations

DeploymentBuilder (org.camunda.bpm.engine.repository.DeploymentBuilder)26 Test (org.junit.Test)14 Deployment (org.camunda.bpm.engine.repository.Deployment)11 InputStream (java.io.InputStream)10 JobDefinitionQuery (org.camunda.bpm.engine.management.JobDefinitionQuery)10 JobDefinition (org.camunda.bpm.engine.management.JobDefinition)8 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)5 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)4 IdentityLink (org.camunda.bpm.engine.task.IdentityLink)4 IOException (java.io.IOException)3 BadUserRequestException (org.camunda.bpm.engine.BadUserRequestException)2 RepositoryService (org.camunda.bpm.engine.RepositoryService)2 NotFoundException (org.camunda.bpm.engine.exception.NotFoundException)2 NotValidException (org.camunda.bpm.engine.exception.NotValidException)2 Method (java.lang.reflect.Method)1 ZipInputStream (java.util.zip.ZipInputStream)1 Deployment (org.camunda.bpm.engine.test.Deployment)1 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)1 ByteArrayResource (org.springframework.core.io.ByteArrayResource)1 ContextResource (org.springframework.core.io.ContextResource)1