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


Java ScopeImpl.getProcessDefinition方法代码示例

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


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

示例1: validate

import org.camunda.bpm.engine.impl.pvm.process.ScopeImpl; //导入方法依赖的package包/类
@Override
public void validate(MigratingActivityInstance migratingInstance, MigratingProcessInstance migratingProcessInstance,
    MigratingActivityInstanceValidationReportImpl instanceReport) {

  ScopeImpl sourceScope = migratingInstance.getSourceScope();

  if (sourceScope != sourceScope.getProcessDefinition()) {
    ActivityImpl sourceActivity = (ActivityImpl) migratingInstance.getSourceScope();

    if (!SupportedActivityValidator.INSTANCE.isSupportedActivity(sourceActivity)) {
      instanceReport.addFailure("The type of the source activity is not supported for activity instance migration");
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:15,代码来源:SupportedActivityInstanceValidator.java

示例2: validateParentScopeMigrates

import org.camunda.bpm.engine.impl.pvm.process.ScopeImpl; //导入方法依赖的package包/类
protected void validateParentScopeMigrates(ValidatingMigrationInstruction instruction, ValidatingMigrationInstructions instructions,
    MigrationInstructionValidationReportImpl report) {
  ActivityImpl sourceActivity = instruction.getSourceActivity();
  ScopeImpl flowScope = sourceActivity.getFlowScope();

  if (flowScope != flowScope.getProcessDefinition()) {
    if (instructions.getInstructionsBySourceScope(flowScope).isEmpty()) {
      report.addFailure("The gateway's flow scope '" + flowScope.getId() + "' must be mapped");
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:12,代码来源:GatewayMappingValidator.java

示例3: validate

import org.camunda.bpm.engine.impl.pvm.process.ScopeImpl; //导入方法依赖的package包/类
public void validate(ValidatingMigrationInstruction instruction, ValidatingMigrationInstructions instructions, MigrationInstructionValidationReportImpl report) {
  ValidatingMigrationInstruction ancestorScopeInstruction = getClosestPreservedAncestorScopeMigrationInstruction(instruction, instructions);
  ScopeImpl targetScope = instruction.getTargetActivity();

  if (ancestorScopeInstruction != null && targetScope != null && targetScope != targetScope.getProcessDefinition()) {
    ScopeImpl parentInstanceTargetScope = ancestorScopeInstruction.getTargetActivity();
    if (parentInstanceTargetScope != null && !parentInstanceTargetScope.isAncestorFlowScopeOf(targetScope)) {
      report.addFailure("The closest mapped ancestor '" + ancestorScopeInstruction.getSourceActivity().getId() + "' is mapped to scope '" +
        parentInstanceTargetScope.getId() + "' which is not an ancestor of target scope '" + targetScope.getId() + "'");
    }
  }
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:13,代码来源:AdditionalFlowScopeInstructionValidator.java

示例4: findMappedEventScope

import org.camunda.bpm.engine.impl.pvm.process.ScopeImpl; //导入方法依赖的package包/类
protected ScopeImpl findMappedEventScope(ScopeImpl sourceEventScope, ValidatingMigrationInstruction instruction, ValidatingMigrationInstructions instructions) {
  if (sourceEventScope != null) {
    if (sourceEventScope == sourceEventScope.getProcessDefinition()) {
      return instruction.getTargetActivity().getProcessDefinition();
    }
    else {
      List<ValidatingMigrationInstruction> eventScopeInstructions = instructions.getInstructionsBySourceScope(sourceEventScope);
      if (eventScopeInstructions.size() > 0) {
        return eventScopeInstructions.get(0).getTargetActivity();
      }
    }
  }
  return null;
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:15,代码来源:SameEventScopeInstructionValidator.java

示例5: migrateState

import org.camunda.bpm.engine.impl.pvm.process.ScopeImpl; //导入方法依赖的package包/类
@Override
public void migrateState() {
  ScopeImpl targetActivity = migratingActivityInstance.getTargetScope();
  ProcessDefinition targetProcessDefinition = (ProcessDefinition) targetActivity.getProcessDefinition();

  externalTask.setActivityId(targetActivity.getId());
  externalTask.setProcessDefinitionId(targetProcessDefinition.getId());
  externalTask.setProcessDefinitionKey(targetProcessDefinition.getKey());
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:10,代码来源:MigratingExternalTaskInstance.java

示例6: migrateProcessElementInstance

import org.camunda.bpm.engine.impl.pvm.process.ScopeImpl; //导入方法依赖的package包/类
protected void migrateProcessElementInstance(MigratingProcessElementInstance migratingInstance, MigratingScopeInstanceBranch migratingInstanceBranch) {
  final MigratingScopeInstance parentMigratingInstance = migratingInstance.getParent();

  ScopeImpl sourceScope = migratingInstance.getSourceScope();
  ScopeImpl targetScope = migratingInstance.getTargetScope();
  ScopeImpl targetFlowScope = targetScope.getFlowScope();
  ScopeImpl parentActivityInstanceTargetScope = parentMigratingInstance != null ? parentMigratingInstance.getTargetScope() : null;

  if (sourceScope != sourceScope.getProcessDefinition() && targetFlowScope != parentActivityInstanceTargetScope) {
    // create intermediate scopes

    // 1. manipulate execution tree

    // determine the list of ancestor scopes (parent, grandparent, etc.) for which
    //     no executions exist yet
    List<ScopeImpl> nonExistingScopes = collectNonExistingFlowScopes(targetFlowScope, migratingInstanceBranch);

    // get the closest ancestor scope that is instantiated already
    ScopeImpl existingScope = nonExistingScopes.isEmpty() ?
        targetFlowScope :
        nonExistingScopes.get(0).getFlowScope();

    // and its scope instance
    MigratingScopeInstance ancestorScopeInstance = migratingInstanceBranch.getInstance(existingScope);

    // Instantiate the scopes as children of the scope execution
    instantiateScopes(ancestorScopeInstance, migratingInstanceBranch, nonExistingScopes);

    MigratingScopeInstance targetFlowScopeInstance = migratingInstanceBranch.getInstance(targetFlowScope);

    // 2. detach instance
    // The order of steps 1 and 2 avoids intermediate execution tree compaction
    // which in turn could overwrite some dependent instances (e.g. variables)
    migratingInstance.detachState();

    // 3. attach to newly created activity instance
    migratingInstance.attachState(targetFlowScopeInstance);
  }

  // 4. update state (e.g. activity id)
  migratingInstance.migrateState();

  // 5. migrate instance state other than execution-tree structure
  migratingInstance.migrateDependentEntities();
}
 
开发者ID:camunda,项目名称:camunda-bpm-platform,代码行数:46,代码来源:MigratingProcessElementInstanceVisitor.java


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