@Override public void refreshView() { datalinkView = new JPanel(new FlowLayout(FlowLayout.LEFT)); datalinkView.setBorder(new EmptyBorder(5,5,5,5)); JLabel label = new JLabel (getTextFromDepth("link", datalink.getResolvedDepth())); datalinkView.add(label); }
/** * Forward the specified event to all targets * * @param e */ public void sendEvent(WorkflowDataToken e) { for (Datalink link : outgoingLinks) { link.getSink().receiveEvent(e); } }
} else if (dl.getResolvedDepth() == -1) { int granularDepth = dl.getSource().getGranularDepth(); int resolvedDepth = dl.getResolvedDepth(); dopi.setDepths(resolvedDepth, granularDepth);
HashSet<String> outputPortNames = new HashSet<String>(); for (Datalink dl : currentDataflow.getLinks()) { final EventForwardingOutputPort datalinkSource = dl.getSource(); final EventHandlingInputPort datalinkSink = dl.getSink(); if (oldNewMapping.containsKey(datalinkSource) && oldNewMapping.containsKey(datalinkSink)) { datalinkSink, edits.createDataflowInputPort(portName, dl.getResolvedDepth(), dl.getResolvedDepth(), nestedDataflow));
public Element datalinksToXML(List<? extends Datalink> links) throws SerializationException { Element result = new Element(DATALINKS, T2_WORKFLOW_NAMESPACE); for (Datalink link : links) { if (determineDatalinkType(link.getSource()) != DATALINK_TYPES.MERGE) { result.addContent(datalinkToXML(link)); } } return result; } }
/** * Forward the specified event to all targets * * @param e */ public void sendEvent(WorkflowDataToken e) { for (Datalink link : outgoingLinks) { link.getSink().receiveEvent(e); } }
} else if (dl.getResolvedDepth() == -1) { int granularDepth = dl.getSource().getGranularDepth(); int resolvedDepth = dl.getResolvedDepth(); dopi.setDepths(resolvedDepth, granularDepth);
public Element datalinksToXML(List<? extends Datalink> links) throws SerializationException { Element result = new Element(DATALINKS, T2_WORKFLOW_NAMESPACE); for (Datalink link : links) { if (determineDatalinkType(link.getSource()) != DATALINK_TYPES.MERGE) { result.addContent(datalinkToXML(link)); } } return result; } }
/** * Forward the specified event to all targets * * @param e */ public void sendEvent(WorkflowDataToken e) { for (Datalink link : outgoingLinks) { link.getSink().receiveEvent(e); } }
} else if (dl.getResolvedDepth() == -1) { int granularDepth = dl.getSource().getGranularDepth(); int resolvedDepth = dl.getResolvedDepth(); dopi.setDepths(resolvedDepth, granularDepth);
public boolean isInputPortConnected(DataflowInputPort inputPort) { List<? extends Datalink> links = getLinks(); for (Datalink link : links) { if (link.getSource().equals(inputPort.getInternalOutputPort())) { return true; } } return false; }
public boolean doTypeCheck() throws IterationTypeMismatchException { if (inputs.size() == 0) { // Arguable, but technically a merge with no inputs is valid, it may // make more sense to throw an exception here though as it has no // actual meaning. return true; } // Return false if we have unbound input ports or bound ports where the // resolved depth hasn't been calculated yet for (MergeInputPort ip : inputs) { if (ip.getIncomingLink() == null || ip.getIncomingLink().getResolvedDepth() == -1) { return false; } } // Got all input ports, now scan for input depths int inputDepth = inputs.get(0).getIncomingLink().getResolvedDepth(); for (MergeInputPort ip : inputs) { if (ip.getIncomingLink().getResolvedDepth() != inputDepth) { throw new IterationTypeMismatchException(); } } // Got to here so all the input resolved depths match, push depth+1 to // all outgoing links and return true for (DatalinkImpl dli : output.outgoingLinks) { dli.setResolvedDepth(inputDepth+1); } return true; } }
public static Edit<?> getMoveDatalinkSinkEdit(Dataflow dataflow, Datalink datalink, EventHandlingInputPort sink, Edits edits) { List<Edit<?>> editList = new ArrayList<Edit<?>>(); editList.add(edits.getDisconnectDatalinkEdit(datalink)); if (datalink.getSink() instanceof ProcessorInputPort) { editList .add(getRemoveProcessorInputPortEdit((ProcessorInputPort) datalink .getSink(), edits)); } editList.add(getCreateAndConnectDatalinkEdit(dataflow, datalink .getSource(), sink, edits)); return new CompoundEdit(editList); }
if (outgoingLinks.size() == 1) { Datalink datalink = outgoingLinks.iterator().next(); EventHandlingInputPort sink = datalink.getSink(); if (sink instanceof ProcessorInputPort) { Processor sinkProcessor = ((ProcessorInputPort) sink).getProcessor();
return false; } else { if (input.getIncomingLink().getResolvedDepth() == -1) { .getResolvedDepth()); input.setFilterDepth(input.getIncomingLink().getSource() .getGranularDepth());
public MergeConfigurationView(Merge merge){ super((Frame)null, "Merge Configuration", true); this.merge = merge; // Ordered list of merge's input ports inputPortsList = new ArrayList<MergeInputPort>(merge.getInputPorts()); // Generate labels for the input ports (label displays a link from a workflow entity // towards the merge's input port) labelListModel = new DefaultListModel(); String maxLabel = "Order of incoming links (entity.port -> merge):"+"Push"; for (MergeInputPort mergeInputPort : inputPortsList){ EventForwardingOutputPort sourcePort = mergeInputPort.getIncomingLink().getSource(); // Get the name TokenProcessingEntity (Processor or another Merge or Dataflow) and // its port that contains the source EventForwardingOutputPort Dataflow workflow = FileManager.getInstance().getCurrentDataflow(); TokenProcessingEntity entity = Tools.getTokenProcessingEntityWithEventForwardingOutputPort(sourcePort, workflow); if (entity != null){ String link = entity.getLocalName() + "." + sourcePort.getName() + " -> " + merge.getLocalName(); if (link.length() > maxLabel.length()) maxLabel = link; labelListModel.addElement(link); } } initComponents(); }
public boolean doTypeCheck() throws IterationTypeMismatchException { if (inputs.size() == 0) { // Arguable, but technically a merge with no inputs is valid, it may // make more sense to throw an exception here though as it has no // actual meaning. return true; } // Return false if we have unbound input ports or bound ports where the // resolved depth hasn't been calculated yet for (MergeInputPort ip : inputs) { if (ip.getIncomingLink() == null || ip.getIncomingLink().getResolvedDepth() == -1) { return false; } } // Got all input ports, now scan for input depths int inputDepth = inputs.get(0).getIncomingLink().getResolvedDepth(); for (MergeInputPort ip : inputs) { if (ip.getIncomingLink().getResolvedDepth() != inputDepth) { throw new IterationTypeMismatchException(); } } // Got to here so all the input resolved depths match, push depth+1 to // all outgoing links and return true for (DatalinkImpl dli : output.outgoingLinks) { dli.setResolvedDepth(inputDepth+1); } return true; } }
public int compare(Datalink link1, Datalink link2) { // Text for link1 EventForwardingOutputPort source1 = link1.getSource(); String sourceName1 = findName(source1); EventHandlingInputPort sink1 = link1.getSink(); String sinkName1 = findName(sink1); String text1 = sourceName1 + " -> " + sinkName1; // Text for link2 EventForwardingOutputPort source2 = link2.getSource(); String sourceName2 = findName(source2); EventHandlingInputPort sink2 = link2.getSink(); String sinkName2 = findName(sink2); String text2 = sourceName2 + " -> " + sinkName2; return text1.compareToIgnoreCase(text2); }