@Override protected void cloneInto(WorkflowBean clone, Cloning cloning) { super.cloneInto(clone, cloning); AbstractGranularDepthPort clonePort = (AbstractGranularDepthPort)clone; clonePort.setGranularDepth(getGranularDepth()); }
public void createActivityPortsFromProcessor(Activity activity, Processor processor) { for (InputProcessorPort processorPort : processor.getInputPorts()) { new InputActivityPort(activity, processorPort.getName()) .setDepth(processorPort.getDepth()); } for (OutputProcessorPort processorPort : processor.getOutputPorts()) { OutputActivityPort activityPort = new OutputActivityPort(activity, processorPort.getName()); activityPort.setDepth(processorPort.getDepth()); activityPort.setGranularDepth(processorPort.getGranularDepth()); } }
public void createProcessorPortsFromActivity(Processor processor, Activity activity) { for (InputActivityPort activityPort : activity.getInputPorts()) { new InputProcessorPort(processor, activityPort.getName()) .setDepth(activityPort.getDepth()); } for (OutputActivityPort activityPort : activity.getOutputPorts()) { OutputProcessorPort procPort = new OutputProcessorPort(processor, activityPort.getName()); procPort.setDepth(activityPort.getDepth()); procPort.setGranularDepth(activityPort.getGranularDepth()); } }
@Test public void createProcessorPortsFromActivityWithOverwrite() throws Exception { Activity a = new Activity(); new InputActivityPort(a, "in1"); new OutputActivityPort(a, "out1"); new OutputActivityPort(a, "out2").setDepth(1); Processor p = new Processor(); new InputProcessorPort(p, "other"); OutputProcessorPort toBeOverWritten = new OutputProcessorPort(p, "out1"); toBeOverWritten.setDepth(1); assertEquals(p, toBeOverWritten.getParent()); scufl2Tools.createProcessorPortsFromActivity(p, a); // Still there assertNotNull(p.getInputPorts().getByName("other")); // but out1 has been overwritten OutputProcessorPort pOut1 = p.getOutputPorts().getByName("out1"); assertNull(pOut1.getDepth()); assertNotSame(toBeOverWritten, pOut1); }
public Activity makeActivity() { activity = new Activity(); activity.setName("HelloScript"); activity.setType(URI .create("http://ns.taverna.org.uk/2010/activity/beanshell")); personName = new InputActivityPort(activity, "personName"); personName.setDepth(0); hello = new OutputActivityPort(activity, "hello"); hello.setDepth(0); hello.setGranularDepth(0); return activity; }
public Processor makeProcessor() { processor = new Processor(workflow, "Hello"); processorName = new InputProcessorPort(processor, "name"); processorName.setDepth(0); processorGreeting = new OutputProcessorPort(processor, "greeting"); processorGreeting.setDepth(0); processorGreeting.setGranularDepth(0); // FIXME: Should not need to make default iteration stack makeIterationStrategyStack(processorName).setParent(processor); return processor; }
@Test public void orderedByClassName() throws Exception { ports.add(new InputWorkflowPort(wf, "p3")); ports.add(new OutputWorkflowPort(wf, "p1")); ports.add(new InputWorkflowPort(wf, "p2")); Collections.sort(ports); assertNamesEqual(ports, "p2", "p3", "p1"); }
/** * Constructs an <code>InputWorkflowPort</code> for the specified <code>Workflow</code> with the * specified name. * <p> * The <code>InputPort</code> is added to the <code>Workflow</code> (if the * <code>Workflow</code> is not <code>null</code>). * * @param parent * the <code>Workflow</code> to add this <code>Port</code> to. Can be * <code>null</code> * @param name * the name of the <code>Port</code>. <strong>Must not</strong> be <code>null</code> * or an empty String. */ public InputWorkflowPort(Workflow parent, String name) { super(name); setParent(parent); }
/** * Constructs an <code>OutputWorkflowPort</code> for the specified <code>Workflow</code> with * the specified name. * <p> * The <code>OutputPort</code> is added to the <code>Workflow</code> (if the * <code>Workflow</code> is not <code>null</code>). * * @param parent * the <code>Workflow</code> to add this <code>Port</code> to. Can be * <code>null</code> * @param name * the name of the <code>Port</code>. <strong>Must not</strong> be <code>null</code> * or an empty String. */ public OutputWorkflowPort(Workflow parent, String name) { super(name); setParent(parent); }
/** * Constructs an <code>OutputProcessorPort</code> for the specified <code>Processor</code> with the * specified name. * <p> * The <code>OutputPort</code> is added to the <code>Processor</code> (if the * <code>Processor</code> is not <code>null</code>). * * @param parent * the <code>Processor</code> to add this <code>Port</code> to. Can be * <code>null</code> * @param name * the name of the <code>Port</code>. <strong>Must not</strong> be <code>null</code> * or an empty String. */ public OutputProcessorPort(Processor parent, String name) { super(name); setParent(parent); }
/** * Constructs an <code>InputPort</code> for the specified <code>Activity</code> with the * specified name. * <p> * The <code>InputPort</code> is added to the <code>Activity</code> (if the * <code>Activity</code> is not <code>null</code>). * * @param activity * the <code>Activity</code> to add this <code>Port</code> to. Can be * <code>null</code> * @param name * the name of the <code>Port</code>. <strong>Must not</strong> be <code>null</code> * or an empty String. */ public InputActivityPort(Activity activity, String name) { super(name); setParent(activity); }
/** * Constructs an <code>InputProcessorPort</code> for the specified <code>Processor</code> with the * specified name. * <p> * The <code>InputPort</code> is added to the <code>Processor</code> (if the * <code>Processor</code> is not <code>null</code>). * * @param parent * the <code>Processor</code> to add this <code>Port</code> to. Can be * <code>null</code> * @param name * the name of the <code>Port</code>. <strong>Must not</strong> be <code>null</code> * or an empty String. */ public InputProcessorPort(Processor parent, String name) { super(name); setParent(parent); }
/** * Constructs an <code>OutputPort</code> for the specified <code>Activity</code> with the * specified name. * <p> * The <code>OutputPort</code> is added to the <code>Activity</code> (if the * <code>Activity</code> is not <code>null</code>). * * @param activity * the <code>Activity</code> to add this <code>Port</code> to. Can be * <code>null</code> * @param name * the name of the <code>Port</code>. <strong>Must not</strong> be <code>null</code> * or an empty String. */ public OutputActivityPort(Activity activity, String name) { super(name); setParent(activity); }
private String datalink(Port port) { StringBuffer s = new StringBuffer(); s.append("'"); if (port instanceof ProcessorPort) { ProcessorPort processorPort = (ProcessorPort) port; s.append(escapeName(processorPort.getParent().getName())); s.append(":"); } s.append(escapeName(port.getName())); s.append("'"); return s.toString(); }
@Override public void visitAbstractDepthPort(AbstractDepthPort bean) { Integer depth = bean.getDepth(); if (depth != null) { if (depth < 0) { listener.negativeValue(bean, "depth", depth); } } if (checkComplete) { if (depth == null) { listener.nullField(bean, "depth"); } } }
/** * Set the <code>InputWorkflowPort</code>s to be the contents of the * specified set. * <p> * <code>InputWorkflowPort</code>s can be added by using * {@link #getInputWorkflowPorts()}.add(inputPort). * * @param inputPorts * the <code>InputWorkflowPort</code>s. <strong>Must not</strong> * be null */ public void setInputPorts(Set<InputWorkflowPort> inputPorts) { this.inputPorts.clear(); for (InputWorkflowPort inputPort : inputPorts) { inputPort.setParent(this); } }
/** * Set the <code>OutputWorkflowPort</code>s to be the contents of the * specified set. * <p> * <code>OutputWorkflowPort</code>s can be added by using * {@link #getOutputWorkflowPorts()}.add(outputPort). * * @param outputPorts * the <code>OutputWorkflowPort</code>s. <strong>Must * not</strong> be null */ public void setOutputPorts(Set<OutputWorkflowPort> outputPorts) { this.outputPorts.clear(); for (OutputWorkflowPort outputPort : outputPorts) { outputPort.setParent(this); } }