/** * 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); }
/** * 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); }
protected void parseOutputWorkflowPort( org.apache.taverna.scufl2.xml.OutputWorkflowPort original) { org.apache.taverna.scufl2.api.port.OutputWorkflowPort port = new org.apache.taverna.scufl2.api.port.OutputWorkflowPort(); port.setName(original.getName()); port.setParent(getParserState().getCurrent(Workflow.class)); mapBean(getParserState().getCurrentBase().resolve(original.getAbout()), port); }
owp.setParent(otherWorkflow);
@Test public void testCorrectnessOfMergePositionSpecifiedCorrectly() { Workflow w = new Workflow(); DataLink dataLink = new DataLink(); dataLink.setParent(w); InputWorkflowPort iwp = new InputWorkflowPort(); iwp.setParent(w); OutputWorkflowPort owp = new OutputWorkflowPort(); owp.setParent(w); dataLink.setReceivesFrom(iwp); dataLink.setSendsTo(owp); Integer mergePosition = Integer.valueOf(3); dataLink.setMergePosition(mergePosition); CorrectnessValidator cv = new CorrectnessValidator(); ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener(); cv.checkCorrectness(dataLink, false, rcvl); Set<NegativeValueProblem> negativeValueProblems = rcvl.getNegativeValueProblems(); assertEquals(Collections.EMPTY_SET, negativeValueProblems); }
@Test public void testInScopePorts() { Workflow w = new Workflow(); DataLink dataLink = new DataLink(); dataLink.setParent(w); InputWorkflowPort iwp = new InputWorkflowPort(); iwp.setParent(w); OutputWorkflowPort owp = new OutputWorkflowPort(); owp.setParent(w); dataLink.setReceivesFrom(iwp); dataLink.setSendsTo(owp); CorrectnessValidator cv = new CorrectnessValidator(); ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener(); cv.checkCorrectness(dataLink, true, rcvl); Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems(); assertEquals(Collections.EMPTY_SET, outOfScopeValueProblems); }