/** * Return a path of processors where the last element is this processor * and previous ones are nested processors that contain this one all the * way to the top but excluding the top level workflow as this is only a * list of processors. */ public static List<Processor> getNestedPathForProcessor( Processor processor, Dataflow dataflow) { for (Processor proc : dataflow.getProcessors()){ if (proc == processor){ // found it List<Processor> list = new ArrayList<Processor>(); list.add(processor); return list; } else if (Tools.containsNestedWorkflow(proc)){ // check inside this nested processor List<Processor> nestedList = getNestedPathForProcessor(processor, ((NestedDataflow)proc.getActivityList().get(0)).getNestedDataflow()); if (nestedList == null){ // processor not found in this nested workflow continue; } nestedList.add(0, proc); // add this nested processor to the list return nestedList; } } return null; }
public static Collection<Processor> getProcessorsWithActivityOutputPort( Dataflow dataflow, OutputPort outputPort) { Set<Processor> processors = new HashSet<Processor>(); for (Processor processor : dataflow.getProcessors()) { // Does it contain a nested workflow? if (containsNestedWorkflow(processor)) { // Get the nested workflow and check all its nested processors Dataflow nestedWorkflow = ((NestedDataflow) processor .getActivityList().get(0)).getNestedDataflow(); Collection<Processor> nested_processors = getProcessorsWithActivityOutputPort( nestedWorkflow, outputPort); if (!nested_processors.isEmpty()) processors.addAll(nested_processors); } // Check all processor's activities (even if the processor contained // a nested workflow, // as its dataflow activity still contains input and output ports) for (Activity<?> activity : processor.getActivityList()) { if (activity.getOutputPorts().contains(outputPort)) { processors.add(processor); } } } return processors; }
public static Collection<Processor> getProcessorsWithActivityOutputPort(Dataflow dataflow, OutputPort outputPort) { Set<Processor> processors = new HashSet<Processor>(); for (Processor processor : dataflow.getProcessors()) { // Does it contain a nested workflow? if (containsNestedWorkflow(processor)) { // Get the nested workflow and check all its nested processors Dataflow nestedWorkflow = ((NestedDataflow) processor.getActivityList().get(0)) .getNestedDataflow(); Collection<Processor> nested_processors = getProcessorsWithActivityOutputPort( nestedWorkflow, outputPort); if (!nested_processors.isEmpty()) processors.addAll(nested_processors); } // Check all processor's activities (even if the processor contained a nested workflow, // as its dataflow activity still contains input and output ports) for (Activity<?> activity : processor.getActivityList()) { if (activity.getOutputPorts().contains(outputPort)) { processors.add(processor); } } } return processors; }
public static Collection<Processor> getProcessorsWithActivityInputPort( Dataflow dataflow, ActivityInputPort inputPort) { Set<Processor> processors = new HashSet<Processor>(); for (Processor processor : dataflow.getProcessors()) { // Does it contain a nested workflow? if (containsNestedWorkflow(processor)) { // Get the nested workflow and check all its nested processors Dataflow nestedWorkflow = ((NestedDataflow) processor.getActivityList().get(0)) .getNestedDataflow(); Collection<Processor> nested_processors = getProcessorsWithActivityInputPort( nestedWorkflow, inputPort); if (!nested_processors.isEmpty()) processors.addAll(nested_processors); } // Check all processor's activities (even if the processor contained a nested workflow, // as its dataflow activity still contains input and output ports) for (Activity<?> activity : processor.getActivityList()) { if (activity.getInputPorts().contains(inputPort)) { processors.add(processor); } } } return processors; }
public static Collection<Processor> getProcessorsWithActivityInputPort( Dataflow dataflow, ActivityInputPort inputPort) { Set<Processor> processors = new HashSet<Processor>(); for (Processor processor : dataflow.getProcessors()) { // Does it contain a nested workflow? if (containsNestedWorkflow(processor)) { // Get the nested workflow and check all its nested processors Dataflow nestedWorkflow = ((NestedDataflow) processor .getActivityList().get(0)).getNestedDataflow(); Collection<Processor> nested_processors = getProcessorsWithActivityInputPort( nestedWorkflow, inputPort); if (!nested_processors.isEmpty()) processors.addAll(nested_processors); } // Check all processor's activities (even if the processor contained // a nested workflow, // as its dataflow activity still contains input and output ports) for (Activity<?> activity : processor.getActivityList()) { if (activity.getInputPorts().contains(inputPort)) { processors.add(processor); } } } return processors; }
if (containsNestedWorkflow(processor)) { Dataflow nestedWorkflow = ((NestedDataflow) processor .getActivityList().get(0)).getNestedDataflow();
if (containsNestedWorkflow(processor)) { Dataflow nestedWorkflow = ((NestedDataflow) processor .getActivityList().get(0)).getNestedDataflow();