use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class VariableInstanceAuthorizationTest method testProcessLocalTaskVariableQueryWithMultiple.
public void testProcessLocalTaskVariableQueryWithMultiple() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
setTaskVariableLocal(taskId, VARIABLE_NAME, VARIABLE_VALUE);
createGrantAuthorization(TASK, taskId, userId, READ);
createGrantAuthorization(TASK, ANY, userId, READ);
// when
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
// then
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class VariableInstanceAuthorizationTest method testMixedVariables.
public void testMixedVariables() {
// given
String taskId = "myTask";
createTask(taskId);
setTaskVariable(taskId, VARIABLE_NAME, VARIABLE_VALUE);
String processInstanceId = startProcessInstanceByKey(PROCESS_KEY, getVariables()).getProcessInstanceId();
createCaseInstanceByKey(CASE_KEY, getVariables());
// when (1)
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
// then (1)
verifyQueryResults(query, 1);
// when (2)
createGrantAuthorization(TASK, taskId, userId, READ);
// then (2)
verifyQueryResults(query, 2);
// when (3)
createGrantAuthorization(PROCESS_INSTANCE, processInstanceId, userId, READ);
// then (3)
verifyQueryResults(query, 3);
deleteTask(taskId, true);
}
use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class VariableInstanceAuthorizationTest method testStandaloneTaskVariableQueryWithoutAuthorization.
public void testStandaloneTaskVariableQueryWithoutAuthorization() {
// given
String taskId = "myTask";
createTask(taskId);
setTaskVariable(taskId, VARIABLE_NAME, VARIABLE_VALUE);
// when
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
// then
verifyQueryResults(query, 0);
deleteTask(taskId, true);
}
use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class VariableInstanceAuthorizationTest method testProcessLocalTaskVariableQueryWithReadPermissionOnTask.
public void testProcessLocalTaskVariableQueryWithReadPermissionOnTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
setTaskVariableLocal(taskId, VARIABLE_NAME, VARIABLE_VALUE);
createGrantAuthorization(TASK, taskId, userId, READ);
// when
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
// then
verifyQueryResults(query, 1);
}
use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class VariableInstanceAuthorizationTest method testProcessVariableQueryWithReadPermissionOnProcessInstance.
public void testProcessVariableQueryWithReadPermissionOnProcessInstance() {
// given
String processInstanceId = startProcessInstanceByKey(PROCESS_KEY, getVariables()).getId();
createGrantAuthorization(PROCESS_INSTANCE, processInstanceId, userId, READ);
// when
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
// then
verifyQueryResults(query, 1);
VariableInstance variable = query.singleResult();
assertNotNull(variable);
assertEquals(processInstanceId, variable.getProcessInstanceId());
}
Aggregations