use of org.camunda.bpm.dmn.engine.DmnDecisionTableResult in project camunda-bpm-platform by camunda.
the class DecisionServiceTest method evaluateDecisionWithRequiredDecisions.
@Deployment(resources = DRD_DISH_DECISION_TABLE)
@Test
public void evaluateDecisionWithRequiredDecisions() {
DmnDecisionTableResult decisionResult = decisionService.evaluateDecisionTableByKey("dish-decision", Variables.createVariables().putValue("temperature", 32).putValue("dayType", "Weekend"));
assertThatDecisionHasResult(decisionResult, "Light salad");
}
use of org.camunda.bpm.dmn.engine.DmnDecisionTableResult in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionTableEvaluationTest method testEvaluateDecisionByKeyWithTenantIdDisabledTenantCheck.
public void testEvaluateDecisionByKeyWithTenantIdDisabledTenantCheck() {
processEngineConfiguration.setTenantCheckEnabled(false);
identityService.setAuthentication("user", null, null);
deploymentForTenant(TENANT_ONE, DMN_FILE);
DmnDecisionTableResult decisionResult = decisionService.evaluateDecisionTableByKey(DECISION_DEFINITION_KEY).decisionDefinitionTenantId(TENANT_ONE).variables(createVariables()).evaluate();
assertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
}
use of org.camunda.bpm.dmn.engine.DmnDecisionTableResult in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionTableEvaluationTest method testEvaluateDecisionByKeyWithAuthenticatedTenant.
public void testEvaluateDecisionByKeyWithAuthenticatedTenant() {
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
deploymentForTenant(TENANT_ONE, DMN_FILE);
deploymentForTenant(TENANT_TWO, DMN_FILE_SECOND_VERSION);
DmnDecisionTableResult decisionResult = decisionService.evaluateDecisionTableByKey(DECISION_DEFINITION_KEY).variables(createVariables()).evaluate();
assertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
}
use of org.camunda.bpm.dmn.engine.DmnDecisionTableResult in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionTableEvaluationTest method testEvaluateDecisionByKeyForAnyTenants.
public void testEvaluateDecisionByKeyForAnyTenants() {
deploymentForTenant(TENANT_ONE, DMN_FILE);
DmnDecisionTableResult decisionResult = decisionService.evaluateDecisionTableByKey(DECISION_DEFINITION_KEY).variables(createVariables()).evaluate();
assertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
}
use of org.camunda.bpm.dmn.engine.DmnDecisionTableResult in project camunda-bpm-platform by camunda.
the class MultiTenancyDecisionTableEvaluationTest method testEvaluateDecisionByIdAuthenticatedTenant.
public void testEvaluateDecisionByIdAuthenticatedTenant() {
deploymentForTenant(TENANT_ONE, DMN_FILE);
DecisionDefinition decisionDefinition = repositoryService.createDecisionDefinitionQuery().singleResult();
identityService.setAuthentication("user", null, Arrays.asList(TENANT_ONE));
DmnDecisionTableResult decisionResult = decisionService.evaluateDecisionTableById(decisionDefinition.getId()).variables(createVariables()).evaluate();
assertThatDecisionHasResult(decisionResult, RESULT_OF_FIRST_VERSION);
}
Aggregations