public void testFailEvaluateDecisionFromOtherTenantWithVersionBinding() { BpmnModelInstance process = Bpmn.createExecutableProcess("process") .startEvent() .businessRuleTask() .camundaDecisionRef("decision") .camundaDecisionRefBinding("version") .camundaDecisionRefVersion("2") .camundaAsyncAfter() .endEvent() .done(); deploymentForTenant(TENANT_ONE, DMN_FILE, process); deploymentForTenant(TENANT_TWO, DMN_FILE); deploymentForTenant(TENANT_TWO, DMN_FILE); try { runtimeService.createProcessInstanceByKey("process") .processDefinitionTenantId(TENANT_ONE) .execute(); fail("expected exception"); } catch (ProcessEngineException e) { assertThat(e.getMessage(), containsString("no decision definition deployed with key = 'decision', version = '2' and tenant-id 'tenant1'")); } }
public void testEvaluateDecisionWithVersionBinding() { BpmnModelInstance process = Bpmn.createExecutableProcess("process") .startEvent() .businessRuleTask() .camundaDecisionRef("decision") .camundaDecisionRefBinding("version") .camundaDecisionRefVersion("1") .camundaMapDecisionResult("singleEntry") .camundaResultVariable("decisionVar") .camundaAsyncAfter() .endEvent() .done(); deploymentForTenant(TENANT_ONE, DMN_FILE, process); deploymentForTenant(TENANT_ONE, DMN_FILE_VERSION_TWO); deploymentForTenant(TENANT_TWO, DMN_FILE_VERSION_TWO, process); deploymentForTenant(TENANT_TWO, DMN_FILE); ProcessInstance processInstanceOne = runtimeService.createProcessInstanceByKey("process") .setVariable("status", "gold") .processDefinitionTenantId(TENANT_ONE).execute(); ProcessInstance processInstanceTwo = runtimeService.createProcessInstanceByKey("process") .setVariable("status", "gold") .processDefinitionTenantId(TENANT_TWO).execute(); assertThat((String)runtimeService.getVariable(processInstanceOne.getId(), "decisionVar"), is(RESULT_OF_VERSION_ONE)); assertThat((String)runtimeService.getVariable(processInstanceTwo.getId(), "decisionVar"), is(RESULT_OF_VERSION_TWO)); }
public void testFailEvaluateDecisionFromOtherTenantWithVersionBinding() { BpmnModelInstance process = Bpmn.createExecutableProcess("process") .startEvent() .businessRuleTask() .camundaDecisionRef("decision") .camundaDecisionRefBinding("version") .camundaDecisionRefVersion("2") .camundaAsyncAfter() .endEvent() .done(); deploymentForTenant(TENANT_ONE, DMN_FILE, process); deploymentForTenant(TENANT_TWO, DMN_FILE); deploymentForTenant(TENANT_TWO, DMN_FILE); try { runtimeService.createProcessInstanceByKey("process") .processDefinitionTenantId(TENANT_ONE) .execute(); fail("expected exception"); } catch (ProcessEngineException e) { assertThat(e.getMessage(), containsString("no decision definition deployed with key = 'decision', version = '2' and tenant-id 'tenant1'")); } }
public void testEvaluateDecisionWithVersionBinding() { BpmnModelInstance process = Bpmn.createExecutableProcess("process") .startEvent() .businessRuleTask() .camundaDecisionRef("decision") .camundaDecisionRefBinding("version") .camundaDecisionRefVersion("1") .camundaMapDecisionResult("singleEntry") .camundaResultVariable("decisionVar") .camundaAsyncAfter() .endEvent() .done(); deploymentForTenant(TENANT_ONE, DMN_FILE, process); deploymentForTenant(TENANT_ONE, DMN_FILE_VERSION_TWO); deploymentForTenant(TENANT_TWO, DMN_FILE_VERSION_TWO, process); deploymentForTenant(TENANT_TWO, DMN_FILE); ProcessInstance processInstanceOne = runtimeService.createProcessInstanceByKey("process") .setVariable("status", "gold") .processDefinitionTenantId(TENANT_ONE).execute(); ProcessInstance processInstanceTwo = runtimeService.createProcessInstanceByKey("process") .setVariable("status", "gold") .processDefinitionTenantId(TENANT_TWO).execute(); assertThat((String)runtimeService.getVariable(processInstanceOne.getId(), "decisionVar"), is(RESULT_OF_VERSION_ONE)); assertThat((String)runtimeService.getVariable(processInstanceTwo.getId(), "decisionVar"), is(RESULT_OF_VERSION_TWO)); }