use of org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl in project camunda-bpm-platform by camunda.
the class CaseExecutionImpl method createSubProcessInstance.
public PvmExecutionImpl createSubProcessInstance(PvmProcessDefinition processDefinition, String businessKey, String caseInstanceId) {
ExecutionImpl subProcessInstance = (ExecutionImpl) processDefinition.createProcessInstance(businessKey, caseInstanceId);
// manage bidirectional super-subprocess relation
subProcessInstance.setSuperCaseExecution(this);
setSubProcessInstance(subProcessInstance);
return subProcessInstance;
}
use of org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl in project camunda-bpm-platform by camunda.
the class MigratingActivityInstanceVisitor method instantiateScopes.
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));
}
}
use of org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl in project camunda-bpm-platform by camunda.
the class ProcessDefinitionImpl method createProcessInstance.
public PvmProcessInstance createProcessInstance(String businessKey, String caseInstanceId, ActivityImpl initial) {
PvmExecutionImpl processInstance = (PvmExecutionImpl) createProcessInstanceForInitial(initial);
processInstance.setBusinessKey(businessKey);
processInstance.setCaseInstanceId(caseInstanceId);
return processInstance;
}
use of org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl in project camunda-bpm-platform by camunda.
the class ActivityExecutionHierarchyWalker method nextElement.
@Override
protected ActivityExecutionTuple nextElement() {
PvmScope currentScope = getCurrentElement().getScope();
PvmScope flowScope = currentScope.getFlowScope();
if (flowScope != null) {
// walk to parent scope
PvmExecutionImpl execution = activityExecutionMapping.get(flowScope);
return new ActivityExecutionTuple(flowScope, execution);
} else {
// this is the process instance, look for parent
PvmExecutionImpl currentExecution = activityExecutionMapping.get(currentScope);
PvmExecutionImpl superExecution = currentExecution.getSuperExecution();
if (superExecution != null) {
// walk to parent process instance
activityExecutionMapping = superExecution.createActivityExecutionMapping();
return createTupel(superExecution);
} else {
// this is the top level process instance
return null;
}
}
}
use of org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl in project camunda-bpm-platform by camunda.
the class OutputVariablesPropagator method visit.
@Override
public void visit(ActivityExecution execution) {
if (isProcessInstanceOfSubprocess(execution)) {
PvmExecutionImpl superExecution = (PvmExecutionImpl) execution.getSuperExecution();
ActivityImpl activity = superExecution.getActivity();
SubProcessActivityBehavior subProcessActivityBehavior = (SubProcessActivityBehavior) activity.getActivityBehavior();
subProcessActivityBehavior.passOutputVariables(superExecution, execution);
}
}
Aggregations