Search in sources :

Example 71 with VariableMap

use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.

the class ProcessInstanceAuthorizationTest method testGetVariablesLocalTypedWithReadPermissionOnAnyProcessInstance.

public void testGetVariablesLocalTypedWithReadPermissionOnAnyProcessInstance() {
    // given
    String processInstanceId = startProcessInstanceByKey(PROCESS_KEY, getVariables()).getId();
    createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, READ);
    // when
    VariableMap variables = runtimeService.getVariablesLocalTyped(processInstanceId);
    // then
    assertNotNull(variables);
    assertFalse(variables.isEmpty());
    assertEquals(1, variables.size());
    assertEquals(VARIABLE_VALUE, variables.get(VARIABLE_NAME));
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap)

Example 72 with VariableMap

use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.

the class ProcessInstanceAuthorizationTest method testGetVariablesTypedWithReadPermissionOnAnyProcessInstance.

public void testGetVariablesTypedWithReadPermissionOnAnyProcessInstance() {
    // given
    String processInstanceId = startProcessInstanceByKey(PROCESS_KEY, getVariables()).getId();
    createGrantAuthorization(PROCESS_INSTANCE, ANY, userId, READ);
    // when
    VariableMap variables = runtimeService.getVariablesTyped(processInstanceId);
    // then
    assertNotNull(variables);
    assertFalse(variables.isEmpty());
    assertEquals(1, variables.size());
    assertEquals(VARIABLE_VALUE, variables.get(VARIABLE_NAME));
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap)

Example 73 with VariableMap

use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.

the class ProcessInstanceAuthorizationTest method testGetVariablesTypedWithReadInstancePermissionOnAnyProcessDefinition.

public void testGetVariablesTypedWithReadInstancePermissionOnAnyProcessDefinition() {
    // given
    String processInstanceId = startProcessInstanceByKey(PROCESS_KEY, getVariables()).getId();
    createGrantAuthorization(PROCESS_DEFINITION, ANY, userId, READ_INSTANCE);
    // when
    VariableMap variables = runtimeService.getVariablesTyped(processInstanceId);
    // then
    assertNotNull(variables);
    assertFalse(variables.isEmpty());
    assertEquals(1, variables.size());
    assertEquals(VARIABLE_VALUE, variables.get(VARIABLE_NAME));
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap)

Example 74 with VariableMap

use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.

the class ProcessInstanceAuthorizationTest method testGetVariablesTypedByNameWithReadInstancePermissionOnProcessDefinition.

public void testGetVariablesTypedByNameWithReadInstancePermissionOnProcessDefinition() {
    // given
    String processInstanceId = startProcessInstanceByKey(PROCESS_KEY, getVariables()).getId();
    createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, READ_INSTANCE);
    // when
    VariableMap variables = runtimeService.getVariablesTyped(processInstanceId, Arrays.asList(VARIABLE_NAME), false);
    // then
    assertNotNull(variables);
    assertFalse(variables.isEmpty());
    assertEquals(1, variables.size());
    assertEquals(VARIABLE_VALUE, variables.get(VARIABLE_NAME));
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap)

Example 75 with VariableMap

use of org.camunda.bpm.engine.variable.VariableMap in project camunda-bpm-platform by camunda.

the class ProcessInstanceAuthorizationTest method testGetVariablesLocalTypedByNameWithReadInstancePermissionOnProcessDefinition.

public void testGetVariablesLocalTypedByNameWithReadInstancePermissionOnProcessDefinition() {
    // given
    String processInstanceId = startProcessInstanceByKey(PROCESS_KEY, getVariables()).getId();
    createGrantAuthorization(PROCESS_DEFINITION, PROCESS_KEY, userId, READ_INSTANCE);
    // when
    VariableMap variables = runtimeService.getVariablesLocalTyped(processInstanceId, Arrays.asList(VARIABLE_NAME), false);
    // then
    assertNotNull(variables);
    assertFalse(variables.isEmpty());
    assertEquals(1, variables.size());
    assertEquals(VARIABLE_VALUE, variables.get(VARIABLE_NAME));
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap)

Aggregations

VariableMap (org.camunda.bpm.engine.variable.VariableMap)228 Deployment (org.camunda.bpm.engine.test.Deployment)107 Test (org.junit.Test)57 Task (org.camunda.bpm.engine.task.Task)38 ProcessInstance (org.camunda.bpm.engine.runtime.ProcessInstance)32 VariableInstance (org.camunda.bpm.engine.runtime.VariableInstance)30 VariableMapImpl (org.camunda.bpm.engine.variable.impl.VariableMapImpl)15 CaseExecutionEntity (org.camunda.bpm.engine.impl.cmmn.entity.runtime.CaseExecutionEntity)13 BpmnModelInstance (org.camunda.bpm.model.bpmn.BpmnModelInstance)13 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)12 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)12 HashMap (java.util.HashMap)11 ProcessInstanceWithVariables (org.camunda.bpm.engine.runtime.ProcessInstanceWithVariables)9 LockedExternalTask (org.camunda.bpm.engine.externaltask.LockedExternalTask)8 HistoricVariableInstance (org.camunda.bpm.engine.history.HistoricVariableInstance)8 RestException (org.camunda.bpm.engine.rest.exception.RestException)8 CaseExecutionQuery (org.camunda.bpm.engine.runtime.CaseExecutionQuery)8 Execution (org.camunda.bpm.engine.runtime.Execution)8 CaseExecution (org.camunda.bpm.engine.runtime.CaseExecution)7 ThrowErrorDelegate (org.camunda.bpm.engine.test.bpmn.event.error.ThrowErrorDelegate)7