use of org.camunda.bpm.engine.impl.tree.ScopeCollector in project camunda-bpm-platform by camunda.
the class ProcessInstanceStartContext method getInstantiationStack.
@SuppressWarnings({ "unchecked", "rawtypes" })
public InstantiationStack getInstantiationStack() {
if (instantiationStack == null) {
FlowScopeWalker flowScopeWalker = new FlowScopeWalker(initial.getFlowScope());
ScopeCollector scopeCollector = new ScopeCollector();
flowScopeWalker.addPreVisitor(scopeCollector).walkWhile(new ReferenceWalker.WalkCondition<ScopeImpl>() {
public boolean isFulfilled(ScopeImpl element) {
return element == null || element == initial.getProcessDefinition();
}
});
List<PvmActivity> scopeActivities = (List) scopeCollector.getScopes();
Collections.reverse(scopeActivities);
instantiationStack = new InstantiationStack(scopeActivities, initial, null);
}
return instantiationStack;
}
Aggregations