Search in sources :

Example 26 with DecisionDefinition

use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.

the class VersionTagTest method testParsingVersionTagDecisionDefinition.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/repository/versionTag.dmn" })
public void testParsingVersionTagDecisionDefinition() {
    DecisionDefinition decision = repositoryService.createDecisionDefinitionQuery().orderByDecisionDefinitionVersion().asc().singleResult();
    assertEquals("1.0.0", decision.getVersionTag());
}
Also used : DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 27 with DecisionDefinition

use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.

the class RepositoryServiceTest method testDecisionDefinitionUpdateTimeToLive.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/dmn/Example.dmn" })
public void testDecisionDefinitionUpdateTimeToLive() {
    // given
    DecisionDefinition decisionDefinition = findOnlyDecisionDefinition();
    // when
    repositoryService.updateDecisionDefinitionHistoryTimeToLive(decisionDefinition.getId(), 6);
    // then
    decisionDefinition = findOnlyDecisionDefinition();
    assertEquals(6, decisionDefinition.getHistoryTimeToLive().intValue());
}
Also used : DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 28 with DecisionDefinition

use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.

the class RepositoryServiceTest method testDecisionDefinitionUpdateTimeToLiveNull.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/dmn/Example.dmn" })
public void testDecisionDefinitionUpdateTimeToLiveNull() {
    // given
    DecisionDefinition decisionDefinition = findOnlyDecisionDefinition();
    // when
    repositoryService.updateDecisionDefinitionHistoryTimeToLive(decisionDefinition.getId(), null);
    // then
    decisionDefinition = (DecisionDefinitionEntity) repositoryService.getDecisionDefinition(decisionDefinition.getId());
    assertEquals(null, decisionDefinition.getHistoryTimeToLive());
}
Also used : DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 29 with DecisionDefinition

use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.

the class RepositoryServiceTest method testDecisionDefinitionUpdateTimeToLiveNegative.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/dmn/Example.dmn" })
public void testDecisionDefinitionUpdateTimeToLiveNegative() {
    // given
    DecisionDefinition decisionDefinition = findOnlyDecisionDefinition();
    // when
    try {
        repositoryService.updateDecisionDefinitionHistoryTimeToLive(decisionDefinition.getId(), -1);
        fail("Exception is expected, that negative value is not allowed.");
    } catch (BadUserRequestException ex) {
        assertTrue(ex.getMessage().contains("greater than"));
    }
}
Also used : BadUserRequestException(org.camunda.bpm.engine.BadUserRequestException) DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 30 with DecisionDefinition

use of org.camunda.bpm.engine.repository.DecisionDefinition in project camunda-bpm-platform by camunda.

the class DecisionDefinitionQueryTest method testQueryByVersionTag.

@Deployment(resources = { "org/camunda/bpm/engine/test/api/repository/versionTag.dmn", "org/camunda/bpm/engine/test/api/repository/versionTagHigher.dmn" })
@Test
public void testQueryByVersionTag() {
    DecisionDefinition decisionDefinition = repositoryService.createDecisionDefinitionQuery().versionTag("1.0.0").singleResult();
    assertEquals("versionTag", decisionDefinition.getKey());
    assertEquals("1.0.0", decisionDefinition.getVersionTag());
}
Also used : DecisionDefinition(org.camunda.bpm.engine.repository.DecisionDefinition) Test(org.junit.Test) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

DecisionDefinition (org.camunda.bpm.engine.repository.DecisionDefinition)68 Test (org.junit.Test)21 Deployment (org.camunda.bpm.engine.test.Deployment)18 DecisionDefinitionQuery (org.camunda.bpm.engine.repository.DecisionDefinitionQuery)10 Date (java.util.Date)6 DmnDecisionTableResult (org.camunda.bpm.dmn.engine.DmnDecisionTableResult)5 BadUserRequestException (org.camunda.bpm.engine.BadUserRequestException)5 InputStream (java.io.InputStream)4 ArrayList (java.util.ArrayList)4 DmnDecisionResult (org.camunda.bpm.dmn.engine.DmnDecisionResult)4 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)3 HistoricDecisionInstanceEntity (org.camunda.bpm.engine.impl.history.event.HistoricDecisionInstanceEntity)3 Response (com.jayway.restassured.response.Response)2 HistoricCaseInstance (org.camunda.bpm.engine.history.HistoricCaseInstance)2 HistoricDecisionInstanceQuery (org.camunda.bpm.engine.history.HistoricDecisionInstanceQuery)2 HistoricDecisionOutputInstance (org.camunda.bpm.engine.history.HistoricDecisionOutputInstance)2 HistoricProcessInstance (org.camunda.bpm.engine.history.HistoricProcessInstance)2 CommandChecker (org.camunda.bpm.engine.impl.cfg.CommandChecker)2 GetDeploymentResourceCmd (org.camunda.bpm.engine.impl.cmd.GetDeploymentResourceCmd)2 DeploymentCache (org.camunda.bpm.engine.impl.persistence.deploy.cache.DeploymentCache)2