use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testProcessTaskSetVariableLocalWithReadPermissionOnAnyTask.
public void testProcessTaskSetVariableLocalWithReadPermissionOnAnyTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, ANY, userId, UPDATE);
// when
taskService.setVariableLocal(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 testProcessTaskUpdateVariablesLocalWithUpdatePermissionOnAnyTask.
public void testProcessTaskUpdateVariablesLocalWithUpdatePermissionOnAnyTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, ANY, userId, UPDATE);
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
// when (1)
((TaskServiceImpl) taskService).updateVariablesLocal(taskId, getVariables(), null);
// then (1)
disableAuthorization();
verifyQueryResults(query, 1);
enableAuthorization();
// when (2)
((TaskServiceImpl) taskService).updateVariablesLocal(taskId, null, Arrays.asList(VARIABLE_NAME));
// then (2)
disableAuthorization();
verifyQueryResults(query, 0);
enableAuthorization();
// when (3)
((TaskServiceImpl) taskService).updateVariablesLocal(taskId, getVariables(), Arrays.asList(VARIABLE_NAME));
// then (3)
disableAuthorization();
verifyQueryResults(query, 0);
enableAuthorization();
}
use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testCaseTaskRemoveVariableLocal.
// TaskService#removeVariableLocal() (case task) ////////////////////////////////////////////
public void testCaseTaskRemoveVariableLocal() {
// given
createCaseInstanceByKey(CASE_KEY);
String taskId = selectSingleTask().getId();
disableAuthorization();
taskService.setVariableLocal(taskId, VARIABLE_NAME, VARIABLE_VALUE);
enableAuthorization();
// when
taskService.removeVariableLocal(taskId, 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 testProcessTaskSetVariableWithReadPermissionOnTask.
public void testProcessTaskSetVariableWithReadPermissionOnTask() {
// given
startProcessInstanceByKey(PROCESS_KEY);
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, userId, UPDATE);
// 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 testCaseTaskRemoveVariables.
// TaskService#removeVariables() (case task) ////////////////////////////////////////////
public void testCaseTaskRemoveVariables() {
// given
createCaseInstanceByKey(CASE_KEY, getVariables());
String taskId = selectSingleTask().getId();
// when
taskService.removeVariables(taskId, Arrays.asList(VARIABLE_NAME));
// then
disableAuthorization();
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
verifyQueryResults(query, 0);
enableAuthorization();
}
Aggregations