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


Java ExecutionEntity.setActive方法代码示例

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


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

示例1: read

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
public ExecutionEntity read(GettableData data) {
  ExecutionEntity executionEntity = new ExecutionEntity();
  executionEntity.setId(data.getString("id"));
  executionEntity.setProcessInstanceId(data.getString("proc_inst_id"));
  executionEntity.setParentId(data.getString("parent_id"));
  executionEntity.setProcessDefinitionId(data.getString("proc_def_id"));
  executionEntity.setSuperExecutionId(data.getString("super_exec"));
  executionEntity.setSuperCaseExecutionId(data.getString("super_case_exec"));
  executionEntity.setCaseInstanceId(data.getString("case_inst_id"));
  executionEntity.setActivityInstanceId(data.getString("act_inst_id"));
  executionEntity.setActivityId(data.getString("act_id"));
  executionEntity.setActive(data.getBool("is_active"));
  executionEntity.setConcurrent(data.getBool("is_concurrent"));
  executionEntity.setScope(data.getBool("is_scope"));
  executionEntity.setEventScope(data.getBool("is_event_scope"));
  executionEntity.setSuspensionState(data.getInt("suspension_state"));
  executionEntity.setCachedEntityState(data.getInt("cached_ent_state"));
  executionEntity.setSequenceCounter(data.getLong("sequence_counter"));

  return executionEntity;
}
 
开发者ID:camunda,项目名称:camunda-engine-cassandra,代码行数:22,代码来源:ExecutionEntitySerializer.java

