uk.org.taverna.scufl2.api.core.Workflow.getProcessors()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(118)

本文整理了Java中uk.org.taverna.scufl2.api.core.Workflow.getProcessors()方法的一些代码示例,展示了Workflow.getProcessors()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Workflow.getProcessors()方法的具体详情如下:
包路径:uk.org.taverna.scufl2.api.core.Workflow
类名称:Workflow
方法名:getProcessors

Workflow.getProcessors介绍

[英]Returns the Processors. If there are no Processors an empty set is returned.
[中]返回Processors。如果没有Processors,则返回一个空集。

代码示例

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Override
public void setParent(Workflow parent) {
  if (this.parent != null && this.parent != parent) {
    this.parent.getProcessors().remove(this);
  }
  this.parent = parent;
  if (parent != null) {
    parent.getProcessors().add(this);
  }
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-validation-structural

private void checkCompleteness() {
    Workflow w = validatorState.get().getWorkflow();
    if (w.getProcessors().isEmpty() && w.getOutputPorts().isEmpty()) {
      validatorState.get().getEventListener().incompleteWorkflow(w);
//            validatorState.get().addIncompleteWorkflow(w);
    }
  }

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void controlLinksBlocking() {
  Processor hello = workflowBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  Processor wait4me = workflowBundle.getMainWorkflow().getProcessors()
      .getByName("wait4me");
  ControlLink controlLink = workflowBundle.getMainWorkflow().getControlLinks()
      .iterator().next();
  assertEquals(Collections.singletonList(controlLink),
      scufl2Tools.controlLinksBlocking(hello));
  assertTrue(scufl2Tools.controlLinksBlocking(wait4me).isEmpty());
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void controlLinksWaitingFor() {
  Processor hello = workflowBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  Processor wait4me = workflowBundle.getMainWorkflow().getProcessors()
      .getByName("wait4me");
  ControlLink controlLink = workflowBundle.getMainWorkflow().getControlLinks()
      .iterator().next();
  assertEquals(Collections.singletonList(controlLink),
      scufl2Tools.controlLinksWaitingFor(wait4me));
  assertTrue(scufl2Tools.controlLinksWaitingFor(hello).isEmpty());
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void uriForProcessor() throws Exception {
  URI uri = uriTools.uriForBean(wfBundle.getMainWorkflow()
      .getProcessors().getByName("Hello"));
  assertEquals(HELLO_URI, uri.toASCIIString());
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void uriForDatalinkWithMerge() throws Exception {
  Processor hello = wfBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  List<DataLink> greetingLinks = scufl2Tools.datalinksFrom(hello
      .getOutputPorts().getByName("greeting"));
  URI uri = uriTools.uriForBean(greetingLinks.get(0));
  assertEquals(
      HELLOWORLD_URI
          + "datalink?from=processor/Hello/out/greeting&to=out/results&mergePosition=0",
      uri.toASCIIString());
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void uriForIterationStrategyStack() throws Exception {
  URI uri = uriTools
      .uriForBean(wfBundle.getMainWorkflow().getProcessors()
          .getByName("Hello").getIterationStrategyStack());
  assertEquals(HELLO_URI +
  "iterationstrategy/", uri.toASCIIString());
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void uriForDatalink() throws Exception {
  Processor hello = wfBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  List<DataLink> nameLinks = scufl2Tools.datalinksTo(hello
      .getInputPorts().getByName("name"));
  URI uri = uriTools.uriForBean(nameLinks.get(0));
  assertEquals(HELLOWORLD_URI
      + "datalink?from=in/yourName&to=processor/Hello/in/name",
      uri.toASCIIString());
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void resolveProcessorOutput() throws Exception {
  Processor hello = wfBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  OutputProcessorPort greeting = hello.getOutputPorts().getByName(
      "greeting");
  assertSame(greeting, uriTools.resolveUri(
      HELLO_URI.resolve("out/greeting"), wfBundle));
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void uriForProcessorInPort() throws Exception {
  Processor hello = wfBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  URI uri = uriTools.uriForBean(hello.getInputPorts().getByName("name"));
  assertEquals(HELLO_URI + "in/name", uri.toASCIIString());
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void resolveProcessorInput() throws Exception {
  Processor hello = wfBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  InputProcessorPort helloName = hello.getInputPorts().getByName("name");
  assertSame(helloName,
      uriTools.resolveUri(HELLO_URI.resolve("in/name"), wfBundle));
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
  public void resolveProcessorIterationStrategy() throws Exception {
    Processor hello = wfBundle.getMainWorkflow().getProcessors()
        .getByName("Hello");
    assertSame(hello.getIterationStrategyStack().get(0),
        uriTools.resolveUri(
HELLO_URI.resolve("iterationstrategy/0/"),
            wfBundle));
  }

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void uriForProcessorOutPort() throws Exception {
  Processor hello = wfBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  URI uri = uriTools.uriForBean(hello.getOutputPorts().getByName(
      "greeting"));
  assertEquals(HELLO_URI + "out/greeting", uri.toASCIIString());
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void resolveProcessor() throws Exception {
  Processor hello = wfBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  assertSame(hello, uriTools.resolveUri(HELLO_URI, wfBundle));
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void resolveProcessorIterationStrategyRoot() throws Exception {
  Processor hello = wfBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  assertSame(hello.getIterationStrategyStack().get(0),
      uriTools.resolveUri(HELLO_URI.resolve("iterationstrategy/0/"),
          wfBundle));
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void uriForIterationStrategyRoot() throws Exception {
  Processor hello = wfBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  URI uri = uriTools.uriForBean(hello.getIterationStrategyStack().get(0));
  assertEquals(HELLO_URI + "iterationstrategy/0/",
      uri.toASCIIString());
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void uriForIterationStrategyCross() throws Exception {
  Processor hello = wfBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  CrossProduct crossProduct = (CrossProduct) hello
      .getIterationStrategyStack().get(0);
  URI uri = uriTools.uriForBean(crossProduct.get(0));
  assertEquals(HELLO_URI + "iterationstrategy/0/0/",
      uri.toASCIIString());
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void resolveProcessorIterationStrategyNode() throws Exception {
  Processor hello = wfBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  CrossProduct rootStrategyNode = (CrossProduct) hello
      .getIterationStrategyStack().get(0);
  assertSame(rootStrategyNode.get(0),
      uriTools.resolveUri(
      HELLO_URI.resolve("iterationstrategy/0/0/"),
          wfBundle));
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void readBundleStream() throws Exception {
  InputStream inputStream = new ByteArrayInputStream(
      getStructureFormatWorkflowBundle().getBytes("utf-8"));
  WorkflowBundle wfBundle = bundleIO.readBundle(inputStream,
      TEXT_VND_TAVERNA_SCUFL2_STRUCTURE);
  assertEquals("HelloWorld", wfBundle.getName());
  assertEquals("HelloWorld", wfBundle.getMainWorkflow().getName());
  assertTrue(wfBundle.getMainWorkflow().getProcessors()
      .containsName("Hello"));
}

代码示例来源:origin: uk.org.taverna.scufl2/scufl2-api

@Test
public void cloneWorkflow() throws Exception {
  Workflow original = originalWfBundle.getMainWorkflow();
  assertEquals(originalWfBundle, original.getParent());
  Workflow clone = (Workflow) original.clone();
  assertNull(clone.getParent());
  assertEquals(original.getName(), clone.getName());
  assertNotSame(original.getProcessors().getByName("Hello"), clone
      .getProcessors().getByName("Hello"));
  assertNotSame(original.getCurrentRevision(), clone.getCurrentRevision());
  assertEquals(original.getCurrentRevision(), clone.getCurrentRevision());
}

相关文章