Search in sources :

Example 96 with CaseInstance

use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.

the class MultiTenancyDecisionTaskTest method testEvaluateDecisionRefTenantIdExpression.

public void testEvaluateDecisionRefTenantIdExpression() {
    deployment(CMMN_EXPR);
    deploymentForTenant(TENANT_ONE, DMN_FILE);
    deploymentForTenant(TENANT_TWO, DMN_FILE_VERSION_TWO);
    CaseInstance caseInstance = createCaseInstance(CASE_DEFINITION_KEY);
    assertThat((String) caseService.getVariable(caseInstance.getId(), "decisionVar"), is(RESULT_OF_VERSION_ONE));
}
Also used : CaseInstance(org.camunda.bpm.engine.runtime.CaseInstance)

Example 97 with CaseInstance

use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.

the class DmnDecisionTaskTest method testCallLatestCase.

@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/decisiontask/DmnDecisionTaskTest.testCallLatestDecision.cmmn", DECISION_OKAY_DMN })
public void testCallLatestCase() {
    // given
    String deploymentId = repositoryService.createDeployment().addClasspathResource(DECISION_NOT_OKAY_DMN).deploy().getId();
    CaseInstance caseInstance = createCaseInstanceByKey(CASE_KEY);
    // then
    assertNull(queryCaseExecutionByActivityId(DECISION_TASK));
    assertEquals("not okay", getDecisionResult(caseInstance));
    repositoryService.deleteDeployment(deploymentId, true);
}
Also used : CaseInstance(org.camunda.bpm.engine.runtime.CaseInstance) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 98 with CaseInstance

use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.

the class DmnDecisionTaskTest method testCallDecisionByVersionAsExpressionStartsWithHash.

@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/decisiontask/DmnDecisionTaskTest.testCallDecisionByVersionAsExpressionStartsWithHash.cmmn", DECISION_OKAY_DMN })
public void testCallDecisionByVersionAsExpressionStartsWithHash() {
    // given
    String deploymentId = repositoryService.createDeployment().addClasspathResource(DECISION_NOT_OKAY_DMN).deploy().getId();
    CaseInstance caseInstance = createCaseInstanceByKey(CASE_KEY, Variables.createVariables().putValue("myVersion", 2));
    // then
    assertNull(queryCaseExecutionByActivityId(DECISION_TASK));
    assertEquals("not okay", getDecisionResult(caseInstance));
    repositoryService.deleteDeployment(deploymentId, true);
}
Also used : CaseInstance(org.camunda.bpm.engine.runtime.CaseInstance) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 99 with CaseInstance

use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.

the class DmnDecisionTaskTest method testCallDecisionByDeployment.

@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/decisiontask/DmnDecisionTaskTest.testCallDecisionByDeployment.cmmn", DECISION_OKAY_DMN })
public void testCallDecisionByDeployment() {
    // given
    String deploymentId = repositoryService.createDeployment().addClasspathResource(DECISION_NOT_OKAY_DMN).deploy().getId();
    CaseInstance caseInstance = createCaseInstanceByKey(CASE_KEY);
    // then
    assertNull(queryCaseExecutionByActivityId(DECISION_TASK));
    assertEquals("okay", getDecisionResult(caseInstance));
    repositoryService.deleteDeployment(deploymentId, true);
}
Also used : CaseInstance(org.camunda.bpm.engine.runtime.CaseInstance) Deployment(org.camunda.bpm.engine.test.Deployment)

Example 100 with CaseInstance

use of org.camunda.bpm.engine.runtime.CaseInstance in project camunda-bpm-platform by camunda.

the class DmnDecisionTaskTest method testCallDecisionByVersion.

@Deployment(resources = { "org/camunda/bpm/engine/test/cmmn/decisiontask/DmnDecisionTaskTest.testCallDecisionByVersion.cmmn", DECISION_OKAY_DMN })
public void testCallDecisionByVersion() {
    // given
    String deploymentId = repositoryService.createDeployment().addClasspathResource(DECISION_NOT_OKAY_DMN).deploy().getId();
    CaseInstance caseInstance = createCaseInstanceByKey(CASE_KEY);
    // then
    assertNull(queryCaseExecutionByActivityId(DECISION_TASK));
    assertEquals("not okay", getDecisionResult(caseInstance));
    repositoryService.deleteDeployment(deploymentId, true);
}
Also used : CaseInstance(org.camunda.bpm.engine.runtime.CaseInstance) Deployment(org.camunda.bpm.engine.test.Deployment)

Aggregations

CaseInstance (org.camunda.bpm.engine.runtime.CaseInstance)183 Deployment (org.camunda.bpm.engine.test.Deployment)149 CaseExecution (org.camunda.bpm.engine.runtime.CaseExecution)62 VariableInstance (org.camunda.bpm.engine.runtime.VariableInstance)23 Test (org.junit.Test)21 HistoricCaseInstance (org.camunda.bpm.engine.history.HistoricCaseInstance)18 Task (org.camunda.bpm.engine.task.Task)18 CaseExecutionQuery (org.camunda.bpm.engine.runtime.CaseExecutionQuery)16 CaseDefinition (org.camunda.bpm.engine.repository.CaseDefinition)13 VariableInstanceQuery (org.camunda.bpm.engine.runtime.VariableInstanceQuery)10 HashMap (java.util.HashMap)9 CaseInstanceQuery (org.camunda.bpm.engine.runtime.CaseInstanceQuery)9 ArrayList (java.util.ArrayList)6 CaseService (org.camunda.bpm.engine.CaseService)6 HistoricDetail (org.camunda.bpm.engine.history.HistoricDetail)6 Date (java.util.Date)5 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)5 NotAllowedException (org.camunda.bpm.engine.exception.NotAllowedException)5 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)5 VariableMap (org.camunda.bpm.engine.variable.VariableMap)5