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()); } }
private InputProcessorPort findOrCreateProcessorInputPort(Processor p, String name, Integer depth) { InputProcessorPort port = p.getInputPorts().getByName(name); if (port == null) { port = new InputProcessorPort(); port.setParent(p); port.setName(name); port.setDepth(depth); } return port; }
@SuppressWarnings("boxing") protected Set<InputProcessorPort> parseProcessorInputPorts( Processor newProc, DepthPorts origPorts) { Set<InputProcessorPort> newPorts = new HashSet<>(); for (DepthPort origPort : origPorts.getPort()) { InputProcessorPort newPort = new InputProcessorPort(newProc, origPort.getName()); newPort.setDepth(origPort.getDepth().intValue()); // TODO: What about InputProcessorPort granular depth? newPorts.add(newPort); } return newPorts; }
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 void parsePort(Scanner scanner, String next) throws ReaderException { boolean in = next.equals("In"); String portName = parseName(scanner); switch (level) { case Workflow: if (in) new InputWorkflowPort(workflow, portName); else new OutputWorkflowPort(workflow, portName); break; case Processor: if (in) new InputProcessorPort(processor, portName); else new OutputProcessorPort(processor, portName); break; case Activity: if (in) new InputActivityPort(activity, portName); else new OutputActivityPort(activity, portName); break; default: throw new ReaderException("Unexpected " + next + " at level " + level); } }
inputActivityPort.setDepth(inputProcessorPort.getDepth());
/** * 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()) + "'"); Collections.sort(links);
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()); } }
@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; }
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; }
protected void processorInputProcessorPort( org.apache.taverna.scufl2.xml.InputProcessorPort original) { org.apache.taverna.scufl2.api.port.InputProcessorPort port = new org.apache.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); }
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 processorInputPorts() throws Exception { Processor hello = workflowBundle.getMainWorkflow().getProcessors() .getByName("Hello"); assertEquals(1, hello.getInputPorts().size()); assertEquals("name", hello.getInputPorts().getByName("name").getName()); assertEquals(0, hello.getInputPorts().getByName("name").getDepth() .intValue()); }
@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); }