Package org.camunda.bpm.engine.repository

Examples of org.camunda.bpm.engine.repository.CaseDefinition


  }

  @Deployment(resources={"org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn"})
  public void testQueryByCaseDefinitionName() {
    // given
    CaseDefinition caseDefinition = repositoryService
        .createCaseDefinitionQuery()
        .singleResult();

    String caseDefinitionName = caseDefinition.getName();
    String caseDefinitionId = caseDefinition.getId();

    String caseInstanceId = caseService
        .withCaseDefinitionByKey("oneTaskCase")
        .create()
        .getId();
View Full Code Here


  @Deployment(resources = { "org/camunda/bpm/engine/test/repository/one.cmmn" })
  public void testGetCaseDefinition() {
    CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();

    CaseDefinition caseDefinition = query.singleResult();
    String caseDefinitionId = caseDefinition.getId();

    CaseDefinition definition = repositoryService.getCaseDefinition(caseDefinitionId);

    assertNotNull(definition);
    assertEquals(caseDefinitionId, definition.getId());
  }
View Full Code Here

  @Deployment(resources = { "org/camunda/bpm/engine/test/repository/one.cmmn" })
  public void testGetCaseModel() throws Exception {
    CaseDefinitionQuery query = repositoryService.createCaseDefinitionQuery();

    CaseDefinition caseDefinition = query.singleResult();
    String caseDefinitionId = caseDefinition.getId();

    InputStream caseModel = repositoryService.getCaseModel(caseDefinitionId);

    assertNotNull(caseModel);
View Full Code Here

      .orderByCaseDefinitionVersion().asc()
      .orderByCaseDefinitionCategory()
      .asc()
      .list();

    CaseDefinition caseDefinition = caseDefinitions.get(0);
    assertEquals("one", caseDefinition.getKey());
    assertEquals("One", caseDefinition.getName());
    assertTrue(caseDefinition.getId().startsWith("one:1"));
    assertEquals("Examples", caseDefinition.getCategory());
    assertEquals(1, caseDefinition.getVersion());
    assertEquals("org/camunda/bpm/engine/test/repository/one.cmmn", caseDefinition.getResourceName());
    assertEquals(deploymentOneId, caseDefinition.getDeploymentId());

    caseDefinition = caseDefinitions.get(1);
    assertEquals("one", caseDefinition.getKey());
    assertEquals("One", caseDefinition.getName());
    assertTrue(caseDefinition.getId().startsWith("one:2"));
    assertEquals("Examples", caseDefinition.getCategory());
    assertEquals(2, caseDefinition.getVersion());
    assertEquals("org/camunda/bpm/engine/test/repository/one.cmmn", caseDefinition.getResourceName());
    assertEquals(deploymentTwoId, caseDefinition.getDeploymentId());

    caseDefinition = caseDefinitions.get(2);
    assertEquals("two", caseDefinition.getKey());
    assertEquals("Two", caseDefinition.getName());
    assertTrue(caseDefinition.getId().startsWith("two:1"));
    assertEquals("Examples2", caseDefinition.getCategory());
    assertEquals(1, caseDefinition.getVersion());
    assertEquals("org/camunda/bpm/engine/test/repository/two.cmmn", caseDefinition.getResourceName());
    assertEquals(deploymentOneId, caseDefinition.getDeploymentId());
  }
View Full Code Here

    }
  }

  @Deployment(resources={"org/camunda/bpm/engine/test/api/cmmn/oneTaskCase.cmmn"})
  public void testQueryByCaseDefinitionName() {
    CaseDefinition caseDefinition = repositoryService
        .createCaseDefinitionQuery()
        .singleResult();

    String caseDefinitionId = caseDefinition.getId();
    String caseDefinitionName = caseDefinition.getName();

    caseService
      .withCaseDefinition(caseDefinitionId)
      .create();
View Full Code Here

  public void testInvokeBuiltinListenersOnly() {
    // disable custom variable listener invocation
    processEngineConfiguration.setInvokeCustomVariableListeners(false);

    // add a builtin variable listener the hard way
    CaseDefinition caseDefinition = repositoryService.createCaseDefinitionQuery().singleResult();
    processEngineConfiguration
      .getDeploymentCache()
      .getCaseDefinitionById(caseDefinition.getId())
      .findActivity("PI_HumanTask_1")
      .addBuiltInVariableListener(CaseVariableListener.CREATE, new LogVariableListener());

    caseService
      .withCaseDefinitionByKey("case")
View Full Code Here

    query
      .caseDefinitionKey(caseDefinitionKey)
      .latestVersion();

    CaseDefinition caseDefinition = query.singleResult();

    if (caseDefinition == null) {
      String errorMessage = String.format("No matching case definition with key: %s ", caseDefinitionKey);
      throw new RestException(Status.NOT_FOUND, errorMessage);
    }

    return getCaseDefinitionById(caseDefinition.getId());
  }
View Full Code Here

    return getApplicationPathForDeployment(engine, processDefinition.getDeploymentId());
  }

  public static String getApplicationPathByCaseDefinitionId(ProcessEngine engine, String caseDefinitionId) {
    CaseDefinition caseDefinition = engine.getRepositoryService().getCaseDefinition(caseDefinitionId);

    if (caseDefinition == null) {
      return null;
    }

    return getApplicationPathForDeployment(engine, caseDefinition.getDeploymentId());
  }
View Full Code Here

    this.deploymentId = deploymentId;
    return this;
  }

  public CaseDefinition build() {
    CaseDefinition mockDefinition = mock(CaseDefinition.class);

    when(mockDefinition.getId()).thenReturn(id);
    when(mockDefinition.getCategory()).thenReturn(category);
    when(mockDefinition.getName()).thenReturn(name);
    when(mockDefinition.getKey()).thenReturn(key);
    when(mockDefinition.getVersion()).thenReturn(version);
    when(mockDefinition.getResourceName()).thenReturn(resource);
    when(mockDefinition.getDiagramResourceName()).thenReturn(diagramResource);
    when(mockDefinition.getDeploymentId()).thenReturn(deploymentId);

    return mockDefinition;
  }
View Full Code Here

  }

  public static CaseDefinition createMockCaseDefinition() {
    MockCaseDefinitionBuilder builder = new MockCaseDefinitionBuilder();

    CaseDefinition mockDefinition = builder
        .id(EXAMPLE_CASE_DEFINITION_ID)
        .category(EXAMPLE_CASE_DEFINITION_CATEGORY)
        .name(EXAMPLE_CASE_DEFINITION_NAME)
        .key(EXAMPLE_CASE_DEFINITION_KEY)
        .version(EXAMPLE_CASE_DEFINITION_VERSION)
View Full Code Here

TOP

Related Classes of org.camunda.bpm.engine.repository.CaseDefinition

Copyright © 2018 www.massapicom. 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.