private CrossProduct getCross(int depthA, int depthB) { a = new InputProcessorPort(); a.setName("a"); a.setDepth(0); CrossProduct cp = new CrossProduct(); PortNode nipn1 = new PortNode(cp, a); nipn1.setDesiredDepth(depthA); b = new InputProcessorPort(); b.setName("b"); b.setDepth(0); PortNode nipn2 = new PortNode(cp, b); nipn2.setDesiredDepth(depthB); return cp; }
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()); } }
protected void processorInputProcessorPort( uk.org.taverna.scufl2.rdfxml.jaxb.InputProcessorPort original) { uk.org.taverna.scufl2.api.port.InputProcessorPort port = new uk.org.taverna.scufl2.api.port.InputProcessorPort(); port.setName(original.getName()); if (original.getPortDepth() != null) { port.setDepth(original.getPortDepth().getValue()); } port.setParent(getParserState().getCurrent(Processor.class)); mapBean(getParserState().getCurrentBase().resolve(original.getAbout()), port); }
iss.setParent(p); InputProcessorPort p1 = new InputProcessorPort(); p1.setParent(p); InputProcessorPort p2 = new InputProcessorPort(); p2.setParent(p); InputProcessorPort p3 = new InputProcessorPort(); p3.setParent(p);
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()); } }
case Processor: if (in) { new InputProcessorPort(processor, portName); } else { new OutputProcessorPort(processor, portName);
/** * 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); }
links.add("'" + escapeName(ip.getBoundProcessorPort().getName()) + "' -> '" + escapeName(ip.getBoundActivityPort().getName()) + "'");
iss.setParent(p); InputProcessorPort p1 = new InputProcessorPort(); p1.setParent(p); InputProcessorPort p2 = new InputProcessorPort(); p2.setParent(p); InputProcessorPort p3 = new InputProcessorPort(); p3.setParent(p);
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 testCompletenessOfSpecifiedBoundProcessorPort() { ProcessorInputPortBinding pipb = new ProcessorInputPortBinding(); pipb.setBoundProcessorPort(new InputProcessorPort()); CorrectnessValidator cv = new CorrectnessValidator(); ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener(); cv.checkCorrectness(pipb, true, rcvl); Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems(); boolean problem = false; for (NullFieldProblem nlp : nullFieldProblems) { if (nlp.getBean().equals(pipb) && nlp.getFieldName().equals("boundProcessorPort")) { problem = true; } } assertFalse(problem); }
iss.setParent(p); InputProcessorPort p1 = new InputProcessorPort(); p1.setParent(p); InputProcessorPort p2 = new InputProcessorPort(); p2.setParent(p); InputProcessorPort p3 = new InputProcessorPort(); p3.setParent(p);
private DotProduct getDot(int depthA, int depthB) { a = new InputProcessorPort(); a.setName("a"); a.setDepth(0); DotProduct dp = new DotProduct(); PortNode nipn1 = new PortNode(dp, a); nipn1.setDesiredDepth(depthA); b = new InputProcessorPort(); b.setName("b"); b.setDepth(0); PortNode nipn2 = new PortNode(dp, b); nipn2.setDesiredDepth(depthB); return dp; }
@Test public void createActivityFromProcessor() throws Exception { Processor p = new Processor(); new InputProcessorPort(p, "in1"); new InputProcessorPort(p, "in2").setDepth(1); new OutputProcessorPort(p, "out1"); new OutputProcessorPort(p, "out2").setDepth(0); OutputProcessorPort pOut3 = new OutputProcessorPort(p, "out3"); pOut3.setDepth(2); pOut3.setGranularDepth(1); Profile profile = new Profile(); Activity a = scufl2Tools.createActivityFromProcessor(p, profile); assertEquals(profile, a.getParent()); ProcessorBinding binding = scufl2Tools.processorBindingForProcessor(p, profile); assertEquals(2, a.getInputPorts().size()); assertEquals(3, a.getOutputPorts().size()); assertEquals(2, binding.getInputPortBindings().size()); assertEquals(3, binding.getOutputPortBindings().size()); assertEquals(a, binding.getBoundActivity()); assertEquals(p, binding.getBoundProcessor()); }
@Test public void updatePortBindingByMatchingPorts() throws Exception { Processor p = new Processor(); new InputProcessorPort(p, "in1"); new InputProcessorPort(p, "in2"); new OutputProcessorPort(p, "out1"); new OutputProcessorPort(p, "out2"); new InputProcessorPort(p, "new1"); new InputProcessorPort(p, "new2"); new InputActivityPort(a, "new1"); new InputActivityPort(a, "new2");
@Test public void testCorrectnessOfInScopeProcessorPort() { ProcessorBinding pb = new ProcessorBinding(); Processor processor = new Processor(); pb.setBoundProcessor(processor); ProcessorInputPortBinding pipb = new ProcessorInputPortBinding(); pipb.setParent(pb); InputProcessorPort port = new InputProcessorPort(); port.setParent(processor); pipb.setBoundProcessorPort(port); CorrectnessValidator cv = new CorrectnessValidator(); ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener(); cv.checkCorrectness(pipb, false, rcvl); Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems(); boolean problem = false; for (OutOfScopeValueProblem nlp : outOfScopeValueProblems) { if (nlp.getBean().equals(pipb) && nlp.getFieldName().equals("boundProcessorPort") && nlp.getValue().equals(port)) { problem = true; } } assertFalse(problem); }
private CrossProduct getCross(int depthA, int depthB) { a = new InputProcessorPort(); a.setName("a"); a.setDepth(0); CrossProduct cp = new CrossProduct(); PortNode nipn1 = new PortNode(cp, a); nipn1.setDesiredDepth(depthA); b = new InputProcessorPort(); b.setName("b"); b.setDepth(0); PortNode nipn2 = new PortNode(cp, b); nipn2.setDesiredDepth(depthB); return cp; }
InputProcessorPort ipp = new InputProcessorPort(p, "in"); ipp.setDepth(0);