use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testCaseTaskSetVariableLocal.
// TaskService#setVariableLocal() (case task) /////////////////////////////////////
public void testCaseTaskSetVariableLocal() {
// given
createCaseInstanceByKey(CASE_KEY);
String taskId = selectSingleTask().getId();
// 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 testProcessTaskRemoveVariablesWithReadPermissionOnTask.
public void testProcessTaskRemoveVariablesWithReadPermissionOnTask() {
// given
startProcessInstanceByKey(PROCESS_KEY, getVariables());
String taskId = selectSingleTask().getId();
createGrantAuthorization(TASK, taskId, userId, UPDATE);
// when
taskService.removeVariables(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 testStandaloneTaskSetVariablesLocalWithReadPermissionOnTask.
public void testStandaloneTaskSetVariablesLocalWithReadPermissionOnTask() {
// given
String taskId = "myTask";
createTask(taskId);
createGrantAuthorization(TASK, taskId, 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 testStandaloneTaskRemoveVariablesLocalWithReadPermissionOnTask.
@RequiredHistoryLevel(ProcessEngineConfiguration.HISTORY_AUDIT)
public void testStandaloneTaskRemoveVariablesLocalWithReadPermissionOnTask() {
// given
String taskId = "myTask";
createTask(taskId);
createGrantAuthorization(TASK, taskId, userId, UPDATE);
disableAuthorization();
taskService.setVariable(taskId, VARIABLE_NAME, VARIABLE_VALUE);
enableAuthorization();
// when
taskService.removeVariablesLocal(taskId, Arrays.asList(VARIABLE_NAME));
// then
disableAuthorization();
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
verifyQueryResults(query, 0);
enableAuthorization();
deleteTask(taskId, true);
HistoricVariableInstance deletedVariable = historyService.createHistoricVariableInstanceQuery().includeDeleted().singleResult();
Assert.assertEquals("DELETED", deletedVariable.getState());
}
use of org.camunda.bpm.engine.runtime.VariableInstanceQuery in project camunda-bpm-platform by camunda.
the class TaskAuthorizationTest method testStandaloneTaskSetVariablesWithReadPermissionOnAnyTask.
public void testStandaloneTaskSetVariablesWithReadPermissionOnAnyTask() {
// given
String taskId = "myTask";
createTask(taskId);
createGrantAuthorization(TASK, ANY, userId, UPDATE);
// when
taskService.setVariables(taskId, getVariables());
// then
disableAuthorization();
VariableInstanceQuery query = runtimeService.createVariableInstanceQuery();
verifyQueryResults(query, 1);
enableAuthorization();
deleteTask(taskId, true);
}
Aggregations