private static void addActivities( Set<TransitionTarget> visited, List<TransitionTarget> targets, IActivity activity, TransitionOptions options, boolean forward, Stack<TransitionStep> steps) { ModelElementList<ITransition> transitions = forward ? activity.getOutTransitions() : activity.getInTransitions(); JoinSplitType jsType = forward ? activity.getSplitType() : activity.getJoinType(); if (JoinSplitType.And == jsType && transitions.size() > 1) { IActivity target = consume( activity, asList(transitions), CollectionUtils.<ITransition>newHashSet(), forward, options.areLoopsAllowed()); if (target != null) { addActivity(visited, targets, target, options, forward, steps); } } else { for (ITransition transition : transitions) { IActivity target = forward ? transition.getToActivity() : transition.getFromActivity(); jsType = forward ? target.getJoinType() : target.getSplitType(); if (JoinSplitType.And != jsType) { addActivity(visited, targets, target, options, forward, steps); } } } }
private static void addActivity( Set<TransitionTarget> visited, List<TransitionTarget> targets, IActivity target, TransitionOptions options, boolean forward, Stack<TransitionStep> steps) { TransitionTarget candidate = TransitionTargetFactory.createTransitionTarget(target, steps, forward); if (!visited.add(candidate)) { // target already visited, stop processing return; } if (target.getBooleanAttribute(PredefinedConstants.ACTIVITY_IS_RELOCATE_TARGET_ATT)) { // found a relocation target, check filters String processIdPattern = options.getProcessIdPattern(); if (processIdPattern == null || target.getProcessDefinition().getId().matches(processIdPattern)) { String activityIdPattern = options.getActivityIdPattern(); if (activityIdPattern == null || target.getId().matches(activityIdPattern)) { targets.add(candidate); } } } if (options.isTransitionIntoSubprocessesAllowed() && target.getImplementationType() == ImplementationType.SubProcess && target.getSubProcessMode() != SubProcessModeKey.ASYNC_SEPARATE) { IProcessDefinition process = target.getImplementationProcessDefinition(); if (process != null) { steps.push(TransitionTargetFactory.createTransitionStep(target)); addActivities(visited, targets, process, options, forward, steps); steps.pop(); } } addActivities(visited, targets, target, options, forward, steps); }
private static void addActivities( Set<TransitionTarget> visited, List<TransitionTarget> targets, IActivityInstance ai, TransitionOptions options, boolean forward, Stack<TransitionStep> steps) { if (ai != null) { steps.push(TransitionTargetFactory.createTransitionStep(ai)); // add activities from current process definition addActivities(visited, targets, ai.getActivity(), options, forward, steps); // step up into the calling process - starting activity cannot be a relocation target if (options.isTransitionOutOfSubprocessesAllowed()) { addActivities( visited, targets, ai.getProcessInstance().getStartingActivityInstance(), options, forward, steps); } steps.pop(); } }