Search in sources :

Example 1 with ScopeCollector

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;
}
Also used : ScopeCollector(org.camunda.bpm.engine.impl.tree.ScopeCollector) ReferenceWalker(org.camunda.bpm.engine.impl.tree.ReferenceWalker) FlowScopeWalker(org.camunda.bpm.engine.impl.tree.FlowScopeWalker) List(java.util.List) ScopeImpl(org.camunda.bpm.engine.impl.pvm.process.ScopeImpl) PvmActivity(org.camunda.bpm.engine.impl.pvm.PvmActivity)

Aggregations

List (java.util.List)1 PvmActivity (org.camunda.bpm.engine.impl.pvm.PvmActivity)1 ScopeImpl (org.camunda.bpm.engine.impl.pvm.process.ScopeImpl)1 FlowScopeWalker (org.camunda.bpm.engine.impl.tree.FlowScopeWalker)1 ReferenceWalker (org.camunda.bpm.engine.impl.tree.ReferenceWalker)1 ScopeCollector (org.camunda.bpm.engine.impl.tree.ScopeCollector)1