public ProcessorOutputPort createProcessorOutputPort(Processor processor, String name, int depth, int granularDepth) { return new ProcessorOutputPortImpl((ProcessorImpl) processor, name, depth, granularDepth); }
protected ProcessorOutputPortImpl getOutputPortWithName(String name) { for (ProcessorOutputPortImpl p : outputPorts) { String portName = p.getName(); if (portName.equals(name)) { return p; } } return null; }
/** * Strip off the last id in the owning process stack (as this will have been * pushed onto the stack on entry to the processor) and relay the event to * the targets. * */ protected void receiveEvent(WorkflowDataToken token) { sendEvent(token.popOwningProcess()); }
public void jobCreated(Job outputJob) { for (String outputPortName : outputJob.getData().keySet()) { WorkflowDataToken token = new WorkflowDataToken(outputJob .getOwningProcess(), outputJob.getIndex(), outputJob .getData().get(outputPortName), outputJob.getContext()); parent.getOutputPortWithName(outputPortName).receiveEvent(token); } }
public void jobCreated(Job outputJob) { for (String outputPortName : outputJob.getData().keySet()) { WorkflowDataToken token = new WorkflowDataToken(outputJob .getOwningProcess(), outputJob.getIndex(), outputJob .getData().get(outputPortName), outputJob.getContext()); parent.getOutputPortWithName(outputPortName).receiveEvent(token); } }
public ProcessorOutputPort createProcessorOutputPort(Processor processor, String name, int depth, int granularDepth) { return new ProcessorOutputPortImpl((ProcessorImpl) processor, name, depth, granularDepth); }
protected ProcessorOutputPortImpl getOutputPortWithName(String name) { for (ProcessorOutputPortImpl p : outputPorts) { String portName = p.getName(); if (portName.equals(name)) { return p; } } return null; }
public void jobCreated(Job outputJob) { for (String outputPortName : outputJob.getData().keySet()) { WorkflowDataToken token = new WorkflowDataToken(outputJob .getOwningProcess(), outputJob.getIndex(), outputJob .getData().get(outputPortName), outputJob.getContext()); parent.getOutputPortWithName(outputPortName).receiveEvent(token); } }
/** * Strip off the last id in the owning process stack (as this will have been * pushed onto the stack on entry to the processor) and relay the event to * the targets. * */ protected void receiveEvent(WorkflowDataToken token) { sendEvent(token.popOwningProcess()); }
@Override protected void doEditAction(ProcessorImpl processor) throws EditException { if (processor.getOutputPortWithName(portName) != null) { throw new EditException("Duplicate output port name"); } ProcessorOutputPortImpl pop = new ProcessorOutputPortImpl(processor,portName, portDepth, portGranularity); processor.outputPorts.add(pop); }
protected ProcessorOutputPortImpl getOutputPortWithName(String name) { for (ProcessorOutputPortImpl p : outputPorts) { String portName = p.getName(); if (portName.equals(name)) { return p; } } return null; }
/** * Strip off the last id in the owning process stack (as this will have been * pushed onto the stack on entry to the processor) and relay the event to * the targets. * */ protected void receiveEvent(WorkflowDataToken token) { sendEvent(token.popOwningProcess()); }
for (Element portElement : (List<Element>) opElement .getChildren("port")) { ProcessorOutputPortImpl popi = new ProcessorOutputPortImpl(this, portElement.getAttributeValue("name"), Integer .parseInt(portElement.getAttributeValue("depth")),
@Override protected void undoEditAction(ProcessorImpl processor) { BasicEventForwardingOutputPort pop = processor.getOutputPortWithName(port.getName()); if (pop != null) { processor.outputPorts.remove(pop); } }
@Before public void setup() throws Exception { merge = new MergeImpl("the merge"); ProcessorImpl p1 = new ProcessorImpl(); ProcessorImpl p2 = new ProcessorImpl(); sourcePort=new ProcessorOutputPortImpl(p1,"source_port",0,0); sinkPort=new ProcessorInputPortImpl(p2,"sink_port",0); }
@Override protected void undoEditAction(ProcessorImpl processor) { BasicEventForwardingOutputPort pop = processor.getOutputPortWithName(port.getName()); if (pop != null) { processor.outputPorts.remove(pop); } }
/** * Check that the outgoing link to the sink port is retained when undoing a second merged input. */ @Test public void undoSecond() throws Exception { Edit<Merge> theEdit = new ConnectMergedDatalinkEdit(merge,sourcePort,sinkPort); theEdit.doEdit(); ProcessorImpl p3=new ProcessorImpl(); ProcessorOutputPortImpl sourcePort2=new ProcessorOutputPortImpl(p3,"source_port2",0,0); Edit<Merge> theEdit2 = new ConnectMergedDatalinkEdit(merge,sourcePort2,sinkPort); theEdit2.doEdit(); theEdit2.undo(); assertEquals(1,merge.getInputPorts().size()); assertEquals(1,merge.getOutputPort().getOutgoingLinks().size()); }
@Override protected void doEditAction(ProcessorImpl processor) throws EditException { if (processor.getOutputPortWithName(port.getName()) != null) { throw new EditException("Duplicate output port name"); } processor.outputPorts.add(port); }
ProcessorOutputPortImpl sourcePort2=new ProcessorOutputPortImpl(p3,"source_port2",0,0);
@Override protected void doEditAction(ProcessorImpl processor) throws EditException { if (processor.getOutputPortWithName(port.getName()) != null) { throw new EditException("Duplicate output port name"); } processor.outputPorts.add(port); }