当前位置: 首页>>代码示例>>Java>>正文


Java CommandContext.getExecutionManager方法代码示例

本文整理汇总了Java中org.camunda.bpm.engine.impl.interceptor.CommandContext.getExecutionManager方法的典型用法代码示例。如果您正苦于以下问题:Java CommandContext.getExecutionManager方法的具体用法?Java CommandContext.getExecutionManager怎么用?Java CommandContext.getExecutionManager使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.camunda.bpm.engine.impl.interceptor.CommandContext的用法示例。


在下文中一共展示了CommandContext.getExecutionManager方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateSuspensionState

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
protected void updateSuspensionState(CommandContext commandContext, SuspensionState suspensionState) {
  ExecutionManager executionManager = commandContext.getExecutionManager();
  TaskManager taskManager = commandContext.getTaskManager();
  ExternalTaskManager externalTaskManager = commandContext.getExternalTaskManager();

  if (processInstanceId != null) {
    executionManager.updateExecutionSuspensionStateByProcessInstanceId(processInstanceId, suspensionState);
    taskManager.updateTaskSuspensionStateByProcessInstanceId(processInstanceId, suspensionState);
    externalTaskManager.updateExternalTaskSuspensionStateByProcessInstanceId(processInstanceId, suspensionState);

  } else if (processDefinitionId != null) {
    executionManager.updateExecutionSuspensionStateByProcessDefinitionId(processDefinitionId, suspensionState);
    taskManager.updateTaskSuspensionStateByProcessDefinitionId(processDefinitionId, suspensionState);
    externalTaskManager.updateExternalTaskSuspensionStateByProcessDefinitionId(processDefinitionId, suspensionState);

  } else if (isProcessDefinitionTenantIdSet) {
    executionManager.updateExecutionSuspensionStateByProcessDefinitionKeyAndTenantId(processDefinitionKey, processDefinitionTenantId, suspensionState);
    taskManager.updateTaskSuspensionStateByProcessDefinitionKeyAndTenantId(processDefinitionKey, processDefinitionTenantId, suspensionState);
    externalTaskManager.updateExternalTaskSuspensionStateByProcessDefinitionKeyAndTenantId(processDefinitionKey, processDefinitionTenantId, suspensionState);

  } else {
    executionManager.updateExecutionSuspensionStateByProcessDefinitionKey(processDefinitionKey, suspensionState);
    taskManager.updateTaskSuspensionStateByProcessDefinitionKey(processDefinitionKey, suspensionState);
    externalTaskManager.updateExternalTaskSuspensionStateByProcessDefinitionKey(processDefinitionKey, suspensionState);
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:28,代码来源:AbstractSetProcessInstanceStateCmd.java

示例2: execute

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
public List<String> execute(CommandContext commandContext) {
  ensureNotNull("executionId", executionId);

  // fetch execution
  ExecutionManager executionManager = commandContext.getExecutionManager();
  ExecutionEntity execution = executionManager.findExecutionById(executionId);
  ensureNotNull("execution " + executionId + " doesn't exist", "execution", execution);

  checkGetActivityIds(execution, commandContext);

  // fetch active activities
  return execution.findActiveActivityIds();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:14,代码来源:FindActiveActivityIdsCmd.java

示例3: sendSignalToExecution

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected void sendSignalToExecution(CommandContext commandContext, String signalName, String executionId) {

    ExecutionManager executionManager = commandContext.getExecutionManager();
    ExecutionEntity execution = executionManager.findExecutionById(executionId);
    ensureNotNull("Cannot find execution with id '" + executionId + "'", "execution", execution);

    EventSubscriptionManager eventSubscriptionManager = commandContext.getEventSubscriptionManager();
    List<EventSubscriptionEntity> signalEvents = eventSubscriptionManager.findSignalEventSubscriptionsByNameAndExecution(signalName, executionId);
    ensureNotEmpty("Execution '" + executionId + "' has not subscribed to a signal event with name '" + signalName + "'.", signalEvents);

    checkAuthorizationOfCatchSignals(commandContext, signalEvents);
    notifyExecutions(signalEvents);
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:14,代码来源:SignalEventReceivedCmd.java

示例4: execute

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
@Override
public Void execute(CommandContext commandContext) {
  String processInstanceId = builder.getProcessInstanceId();

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

  ensureProcessInstanceExist(processInstanceId, processInstance);

  checkUpdateProcessInstance(processInstance, commandContext);

  processInstance.setPreserveScope(true);

  List<AbstractProcessInstanceModificationCommand> instructions = builder.getModificationOperations();

  checkCancellation(commandContext);
  for (int i = 0; i < instructions.size(); i++) {

    AbstractProcessInstanceModificationCommand instruction = instructions.get(i);
    LOG.debugModificationInstruction(processInstanceId, i + 1, instruction.describe());

    instruction.setSkipCustomListeners(builder.isSkipCustomListeners());
    instruction.setSkipIoMappings(builder.isSkipIoMappings());
    instruction.execute(commandContext);
  }

  processInstance = executionManager.findExecutionById(processInstanceId);

  if (!processInstance.hasChildren()) {
    if (!(processInstance.getActivity() != null && !processInstance.getId().equals(processInstance.getActivityInstanceId()))) {
      // process instance was cancelled
      checkDeleteProcessInstance(processInstance, commandContext);
      deletePropagate(processInstance, builder.getModificationReason(), builder.isSkipCustomListeners(), builder.isSkipIoMappings());
    }
    else if (processInstance.isEnded()) {
      // process instance has ended regularly
      processInstance.propagateEnd();
    }
  }

  if (writeOperationLog) {
    commandContext.getOperationLogManager().logProcessInstanceOperation(getLogEntryOperation(),
      processInstanceId,
      null,
      null,
      Collections.singletonList(PropertyChange.EMPTY_CHANGE));
  }

  return null;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:51,代码来源:ModifyProcessInstanceCmd.java

示例5: deleteProcessInstance

import org.camunda.bpm.engine.impl.interceptor.CommandContext; //导入方法依赖的package包/类
protected void deleteProcessInstance(
    final CommandContext commandContext,
    String processInstanceId,
    final String deleteReason,
    final boolean skipCustomListeners,
    boolean externallyTerminated,
    final boolean skipIoMappings,
    boolean skipSubprocesses) {
  ensureNotNull(BadUserRequestException.class, "processInstanceId is null", "processInstanceId", processInstanceId);

  // fetch process instance
  ExecutionManager executionManager = commandContext.getExecutionManager();
  final ExecutionEntity execution = executionManager.findExecutionById(processInstanceId);

  ensureNotNull(BadUserRequestException.class, "No process instance found for id '" + processInstanceId + "'", "processInstance", execution);

  checkDeleteProcessInstance(execution, commandContext);

  // delete process instance
  commandContext
      .getExecutionManager()
      .deleteProcessInstance(processInstanceId, deleteReason, false, skipCustomListeners, externallyTerminated, skipIoMappings, skipSubprocesses);

  if (skipSubprocesses) {
    List<ProcessInstance> superProcesslist = commandContext.getProcessEngineConfiguration().getRuntimeService().createProcessInstanceQuery()
        .superProcessInstanceId(processInstanceId).list();
    triggerHistoryEvent(superProcesslist);
  }

  final ExecutionEntity superExecution = execution.getSuperExecution();
  if (superExecution != null) {
    commandContext.runWithoutAuthorization(new Callable<Void>() {
      public Void call() {
        ProcessInstanceModificationBuilderImpl builder = (ProcessInstanceModificationBuilderImpl) new ProcessInstanceModificationBuilderImpl(commandContext, superExecution.getProcessInstanceId(), deleteReason)
          .cancelActivityInstance(superExecution.getActivityInstanceId());
        builder.execute(false, skipCustomListeners, skipIoMappings);
        return null;
      }
    });

  }

  // create user operation log
  commandContext.getOperationLogManager()
      .logProcessInstanceOperation(UserOperationLogEntry.OPERATION_TYPE_DELETE, processInstanceId,
          null, null, Collections.singletonList(PropertyChange.EMPTY_CHANGE));
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:48,代码来源:AbstractDeleteProcessInstanceCmd.java


注:本文中的org.camunda.bpm.engine.impl.interceptor.CommandContext.getExecutionManager方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。