use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testCaseTaskSetVariable.
// TaskService#setVariable() (case task) /////////////////////////////////////
public void testCaseTaskSetVariable() {
// given
createCaseInstanceByKey(CASE_KEY);
String taskId = selectSingleTask().getId();
// when
taskService.setVariable(taskId, VARIABLE_NAME, VARIABLE_VALUE);
// then
disableAuthorization();
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
verifyQueryResults(query, 1);
enableAuthorization();
}
use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskRemoveVariablesLocalWithReadPermissionOnTask.
public void testProcessTaskRemoveVariablesLocalWithReadPermissionOnTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, userId, UPDATE);
disableAuthorization();
taskService.setVariableLocal(taskId, VARIABLE_NAME, VARIABLE_VALUE);
enableAuthorization();
// when
taskService.removeVariablesLocal(taskId, Arrays.asList(VARIABLE_NAME));
// then
disableAuthorization();
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
verifyQueryResults(query, 0);
enableAuthorization();
}
use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testStandaloneTaskRemoveVariableWithReadPermissionOnTask.
public void testStandaloneTaskRemoveVariableWithReadPermissionOnTask() {
// given
String taskId = "myTask";
createTask(taskId);
createGrantAuthorization(TASK, taskId, userId, UPDATE);
// when
taskService.removeVariable(taskId, VARIABLE_NAME);
// then
disableAuthorization();
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
verifyQueryResults(query, 0);
enableAuthorization();
deleteTask(taskId, true);
}
use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testStandaloneTaskSetVariablesLocalWithReadPermissionOnAnyTask.
public void testStandaloneTaskSetVariablesLocalWithReadPermissionOnAnyTask() {
// given
String taskId = "myTask";
createTask(taskId);
createGrantAuthorization(TASK, ANY, userId, UPDATE);
// when
taskService.setVariablesLocal(taskId, getVariables());
// then
disableAuthorization();
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
verifyQueryResults(query, 1);
enableAuthorization();
deleteTask(taskId, true);
}
use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskSetVariablesLocalWithReadTaskPermissionOnAnyProcessDefinition.
public void testProcessTaskSetVariablesLocalWithReadTaskPermissionOnAnyProcessDefinition() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, UPDATE_TASK);
// when
taskService.setVariablesLocal(taskId, getVariables());
// then
disableAuthorization();
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
verifyQueryResults(query, 1);
enableAuthorization();
}
Aggregations