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());
}
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());
}
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);
}
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);
}
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);
}
Aggregations