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


Java ExecutionEntity.isEnded方法代码示例

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


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

示例1: execute

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的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

示例2: execute

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
public ProcessInstanceWithVariables execute(CommandContext commandContext) {

    ProcessDefinitionEntity processDefinition = new GetDeployedProcessDefinitionCmd(instantiationBuilder, false).execute(commandContext);

    for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) {
      checker.checkCreateProcessInstance(processDefinition);
    }

    ProcessInstanceModificationBuilderImpl modificationBuilder = instantiationBuilder.getModificationBuilder();
    ensureNotEmpty("At least one instantiation instruction required (e.g. by invoking startBefore(..), startAfter(..) or startTransition(..))",
        "instructions", modificationBuilder.getModificationOperations());

    // instantiate the process
    ActivityImpl initialActivity = determineFirstActivity(processDefinition, modificationBuilder);

    ExecutionEntity processInstance = processDefinition
        .createProcessInstance(instantiationBuilder.getBusinessKey(), instantiationBuilder.getCaseInstanceId(), initialActivity);

    if (instantiationBuilder.getTenantId() != null) {
      processInstance.setTenantId(instantiationBuilder.getTenantId());
    }

    processInstance.setSkipCustomListeners(modificationBuilder.isSkipCustomListeners());
    VariableMap variables = modificationBuilder.getProcessVariables();

    final ExecutionVariableSnapshotObserver variablesListener = new ExecutionVariableSnapshotObserver(processInstance);

    processInstance.startWithoutExecuting(variables);

    // prevent ending of the process instance between instructions
    processInstance.setPreserveScope(true);

    // apply modifications
    List<AbstractProcessInstanceModificationCommand> instructions = modificationBuilder.getModificationOperations();

    for (int i = 0; i < instructions.size(); i++) {
      AbstractProcessInstanceModificationCommand instruction = instructions.get(i);
      LOG.debugStartingInstruction(processInstance.getId(), i, instruction.describe());

      instruction.setProcessInstanceId(processInstance.getId());
      instruction.setSkipCustomListeners(modificationBuilder.isSkipCustomListeners());
      instruction.setSkipIoMappings(modificationBuilder.isSkipIoMappings());
      instruction.execute(commandContext);
    }

    if (!processInstance.hasChildren() && processInstance.isEnded()) {
      // process instance has ended regularly but this has not been propagated yet
      // due to preserveScope setting
      processInstance.propagateEnd();
    }

    return new ProcessInstanceWithVariablesImpl(processInstance, variablesListener.getVariables());
  }
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:54,代码来源:StartProcessInstanceAtActivitiesCmd.java

示例3: isActiveEventSubscription

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
private boolean isActiveEventSubscription(EventSubscriptionEntity signalEventSubscriptionEntity) {
  ExecutionEntity execution = signalEventSubscriptionEntity.getExecution();
  return !execution.isEnded() && !execution.isCanceled();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:5,代码来源:SignalEventReceivedCmd.java

示例4: isActiveIntermediateEventSubscription

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
protected boolean isActiveIntermediateEventSubscription(EventSubscriptionEntity signalEventSubscriptionEntity) {
  ExecutionEntity execution = signalEventSubscriptionEntity.getExecution();
  return execution != null && !execution.isEnded() && !execution.isCanceled();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:5,代码来源:ThrowSignalEventActivityBehavior.java


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