public ProcessorResultsComponent(Processor processor, Dataflow dataflow, String runId, ReferenceService referenceService) { super(new BorderLayout()); this.processor = processor; this.processorsPath = Tools.getNestedPathForProcessor( processor, dataflow); this.dataflow = dataflow; this.runId = runId; this.referenceService = referenceService; this.facade = null; initComponents(); }
/** * 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 ProcessorResultsComponent(WorkflowInstanceFacade facade, Processor processor, Dataflow dataflow, String runId, ReferenceService referenceService) { super(new BorderLayout()); this.processor = processor; this.processorsPath = Tools.getNestedPathForProcessor( processor, dataflow); this.dataflow = dataflow; this.runId = runId; this.referenceService = referenceService; this.facade = facade; // Is this still a running wf - do we need to periodically check with // provenance for new results? resultsUpdateNeeded = !(facade.getState().equals(State.cancelled) || facade .getState().equals(State.completed)); initComponents(); }