示例2: instantiateScopes

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
protected void instantiateScopes(
    MigratingScopeInstance ancestorScopeInstance,
    MigratingScopeInstanceBranch executionBranch,
    List<ScopeImpl> scopesToInstantiate) {

  if (scopesToInstantiate.isEmpty()) {
    return;
  }

  // must always be an activity instance
  MigratingActivityInstance ancestorActivityInstance = (MigratingActivityInstance) ancestorScopeInstance;

  ExecutionEntity newParentExecution = ancestorActivityInstance.createAttachableExecution();

  Map<PvmActivity, PvmExecutionImpl> createdExecutions =
      newParentExecution.instantiateScopes((List) scopesToInstantiate, skipCustomListeners, skipIoMappings);

  for (ScopeImpl scope : scopesToInstantiate) {
    ExecutionEntity createdExecution = (ExecutionEntity) createdExecutions.get(scope);
    createdExecution.setActivity(null);
    createdExecution.setActive(false);
    executionBranch.visited(new MigratingActivityInstance(scope, createdExecution));
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:25,代码来源:MigratingActivityInstanceVisitor.java

示例3: detachState

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
@Override
public void detachState() {

  jobInstance.detachState();
  for (MigratingInstance dependentInstance : migratingDependentInstances) {
    dependentInstance.detachState();
  }

  ExecutionEntity execution = resolveRepresentativeExecution();
  execution.setActive(false);
  getParent().destroyAttachableExecution(execution);

  setParent(null);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:15,代码来源:MigratingTransitionInstance.java

示例4: instantiateScopes

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
@Override
protected void instantiateScopes(
    MigratingScopeInstance ancestorScopeInstance,
    MigratingScopeInstanceBranch executionBranch,
    List<ScopeImpl> scopesToInstantiate) {

  if (scopesToInstantiate.isEmpty()) {
    return;
  }

  ExecutionEntity ancestorScopeExecution = ancestorScopeInstance.resolveRepresentativeExecution();

  ExecutionEntity parentExecution = ancestorScopeExecution;

  for (ScopeImpl scope : scopesToInstantiate) {
    ExecutionEntity compensationScopeExecution = parentExecution.createExecution();
    compensationScopeExecution.setScope(true);
    compensationScopeExecution.setEventScope(true);

    compensationScopeExecution.setActivity((PvmActivity) scope);
    compensationScopeExecution.setActive(false);
    compensationScopeExecution.activityInstanceStarting();
    compensationScopeExecution.enterActivityInstance();

    EventSubscriptionEntity eventSubscription = EventSubscriptionEntity.createAndInsert(parentExecution, EventType.COMPENSATE, (ActivityImpl) scope);
    eventSubscription.setConfiguration(compensationScopeExecution.getId());

    executionBranch.visited(new MigratingEventScopeInstance(eventSubscription, compensationScopeExecution, scope));

    parentExecution = compensationScopeExecution;
  }

}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:34,代码来源:MigrationCompensationInstanceVisitor.java

示例5: detachState

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
@Override
public void detachState() {
  ExecutionEntity currentExecution = resolveRepresentativeExecution();

  currentExecution.setActivity(null);
  currentExecution.leaveActivityInstance();
  currentExecution.setActive(false);

  getParent().destroyAttachableExecution(currentExecution);
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:11,代码来源:MigratingActivityInstance.java

示例6: handleEvent

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
@Override
public void handleEvent(EventSubscriptionEntity eventSubscription, Object payload, CommandContext commandContext) {
  eventSubscription.delete();

  String configuration = eventSubscription.getConfiguration();
  ensureNotNull("Compensating execution not set for compensate event subscription with id " + eventSubscription.getId(), "configuration", configuration);

  ExecutionEntity compensatingExecution = commandContext.getExecutionManager().findExecutionById(configuration);

  ActivityImpl compensationHandler = eventSubscription.getActivity();

  // activate execution
  compensatingExecution.setActive(true);

  if (compensatingExecution.getActivity().getActivityBehavior() instanceof CompositeActivityBehavior) {
    compensatingExecution.getParent().setActivityInstanceId(compensatingExecution.getActivityInstanceId());
  }

  if (compensationHandler.isScope() && !compensationHandler.isCompensationHandler()) {
    // descend into scope:
    List<EventSubscriptionEntity> eventsForThisScope = compensatingExecution.getCompensateEventSubscriptions();
    CompensationUtil.throwCompensationEvent(eventsForThisScope, compensatingExecution, false);

  } else {
    try {


      if (compensationHandler.isSubProcessScope() && compensationHandler.isTriggeredByEvent()) {
        compensatingExecution.executeActivity(compensationHandler);
      }
      else {
        // since we already have a scope execution, we don't need to create another one
        // for a simple scoped compensation handler
        compensatingExecution.setActivity(compensationHandler);
        compensatingExecution.performOperation(PvmAtomicOperation.ACTIVITY_START);
      }


    } catch (Exception e) {
      throw new ProcessEngineException("Error while handling compensation event " + eventSubscription, e);
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:44,代码来源:CompensationEventHandler.java

示例7: createEventScopeExecution

import org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity; //导入方法依赖的package包/类
/**
 * creates an event scope for the given execution:
 *
 * create a new event scope execution under the parent of the given execution
 * and move all event subscriptions to that execution.
 *
 * this allows us to "remember" the event subscriptions after finishing a
 * scope
 */
public static void createEventScopeExecution(ExecutionEntity execution) {

  // parent execution is a subprocess or a miBody
  ActivityImpl activity = execution.getActivity();
  ExecutionEntity scopeExecution = (ExecutionEntity) execution.findExecutionForFlowScope(activity.getFlowScope());

  List<EventSubscriptionEntity> eventSubscriptions = execution.getCompensateEventSubscriptions();

  if (eventSubscriptions.size() > 0 || hasCompensationEventSubprocess(activity)) {

    ExecutionEntity eventScopeExecution = scopeExecution.createExecution();
    eventScopeExecution.setActivity(execution.getActivity());
    eventScopeExecution.activityInstanceStarting();
    eventScopeExecution.enterActivityInstance();
    eventScopeExecution.setActive(false);
    eventScopeExecution.setConcurrent(false);
    eventScopeExecution.setEventScope(true);

    // copy local variables to eventScopeExecution by value. This way,
    // the eventScopeExecution references a 'snapshot' of the local variables
    Map<String, Object> variables = execution.getVariablesLocal();
    for (Entry<String, Object> variable : variables.entrySet()) {
      eventScopeExecution.setVariableLocal(variable.getKey(), variable.getValue());
    }

    // set event subscriptions to the event scope execution:
    for (EventSubscriptionEntity eventSubscriptionEntity : eventSubscriptions) {
      EventSubscriptionEntity newSubscription =
              EventSubscriptionEntity.createAndInsert(
                      eventScopeExecution,
                      EventType.COMPENSATE,
                      eventSubscriptionEntity.getActivity());
      newSubscription.setConfiguration(eventSubscriptionEntity.getConfiguration());
      // use the original date
      newSubscription.setCreated(eventSubscriptionEntity.getCreated());
    }

    // set existing event scope executions as children of new event scope execution
    // (ensuring they don't get removed when 'execution' gets removed)
    for (PvmExecutionImpl childEventScopeExecution : execution.getEventScopeExecutions()) {
      childEventScopeExecution.setParent(eventScopeExecution);
    }

    ActivityImpl compensationHandler = getEventScopeCompensationHandler(execution);
    EventSubscriptionEntity eventSubscription = EventSubscriptionEntity
            .createAndInsert(
              scopeExecution,
              EventType.COMPENSATE,
              compensationHandler
            );
    eventSubscription.setConfiguration(eventScopeExecution.getId());

  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:64,代码来源:CompensationUtil.java


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