use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class DeploymentAuthorizationTest method testCreateDeployment.
public void testCreateDeployment() {
// given
createGrantAuthorization(DEPLOYMENT, ANY, userId, CREATE);
// when
Deployment deployment = repositoryService.createDeployment().addClasspathResource(FIRST_RESOURCE).deploy();
// then
disableAuthorization();
DeploymentQuery query = repositoryService.createDeploymentQuery();
verifyQueryResults(query, 1);
enableAuthorization();
deleteDeployment(deployment.getId());
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyRepositoryServiceTest method deploymentWithTenantId.
@Test
public void deploymentWithTenantId() {
createDeploymentBuilder().tenantId(TENANT_ONE).deploy();
Deployment deployment = repositoryService.createDeploymentQuery().singleResult();
assertThat(deployment, is(notNullValue()));
assertThat(deployment.getTenantId(), is(TENANT_ONE));
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class MultiTenancyTimerStartEventTest method deleteJobsWhileUndeployment.
@Test
public void deleteJobsWhileUndeployment() {
Deployment deploymentForTenantOne = testRule.deployForTenant(TENANT_ONE, PROCESS);
Deployment deploymentForTenantTwo = testRule.deployForTenant(TENANT_TWO, PROCESS);
JobQuery query = managementService.createJobQuery();
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
repositoryService.deleteDeployment(deploymentForTenantOne.getId(), true);
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(0L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
repositoryService.deleteDeployment(deploymentForTenantTwo.getId(), true);
assertThat(query.tenantIdIn(TENANT_ONE).count(), is(0L));
assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class CallingTaskItemHandler method initializeCallableElement.
protected void initializeCallableElement(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context) {
Deployment deployment = context.getDeployment();
String deploymentId = null;
if (deployment != null) {
deploymentId = deployment.getId();
}
BaseCallableElement callableElement = createCallableElement();
callableElement.setDeploymentId(deploymentId);
// set callableElement on behavior
CallingTaskActivityBehavior behavior = (CallingTaskActivityBehavior) activity.getActivityBehavior();
behavior.setCallableElement(callableElement);
// definition key
initializeDefinitionKey(element, activity, context, callableElement);
// binding
initializeBinding(element, activity, context, callableElement);
// version
initializeVersion(element, activity, context, callableElement);
// tenant-id
initializeTenantId(element, activity, context, callableElement);
}
use of org.camunda.bpm.engine.repository.Deployment in project camunda-bpm-platform by camunda.
the class CaseHandler method initializeActivity.
protected void initializeActivity(Case element, CmmnActivity activity, CmmnHandlerContext context) {
CaseDefinitionEntity definition = (CaseDefinitionEntity) activity;
Deployment deployment = context.getDeployment();
definition.setKey(element.getId());
definition.setName(element.getName());
definition.setDeploymentId(deployment.getId());
definition.setTaskDefinitions(new HashMap<String, TaskDefinition>());
definition.setHistoryTimeToLive(ParseUtil.parseHistoryTimeToLive(element.getCamundaHistoryTimeToLiveString()));
CmmnModelInstance model = context.getModel();
Definitions definitions = model.getDefinitions();
String category = definitions.getTargetNamespace();
definition.setCategory(category);
}
Aggregations