Search in sources :

Example 26 with VariableMap

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

the class ExecutionEntity method provideTenantId.

protected void provideTenantId(Map<String, Object> variables) {
    if (tenantId == null) {
        TenantIdProvider tenantIdProvider = Context.getProcessEngineConfiguration().getTenantIdProvider();
        if (tenantIdProvider != null) {
            VariableMap variableMap = Variables.fromMap(variables);
            ProcessDefinition processDefinition = getProcessDefinition();
            TenantIdProviderProcessInstanceContext ctx;
            if (superExecutionId != null) {
                ctx = new TenantIdProviderProcessInstanceContext(processDefinition, variableMap, getSuperExecution());
            } else if (superCaseExecutionId != null) {
                ctx = new TenantIdProviderProcessInstanceContext(processDefinition, variableMap, getSuperCaseExecution());
            } else {
                ctx = new TenantIdProviderProcessInstanceContext(processDefinition, variableMap);
            }
            tenantId = tenantIdProvider.provideTenantIdForProcessInstance(ctx);
        }
    }
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap) TenantIdProvider(org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProvider) PvmProcessDefinition(org.camunda.bpm.engine.impl.pvm.PvmProcessDefinition) ProcessDefinition(org.camunda.bpm.engine.repository.ProcessDefinition) TenantIdProviderProcessInstanceContext(org.camunda.bpm.engine.impl.cfg.multitenancy.TenantIdProviderProcessInstanceContext)

Example 27 with VariableMap

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

the class FormAuthorizationTest method testProcessTaskGetTaskFormVariables.

public void testProcessTaskGetTaskFormVariables() {
    // given
    startProcessInstanceByKey(RENDERED_FORM_PROCESS_KEY);
    String taskId = selectSingleTask().getId();
    createGrantAuthorization(TASK, taskId, userId, READ);
    createGrantAuthorization(PROCESS_DEFINITION, RENDERED_FORM_PROCESS_KEY, userId, READ_TASK);
    // when
    VariableMap variables = formService.getTaskFormVariables(taskId);
    // then
    assertNotNull(variables);
    assertEquals(1, variables.size());
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap)

Example 28 with VariableMap

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

the class FormAuthorizationTest method testGetStartFormVariables.

public void testGetStartFormVariables() {
    // given
    String processDefinitionId = selectProcessDefinitionByKey(RENDERED_FORM_PROCESS_KEY).getId();
    createGrantAuthorization(PROCESS_DEFINITION, RENDERED_FORM_PROCESS_KEY, userId, READ);
    // when
    VariableMap variables = formService.getStartFormVariables(processDefinitionId);
    // then
    assertNotNull(variables);
    assertEquals(1, variables.size());
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap)

Example 29 with VariableMap

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

the class FormAuthorizationTest method testProcessTaskGetTaskFormVariablesWithReadPermissionOnTask.

public void testProcessTaskGetTaskFormVariablesWithReadPermissionOnTask() {
    // given
    startProcessInstanceByKey(RENDERED_FORM_PROCESS_KEY);
    String taskId = selectSingleTask().getId();
    createGrantAuthorization(TASK, taskId, userId, READ);
    // when
    VariableMap variables = formService.getTaskFormVariables(taskId);
    // then
    assertNotNull(variables);
    assertEquals(1, variables.size());
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap)

Example 30 with VariableMap

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

the class FormAuthorizationTest method testStandaloneTaskGetTaskFormVariables.

public void testStandaloneTaskGetTaskFormVariables() {
    // given
    String taskId = "myTask";
    createTask(taskId);
    createGrantAuthorization(TASK, taskId, userId, READ);
    // when
    VariableMap variables = formService.getTaskFormVariables(taskId);
    // then
    assertNotNull(variables);
    deleteTask(taskId, true);
}
Also used : VariableMap(org.camunda.bpm.engine.variable.VariableMap)

Aggregations

VariableMap (org.camunda.bpm.engine.variable.VariableMap)230 Deployment (org.camunda.bpm.engine.test.Deployment)107 Test (org.junit.Test)59 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 HashMap (java.util.HashMap)12 ProcessEngineException (org.camunda.bpm.engine.ProcessEngineException)12 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)12 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