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); }