当前位置: 首页>>代码示例>>Java>>正文


Java DeploymentQuery类代码示例

本文整理汇总了Java中org.camunda.bpm.engine.repository.DeploymentQuery的典型用法代码示例。如果您正苦于以下问题:Java DeploymentQuery类的具体用法?Java DeploymentQuery怎么用?Java DeploymentQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DeploymentQuery类属于org.camunda.bpm.engine.repository包,在下文中一共展示了DeploymentQuery类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testQueryByTenantIdsIncludeDeploymentsWithoutTenantId

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testQueryByTenantIdsIncludeDeploymentsWithoutTenantId() {
  DeploymentQuery query = repositoryService
      .createDeploymentQuery()
      .tenantIdIn(TENANT_ONE)
      .includeDeploymentsWithoutTenantId();

  assertThat(query.count(), is(2L));

  query = repositoryService
      .createDeploymentQuery()
      .tenantIdIn(TENANT_TWO)
      .includeDeploymentsWithoutTenantId();

  assertThat(query.count(), is(2L));

  query = repositoryService
      .createDeploymentQuery()
      .tenantIdIn(TENANT_ONE, TENANT_TWO)
      .includeDeploymentsWithoutTenantId();

  assertThat(query.count(), is(3L));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:23,代码来源:MultiTenancyDeploymentQueryTest.java

示例2: deleteDeploymentDisabledTenantCheck

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
@Test
public void deleteDeploymentDisabledTenantCheck() {
  Deployment deploymentOne = testRule.deployForTenant(TENANT_ONE, emptyProcess);
  Deployment deploymentTwo = testRule.deployForTenant(TENANT_TWO, startEndProcess);

  processEngineConfiguration.setTenantCheckEnabled(false);
  identityService.setAuthentication("user", null, null);

  repositoryService.deleteDeployment(deploymentOne.getId());
  repositoryService.deleteDeployment(deploymentTwo.getId());

  DeploymentQuery query = repositoryService.createDeploymentQuery();
  assertThat(query.count(), is(0L));
  assertThat(query.tenantIdIn(TENANT_ONE).count(), is(0L));
  assertThat(query.tenantIdIn(TENANT_TWO).count(), is(0L));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:MultiTenancyDeploymentCmdsTenantCheckTest.java

示例3: redeployForTheSameAuthenticatedTenant

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
@Test
public void redeployForTheSameAuthenticatedTenant() {
  Deployment deploymentOne = repositoryService.createDeployment()
    .addModelInstance("emptyProcess.bpmn", emptyProcess)
    .addModelInstance("startEndProcess.bpmn", startEndProcess)
    .tenantId(TENANT_ONE)
    .deploy();

  identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));

  repositoryService.createDeployment()
      .addDeploymentResources(deploymentOne.getId())
      .tenantId(TENANT_ONE)
      .deploy();

  DeploymentQuery query = repositoryService.createDeploymentQuery();
  assertThat(query.count(), is(2L));
  assertThat(query.tenantIdIn(TENANT_ONE).count(), is(2L));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:20,代码来源:MultiTenancyDeploymentCmdsTenantCheckTest.java

示例4: redeployForDifferentAuthenticatedTenantsDisabledTenantCheck

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
@Test
public void redeployForDifferentAuthenticatedTenantsDisabledTenantCheck() {
  Deployment deploymentOne = repositoryService.createDeployment()
    .addModelInstance("emptyProcess.bpmn", emptyProcess)
    .addModelInstance("startEndProcess.bpmn", startEndProcess)
    .tenantId(TENANT_ONE)
    .deploy();

  identityService.setAuthentication("user", null, null);
  processEngineConfiguration.setTenantCheckEnabled(false);

  repositoryService.createDeployment()
      .addDeploymentResources(deploymentOne.getId())
      .tenantId(TENANT_TWO)
      .deploy();

  DeploymentQuery query = repositoryService.createDeploymentQuery();
  assertThat(query.count(), is(2L));
  assertThat(query.tenantIdIn(TENANT_ONE).count(), is(1L));
  assertThat(query.tenantIdIn(TENANT_TWO).count(), is(1L));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:22,代码来源:MultiTenancyDeploymentCmdsTenantCheckTest.java

示例5: testDeploymentSourceShouldBeNull

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testDeploymentSourceShouldBeNull() {
  String key = "process";

  BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();

  DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();

  Deployment deployment1 = repositoryService
      .createDeployment()
      .name("first-deployment-without-a-source")
      .addModelInstance("process.bpmn", model)
      .deploy();

  assertNull(deploymentQuery.deploymentName("first-deployment-without-a-source").singleResult().getSource());

  Deployment deployment2 = repositoryService
      .createDeployment(processApplication.getReference())
      .name("second-deployment-with-a-source")
      .source(null)
      .addModelInstance("process.bpmn", model)
      .deploy();

  assertNull(deploymentQuery.deploymentName("second-deployment-with-a-source").singleResult().getSource());

  deleteDeployments(deployment1, deployment2);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:27,代码来源:ProcessApplicationDeploymentTest.java

示例6: testDefaultDeploymentSource

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testDefaultDeploymentSource() {
  String key = "process";

  BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();

  DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();

  Deployment deployment = repositoryService
      .createDeployment(processApplication.getReference())
      .name("first-deployment-with-a-source")
      .addModelInstance("process.bpmn", model)
      .deploy();

  assertEquals(ProcessApplicationDeployment.PROCESS_APPLICATION_DEPLOYMENT_SOURCE, deploymentQuery.deploymentName("first-deployment-with-a-source").singleResult().getSource());

  deleteDeployments(deployment);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:18,代码来源:ProcessApplicationDeploymentTest.java

示例7: testOverwriteDeploymentSource

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testOverwriteDeploymentSource() {
  String key = "process";

  BpmnModelInstance model = Bpmn.createExecutableProcess(key).done();

  DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();

  Deployment deployment = repositoryService
      .createDeployment(processApplication.getReference())
      .name("first-deployment-with-a-source")
      .source("my-source")
      .addModelInstance("process.bpmn", model)
      .deploy();

  assertEquals("my-source", deploymentQuery.deploymentName("first-deployment-with-a-source").singleResult().getSource());

  deleteDeployments(deployment);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:ProcessApplicationDeploymentTest.java

示例8: testCreateDeployment

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
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());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:19,代码来源:DeploymentAuthorizationTest.java

示例9: testDeleteDeploymentWithDeletePermissionOnDeployment

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testDeleteDeploymentWithDeletePermissionOnDeployment() {
  // given
  String deploymentId = createDeployment(null);
  createGrantAuthorization(DEPLOYMENT, deploymentId, userId, DELETE);

  // when
  repositoryService.deleteDeployment(deploymentId);

  // then
  disableAuthorization();
  DeploymentQuery query = repositoryService.createDeploymentQuery();
  verifyQueryResults(query, 0);
  enableAuthorization();

  deleteDeployment(deploymentId);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:DeploymentAuthorizationTest.java

示例10: testDeleteDeploymentWithDeletePermissionOnAnyDeployment

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testDeleteDeploymentWithDeletePermissionOnAnyDeployment() {
  // given
  String deploymentId = createDeployment(null);
  createGrantAuthorization(DEPLOYMENT, ANY, userId, DELETE);

  // when
  repositoryService.deleteDeployment(deploymentId);

  // then
  disableAuthorization();
  DeploymentQuery query = repositoryService.createDeploymentQuery();
  verifyQueryResults(query, 0);
  enableAuthorization();

  deleteDeployment(deploymentId);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:17,代码来源:DeploymentAuthorizationTest.java

示例11: createDeploymentQuery

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
private DeploymentQuery createDeploymentQuery(DeploymentSpec spec) {
  DeploymentQuery query = repositoryService.createDeploymentQuery();

  Function<ZonedDateTime, Date> toInstant = chain(ZonedDateTime::toInstant, Date::from);
  add(query, DeploymentQuery::deploymentAfter, spec.getEarliestDeployment(), toInstant);
  add(query, DeploymentQuery::deploymentBefore, spec.getLatestDeployment(), toInstant);
  add(query, DeploymentQuery::deploymentSource, spec.getSource());
  add(query, DeploymentQuery::deploymentName, spec.getName());
  add(query, DeploymentQuery::tenantIdIn, spec.getTenantId(), s -> new String[]{s});

  return query;
}
 
开发者ID:camunda,项目名称:camunda-bpm-migration,代码行数:13,代码来源:ProcessDefinitionFinder.java

示例12: add

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
private <S, Q> void add(DeploymentQuery query,
                        BiFunction<DeploymentQuery, Q, DeploymentQuery> setter,
                        S specValue,
                        Function<S, Q> conversion) {
  if (specValue != null)
    setter.apply(query, conversion.apply(specValue));
}
 
开发者ID:camunda,项目名称:camunda-bpm-migration,代码行数:8,代码来源:ProcessDefinitionFinder.java

示例13: testDuplicateFiltering

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
/**
 * @see https://app.camunda.com/jira/browse/CAM-2128
 */
public void testDuplicateFiltering() throws InterruptedException {

  deployOnTwoConcurrentThreads(
      createDeploymentBuilder().enableDuplicateFiltering(false),
      createDeploymentBuilder().enableDuplicateFiltering(false));

  // ensure that although both transactions were run concurrently, only one deployment was constructed.
  DeploymentQuery deploymentQuery = repositoryService.createDeploymentQuery();
  assertThat(deploymentQuery.count(), is(1L));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:14,代码来源:ConcurrentDeploymentTest.java

示例14: testQueryByTenantId

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testQueryByTenantId() {
  DeploymentQuery query = repositoryService
      .createDeploymentQuery()
      .tenantIdIn(TENANT_ONE);

  assertThat(query.count(), is(1L));

  query = repositoryService
      .createDeploymentQuery()
      .tenantIdIn(TENANT_TWO);

  assertThat(query.count(), is(1L));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:14,代码来源:MultiTenancyDeploymentQueryTest.java

示例15: testQueryByTenantIds

import org.camunda.bpm.engine.repository.DeploymentQuery; //导入依赖的package包/类
public void testQueryByTenantIds() {
  DeploymentQuery query = repositoryService
      .createDeploymentQuery()
      .tenantIdIn(TENANT_ONE, TENANT_TWO);

  assertThat(query.count(), is(2L));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:8,代码来源:MultiTenancyDeploymentQueryTest.java


注:本文中的org.camunda.bpm.engine.repository.DeploymentQuery类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。