Java Code Examples for org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity#getTenantId()

The following examples show how to use org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity#getTenantId() . 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: ModifyProcessInstanceAsyncCmd.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
@Override
public Batch execute(CommandContext commandContext) {
  String processInstanceId = builder.getProcessInstanceId();

  ExecutionManager executionManager = commandContext.getExecutionManager();
  ExecutionEntity processInstance = executionManager.findExecutionById(processInstanceId);

  ensureProcessInstanceExists(processInstanceId, processInstance);

  String processDefinitionId = processInstance.getProcessDefinitionId();
  String tenantId = processInstance.getTenantId();

  String deploymentId = commandContext.getProcessEngineConfiguration().getDeploymentCache()
    .findDeployedProcessDefinitionById(processDefinitionId)
    .getDeploymentId();

  return new BatchBuilder(commandContext)
      .type(Batch.TYPE_PROCESS_INSTANCE_MODIFICATION)
      .config(getConfiguration(processDefinitionId, deploymentId))
      .tenantId(tenantId)
      .totalJobs(1)
      .permission(BatchPermissions.CREATE_BATCH_MODIFY_PROCESS_INSTANCES)
      .operationLogHandler(this::writeOperationLog)
      .build();
}
 
Example 2
Source File: DefaultDmnHistoryEventProducer.java    From camunda-bpm-platform with Apache License 2.0 6 votes vote down vote up
protected HistoricDecisionInstanceEntity createDecisionEvaluatedEvt(DmnDecisionLogicEvaluationEvent evaluationEvent, ExecutionEntity execution) {
  // create event instance
  HistoricDecisionInstanceEntity event = newDecisionInstanceEventEntity(execution, evaluationEvent);
  setReferenceToProcessInstance(event, execution);

  if (isHistoryRemovalTimeStrategyStart()) {
    provideRemovalTime(event);
  }

  // initialize event
  initDecisionInstanceEvent(event, evaluationEvent, HistoryEventTypes.DMN_DECISION_EVALUATE);

  DecisionDefinition decisionDefinition = (DecisionDefinition) evaluationEvent.getDecision();
  String tenantId = execution.getTenantId();
  if (tenantId == null) {
    tenantId = provideTenantId(decisionDefinition, event);
  }
  event.setTenantId(tenantId);
  return event;
}
 
Example 3
Source File: DefaultHistoryEventProducer.java    From camunda-bpm-platform with Apache License 2.0 5 votes vote down vote up
protected void initProcessInstanceEvent(HistoricProcessInstanceEventEntity evt, ExecutionEntity execution, HistoryEventType eventType) {

    String processDefinitionId = execution.getProcessDefinitionId();
    String processInstanceId = execution.getProcessInstanceId();
    String executionId = execution.getId();
    // the given execution is the process instance!
    String caseInstanceId = execution.getCaseInstanceId();
    String tenantId = execution.getTenantId();

    ProcessDefinitionEntity definition = execution.getProcessDefinition();
    String processDefinitionKey = null;
    if (definition != null) {
      processDefinitionKey = definition.getKey();
    }

    evt.setId(processInstanceId);
    evt.setEventType(eventType.getEventName());
    evt.setProcessDefinitionKey(processDefinitionKey);
    evt.setProcessDefinitionId(processDefinitionId);
    evt.setProcessInstanceId(processInstanceId);
    evt.setExecutionId(executionId);
    evt.setBusinessKey(execution.getProcessBusinessKey());
    evt.setCaseInstanceId(caseInstanceId);
    evt.setTenantId(tenantId);
    evt.setRootProcessInstanceId(execution.getRootProcessInstanceId());

    if (execution.getSuperCaseExecution() != null) {
      evt.setSuperCaseInstanceId(execution.getSuperCaseExecution().getCaseInstanceId());
    }
    if (execution.getSuperExecution() != null) {
      evt.setSuperProcessInstanceId(execution.getSuperExecution().getProcessInstanceId());
    }
  }