private EventHandlingInputPort determineLinkSinkPort(Element sink, Dataflow dataflow, Map<String, Processor> createdProcessors) throws DeserializationException, EditException { EventHandlingInputPort result = null; String portName = sink.getChildText(PORT, T2_WORKFLOW_NAMESPACE); String processorName = sink.getChildText(PROCESSOR, T2_WORKFLOW_NAMESPACE); if ((processorName == null) || processorName.equals("")) { for (DataflowOutputPort port : dataflow.getOutputPorts()) { if (port.getName().equals(portName)) { result = port.getInternalInputPort(); break; } } } else { EventHandlingInputPort processorInputPort = findProcessorInputPort( createdProcessors, portName, processorName); result = processorInputPort; } return result; }
public void addResultListener(ResultListener listener) { synchronized (resultListeners) { if (resultListeners.isEmpty()) { for (DataflowOutputPort port : dataflow.getOutputPorts()) { port.addResultListener(facadeResultListener); } } resultListeners.add(listener); } }
public void removeResultListener(ResultListener listener) { synchronized (resultListeners) { resultListeners.remove(listener); if (resultListeners.isEmpty()) { for (DataflowOutputPort port : dataflow.getOutputPorts()) { port.removeResultListener(facadeResultListener); } } } }
}}); for (DataflowOutputPort dataflowOutputPort : dataflowOutputPorts) { String portName = dataflowOutputPort.getName(); PortResultsViewTab resultTab = new PortResultsViewTab(dataflowOutputPort.getName(), dataflowOutputPort.getDepth()); outputPortTabMap.put(portName, resultTab); PortResultsViewTab tab = outputPortTabMap.get(dataflowOutputPorts.get(0).getName()); tabbedPane.setSelectedComponent(tab);
/** * For each processor input, merge input and workflow output get the * incoming link and, if non null, add to a list and return the entire list. */ public synchronized List<? extends Datalink> getLinks() { List<Datalink> result = new ArrayList<Datalink>(); // All processors have a set of input ports each of which has at most // one incoming data link for (TokenProcessingEntity p : getEntities(TokenProcessingEntity.class)) { for (EventHandlingInputPort pip : p.getInputPorts()) { Datalink dl = pip.getIncomingLink(); if (dl != null) { result.add(dl); } } } // Workflow outputs have zero or one incoming data link to their // internal input port for (DataflowOutputPort dop : getOutputPorts()) { Datalink dl = dop.getInternalInputPort().getIncomingLink(); if (dl != null) { result.add(dl); } } return result; }
@Test public void testDoEditAction() throws EditException { CreateDataflowOutputPortEdit edit = new CreateDataflowOutputPortEdit(dataflow, portName); assertEquals(0, dataflow.getOutputPorts().size()); edit.doEditAction(dataflow); assertEquals(1, dataflow.getOutputPorts().size()); DataflowOutputPort outputPort = dataflow.getOutputPorts().get(0); assertSame(dataflow, outputPort.getDataflow()); assertEquals(portName, outputPort.getName()); }
private ActivityPortsDefinitionBean getPortsDefinition(Dataflow d) { ActivityPortsDefinitionBean result = new ActivityPortsDefinitionBean(); List<ActivityInputPortDefinitionBean> inputs = result .getInputPortDefinitions(); List<ActivityOutputPortDefinitionBean> outputs = result .getOutputPortDefinitions(); for (DataflowInputPort dip : d.getInputPorts()) inputs.add(makeInputDefinition(dip)); for (DataflowOutputPort dop : d.getOutputPorts()) outputs.add(makeOutputDefinition(dop.getDepth(), dop.getName())); try { eh = calculateFamily(getRegistryBase(), getFamilyName()) .getComponentProfile().getExceptionHandling(); if (eh != null) outputs.add(makeOutputDefinition(1, ERROR_CHANNEL)); } catch (RegistryException e) { logger.error("failed to get exception handling for family", e); } return result; }
public void actionPerformed(ActionEvent e) { try { Datalink datalink = port.getInternalInputPort().getIncomingLink(); if (datalink == null) { editManager.doDataflowEdit(dataflow, edits.getRemoveDataflowOutputPortEdit(dataflow, port)); } else { List<Edit<?>> editList = new ArrayList<Edit<?>>(); editList.add(Tools.getDisconnectDatalinkAndRemovePortsEdit(datalink)); editList.add(edits.getRemoveDataflowOutputPortEdit(dataflow, port)); editManager.doDataflowEdit(dataflow, new CompoundEdit(editList)); } dataflowSelectionModel.removeSelection(port); } catch (EditException e1) { logger.debug("Delete workflow output port failed", e1); } }
} else if (sinkType.equals(DATALINK_TYPES.DATAFLOW.toString())) { for (DataflowOutputPort port : dataflow.getOutputPorts()) { if (port.getName().equals(portName)) { result = port.getInternalInputPort(); break;
protected Element dataflowOutputPorts( List<? extends DataflowOutputPort> outputPorts) { Element result = new Element(DATAFLOW_OUTPUT_PORTS, T2_WORKFLOW_NAMESPACE); for (DataflowOutputPort port : outputPorts) { Element portElement = new Element(DATAFLOW_PORT, T2_WORKFLOW_NAMESPACE); Element name = new Element(NAME, T2_WORKFLOW_NAMESPACE); name.setText(port.getName()); portElement.addContent(name); result.addContent(portElement); } return result; } }
/** * For each processor input, merge input and workflow output get the * incoming link and, if non null, add to a list and return the entire list. */ public synchronized List<? extends Datalink> getLinks() { List<Datalink> result = new ArrayList<Datalink>(); // All processors have a set of input ports each of which has at most // one incoming data link for (TokenProcessingEntity p : getEntities(TokenProcessingEntity.class)) { for (EventHandlingInputPort pip : p.getInputPorts()) { Datalink dl = pip.getIncomingLink(); if (dl != null) { result.add(dl); } } } // Workflow outputs have zero or one incoming data link to their // internal input port for (DataflowOutputPort dop : getOutputPorts()) { Datalink dl = dop.getInternalInputPort().getIncomingLink(); if (dl != null) { result.add(dl); } } return result; }
public synchronized void addResultListener(ResultListener listener) { if (resultListeners.isEmpty()) { for (DataflowOutputPort port : dataflow.getOutputPorts()) { port.addResultListener(facadeResultListener); } } resultListeners.add(listener); }
public synchronized void removeResultListener(ResultListener listener) { resultListeners.remove(listener); if (resultListeners.isEmpty()) { for (DataflowOutputPort port : dataflow.getOutputPorts()) { port.removeResultListener(facadeResultListener); } } }
String portName = dop.getName(); (EventForwardingOutputPort) oldNewMapping .get(datalinkSource), dop .getInternalInputPort()); edits.getConnectDatalinkEdit(newDatalink).doEdit(); } catch (EditException e1) {
/** * Remove the specified output port from this dataflow * * @param dop * dataflow output port to remove * @throws EditException * if the output port isn't in the list of outputs for this * dataflow */ protected synchronized void removeDataflowOutputPort(DataflowOutputPort dop) throws EditException { if (outputs.contains(dop)) { outputs.remove(dop); } else { throw new EditException( "Can't locate the specified output port in workflow, output port has name '" + dop.getName() + "'."); } }
}}); for (DataflowOutputPort dataflowOutputPort : dataflowOutputPorts) { String portName = dataflowOutputPort.getName(); PortResultsViewTab resultTab = new PortResultsViewTab(dataflowOutputPort.getName(), dataflowOutputPort.getDepth()); outputPortTabMap.put(portName, resultTab); tabbedPane.addTab(portName, WorkbenchIcons.outputIcon, resultTab, "Output port " + portName); PortResultsViewTab tab = outputPortTabMap.get(dataflowOutputPorts.get(0).getName()); tabbedPane.setSelectedComponent(tab);
/** * For each processor input, merge input and workflow output get the * incoming link and, if non null, add to a list and return the entire list. */ public synchronized List<? extends Datalink> getLinks() { List<Datalink> result = new ArrayList<Datalink>(); // All processors have a set of input ports each of which has at most // one incoming data link for (TokenProcessingEntity p : getEntities(TokenProcessingEntity.class)) { for (EventHandlingInputPort pip : p.getInputPorts()) { Datalink dl = pip.getIncomingLink(); if (dl != null) { result.add(dl); } } } // Workflow outputs have zero or one incoming data link to their // internal input port for (DataflowOutputPort dop : getOutputPorts()) { Datalink dl = dop.getInternalInputPort().getIncomingLink(); if (dl != null) { result.add(dl); } } return result; }