Java Code Examples for org.camunda.bpm.engine.variable.Variables#fromMap()

The following examples show how to use org.camunda.bpm.engine.variable.Variables#fromMap() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CaseExecutionEntity.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
protected void provideTenantId(Map<String, Object> variables) {
  TenantIdProvider tenantIdProvider = Context.getProcessEngineConfiguration().getTenantIdProvider();

  if(tenantIdProvider != null) {
    VariableMap variableMap = Variables.fromMap(variables);
    CaseDefinition caseDefinition = (CaseDefinition) getCaseDefinition();

    TenantIdProviderCaseInstanceContext ctx = null;

    if(superExecutionId != null) {
      ctx = new TenantIdProviderCaseInstanceContext(caseDefinition, variableMap, getSuperExecution());
    }
    else if(superCaseExecutionId != null) {
      ctx = new TenantIdProviderCaseInstanceContext(caseDefinition, variableMap, getSuperCaseExecution());
    }
    else {
      ctx = new TenantIdProviderCaseInstanceContext(caseDefinition, variableMap);
    }

    tenantId = tenantIdProvider.provideTenantIdForCaseInstance(ctx);
  }
}
 
Example 2
Source File: ExecutionEntity.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
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);
    }
  }
}
 
Example 3
Source File: CaseInstanceBuilderImpl.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public CaseInstanceBuilder setVariables(Map<String, Object> variables) {
  if (variables != null) {
    if (this.variables == null) {
      this.variables = Variables.fromMap(variables);
    }
    else {
      this.variables.putAll(variables);
    }
  }
  return this;
}
 
Example 4
Source File: EvaluateDecisionCmd.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public EvaluateDecisionCmd(DecisionEvaluationBuilderImpl builder) {
  this.decisionDefinitionKey = builder.getDecisionDefinitionKey();
  this.decisionDefinitionId = builder.getDecisionDefinitionId();
  this.version = builder.getVersion();
  this.variables = Variables.fromMap(builder.getVariables());
  this.decisionDefinitionTenantId = builder.getDecisionDefinitionTenantId();
  this.isTenandIdSet = builder.isTenantIdSet();
}
 
Example 5
Source File: EvaluateDecisionTableCmd.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
public EvaluateDecisionTableCmd(DecisionTableEvaluationBuilderImpl builder) {
  this.decisionDefinitionKey = builder.getDecisionDefinitionKey();
  this.decisionDefinitionId = builder.getDecisionDefinitionId();
  this.version = builder.getVersion();
  this.variables = Variables.fromMap(builder.getVariables());
  this.decisionDefinitionTenantId = builder.getDecisionDefinitionTenantId();
  this.isTenandIdSet = builder.isTenantIdSet();
}
 
Example 6
Source File: SubmitTaskFormCmd.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public SubmitTaskFormCmd(String taskId, Map<String, Object> properties, boolean returnVariables, boolean deserializeValues) {
  this.taskId = taskId;
  this.properties = Variables.fromMap(properties);
  this.returnVariables = returnVariables;
  this.deserializeValues = deserializeValues;
}
 
Example 7
Source File: SubmitStartFormCmd.java    From camunda-bpm-platform with Apache License 2.0 4 votes vote down vote up
public SubmitStartFormCmd(String processDefinitionId, String businessKey, Map<String, Object> properties) {
  this.processDefinitionId = processDefinitionId;
  this.businessKey = businessKey;
  this.variables = Variables.fromMap(properties);
}