Examples of RepositoryService


Examples of org.camunda.bpm.engine.RepositoryService

  }

  @Test
  public void testDeployProcessArchive() {
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    long count = repositoryService.createProcessDefinitionQuery()
      .processDefinitionKey("testDeployProcessArchive")
      .count();

    Assert.assertEquals(1, count);
  }
View Full Code Here

Examples of org.camunda.bpm.engine.RepositoryService

  @Test
  @OperateOnDeployment(value=PA2)
  public void testDeployProcessArchive() {
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();
    long count = repositoryService.createProcessDefinitionQuery()
      .processDefinitionKey("testDeployProcessArchive")
      .count();

    Assert.assertEquals(1, count);
View Full Code Here

Examples of org.camunda.bpm.engine.RepositoryService

  }

  @Test
  public void testDeployProcessArchive() {
    Assert.assertNotNull(processEngine);
    RepositoryService repositoryService = processEngine.getRepositoryService();

    List<ProcessDefinition> processDefinitions = repositoryService.createProcessDefinitionQuery()
      .processDefinitionKey("testDeployProcessArchive")
      .list();

    Assert.assertEquals(1, processDefinitions.size());
    org.camunda.bpm.engine.repository.Deployment deployment = repositoryService.createDeploymentQuery()
      .deploymentId(processDefinitions.get(0).getDeploymentId())
      .singleResult();

    Set<String> registeredProcessApplications = BpmPlatform.getProcessApplicationService().getProcessApplicationNames();

    boolean containsProcessApplication = false;

    // the process application name is used as name for the db deployment
    for (String appName : registeredProcessApplications) {
      if (appName.equals(deployment.getName())) {
        containsProcessApplication = true;
      }
    }
    assertTrue(containsProcessApplication);


    // manually delete process definition here (to clean up)
    repositoryService.deleteDeployment(deployment.getId(), true);
  }
View Full Code Here

Examples of org.camunda.bpm.engine.RepositoryService

  @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);
  }
View Full Code Here

Examples of org.camunda.bpm.engine.RepositoryService

  }


  protected static void dropCreateDatabase(ProcessEngine processEngine) {
    // delete all deployments
    RepositoryService repositoryService = processEngine.getRepositoryService();
    List<Deployment> deployments = repositoryService
      .createDeploymentQuery()
      .list();
    for (Deployment deployment : deployments) {
      LOGG.info("deleting deployment "+deployment.getId());
      repositoryService.deleteDeployment(deployment.getId(), true);
    }

    try {
      ((ProcessEngineImpl)processEngine).getProcessEngineConfiguration()
        .getCommandExecutorTxRequired()
View Full Code Here

Examples of org.camunda.bpm.engine.RepositoryService

    this.objectMapper = objectMapper;
  }

  @Override
  public ProcessDefinitionDto getProcessDefinition() {
    RepositoryService repoService = engine.getRepositoryService();

    ProcessDefinition definition;
    try {
      definition = repoService.getProcessDefinition(processDefinitionId);
    } catch (ProcessEngineException e) {
      throw new InvalidRequestException(Status.NOT_FOUND, e, "No matching definition with id " + processDefinitionId);
    }

    ProcessDefinitionDto result = ProcessDefinitionDto.fromProcessDefinition(definition);
View Full Code Here

Examples of org.camunda.bpm.engine.RepositoryService

    this.engine = engine;
    this.deploymentId = deploymentId;
  }

  public DeploymentDto getDeployment() {
    RepositoryService repositoryService = engine.getRepositoryService();
    Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();

    if (deployment == null) {
      throw new InvalidRequestException(Status.NOT_FOUND, "Deployment with id '" + deploymentId + "' does not exist");
    }
View Full Code Here

Examples of org.camunda.bpm.engine.RepositoryService

    return new DeploymentResourcesResourceImpl(engine, deploymentId);
  }
 
  @Override
  public void deleteDeployment(String deploymentId, UriInfo uriInfo) {
    RepositoryService repositoryService = engine.getRepositoryService();
    Deployment deployment = repositoryService.createDeploymentQuery().deploymentId(deploymentId).singleResult();

    if (deployment == null) {
      throw new InvalidRequestException(Status.NOT_FOUND, "Deployment with id '" + deploymentId + "' do not exist");
    }
    boolean cascade = false;
    if (uriInfo.getQueryParameters().containsKey(CASCADE)
        && (uriInfo.getQueryParameters().get(CASCADE).size() > 0)
        && "true".equals(uriInfo.getQueryParameters().get(CASCADE).get(0))) {
      cascade = true;
    }
    repositoryService.deleteDeployment(deploymentId, cascade)
  }
View Full Code Here

Examples of org.camunda.bpm.engine.RepositoryService

    this.objectMapper = objectMapper;
  }

  @Override
  public CaseDefinitionDto getCaseDefinition() {
    RepositoryService repositoryService = engine.getRepositoryService();

    CaseDefinition definition = null;

    try {
      definition = repositoryService.getCaseDefinition(caseDefinitionId);

    } catch (NotFoundException e) {
      throw new InvalidRequestException(Status.NOT_FOUND, e, e.getMessage());

    } catch (NotValidException e) {
View Full Code Here

Examples of org.camunda.bpm.engine.RepositoryService

      String[] additionalResourceSuffixes = StringUtil.split(processArchive.getProperties().get(ProcessArchiveXml.PROP_ADDITIONAL_RESOURCE_SUFFIXES), ProcessArchiveXml.PROP_ADDITIONAL_RESOURCE_SUFFIXES_SEPARATOR);
      deploymentMap.putAll(findResources(processApplicationClassloader, paResourceRoot, additionalResourceSuffixes));
    }

    // perform process engine deployment
    RepositoryService repositoryService = processEngine.getRepositoryService();
    ProcessApplicationDeploymentBuilder deploymentBuilder = repositoryService.createDeployment(processApplication.getReference());

    // set the name for the deployment
    String deploymentName = processArchive.getName();
    if(deploymentName == null || deploymentName.isEmpty()) {
      deploymentName = processApplication.getName();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.