use of org.camunda.bpm.engine.runtime.VariableInstance in project camunda-bpm-platform by camunda.
the class MultiTenancyExecutionPropagationTest method testPropagateTenantIdToVariableInstanceFromCaseExecution.
public void testPropagateTenantIdToVariableInstanceFromCaseExecution() {
deploymentForTenant(TENANT_ID, SET_VARIABLE_CMMN_FILE);
createCaseInstance();
VariableInstance variableInstance = runtimeService.createVariableInstanceQuery().singleResult();
assertThat(variableInstance, is(notNullValue()));
// inherit the tenant id from case execution
assertThat(variableInstance.getTenantId(), is(TENANT_ID));
}
use of org.camunda.bpm.engine.runtime.VariableInstance in project camunda-bpm-platform by camunda.
the class MultiTenancyExecutionPropagationTest method testPropagateTenantIdToVariableInstanceOnCreateCaseInstance.
public void testPropagateTenantIdToVariableInstanceOnCreateCaseInstance() {
deploymentForTenant(TENANT_ID, CMMN_FILE);
VariableMap variables = Variables.putValue("var", "test");
CaseDefinition caseDefinition = repositoryService.createCaseDefinitionQuery().singleResult();
caseService.createCaseInstanceById(caseDefinition.getId(), variables);
VariableInstance variableInstance = runtimeService.createVariableInstanceQuery().singleResult();
assertThat(variableInstance, is(notNullValue()));
// inherit the tenant id from case instance
assertThat(variableInstance.getTenantId(), is(TENANT_ID));
}
use of org.camunda.bpm.engine.runtime.VariableInstance in project camunda-bpm-platform by camunda.
the class MultiTenancyExecutionPropagationTest method testPropagateTenantIdToVariableInstanceFromExecution.
public void testPropagateTenantIdToVariableInstanceFromExecution() {
deploymentForTenant(TENANT_ID, Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY).startEvent().serviceTask().camundaClass(SetVariableTask.class.getName()).camundaAsyncAfter().endEvent().done());
startProcessInstance(PROCESS_DEFINITION_KEY);
VariableInstance variableInstance = runtimeService.createVariableInstanceQuery().singleResult();
assertThat(variableInstance, is(notNullValue()));
// inherit the tenant id from execution
assertThat(variableInstance.getTenantId(), is(TENANT_ID));
}
use of org.camunda.bpm.engine.runtime.VariableInstance in project camunda-bpm-platform by camunda.
the class MultiTenancyExecutionPropagationTest method testPropagateTenantIdToVariableInstanceFromTask.
public void testPropagateTenantIdToVariableInstanceFromTask() {
deploymentForTenant(TENANT_ID, Bpmn.createExecutableProcess(PROCESS_DEFINITION_KEY).startEvent().userTask().camundaAsyncAfter().endEvent().done());
startProcessInstance(PROCESS_DEFINITION_KEY);
VariableMap variables = Variables.createVariables().putValue("var", "test");
Task task = taskService.createTaskQuery().singleResult();
taskService.setVariablesLocal(task.getId(), variables);
VariableInstance variableInstance = runtimeService.createVariableInstanceQuery().singleResult();
assertThat(variableInstance, is(notNullValue()));
// inherit the tenant id from task
assertThat(variableInstance.getTenantId(), is(TENANT_ID));
}
use of org.camunda.bpm.engine.runtime.VariableInstance in project camunda-bpm-platform by camunda.
the class RuntimeServiceTest method testChangeTypeFromSerializableUsingApi.
@Deployment(resources = { "org/camunda/bpm/engine/test/api/runtime/RuntimeServiceTest.testBasicVariableOperations.bpmn20.xml" })
@Test
public void testChangeTypeFromSerializableUsingApi() {
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("aVariable", new SerializableVariable("foo"));
ProcessInstance pi = runtimeService.startProcessInstanceByKey("taskAssigneeProcess", variables);
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery().variableName("aVariable");
VariableInstance variable = query.singleResult();
assertEquals(ValueType.OBJECT.getName(), variable.getTypeName());
runtimeService.setVariable(pi.getId(), "aVariable", null);
variable = query.singleResult();
assertEquals(ValueType.NULL.getName(), variable.getTypeName());
}
Aggregations