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

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

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

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: org.apache.taverna.language/taverna-scufl2-t2flow

@Before
public void readWorkflow() throws ReaderException, IOException {
  WorkflowBundleIO io = new WorkflowBundleIO();
  InputStream is = getClass().getResourceAsStream(ITERATIONSTRATEGIES_T2FLOW);
  wfBundle = io.readBundle(is, APPLICATION_VND_TAVERNA_T2FLOW_XML);
  wf = wfBundle.getMainWorkflow();
  coloursLisr = wf.getProcessors().getByName("ColoursLisr");
  concat = wf.getProcessors().getByName("Concatenate_two_strings");
  shape = wf.getProcessors().getByName("ShapeAnimals");
}

代码示例来源:origin: org.apache.taverna.language/taverna-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: org.apache.taverna.language/taverna-scufl2-api

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

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

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

代码示例来源:origin: org.apache.taverna.language/taverna-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: org.apache.taverna.language/taverna-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: org.apache.taverna.language/taverna-scufl2-t2flow

@Test
public void unconfigureLoopLayer() throws Exception {
  URL wfResource = getClass().getResource(INTERACTION_WITH_LOOP);
  assertNotNull("Could not find workflow " + INTERACTION_WITH_LOOP, wfResource);
  T2FlowParser parser = new T2FlowParser();
  parser.setStrict(false);
  WorkflowBundle wfBundle = parser.parseT2Flow(wfResource.openStream());
  Scufl2Tools scufl2Tools = new Scufl2Tools();
  Processor interaction = wfBundle.getMainWorkflow().getProcessors().getByName("BioSTIFInteraction");
  
  Configuration config = scufl2Tools.configurationFor(interaction, wfBundle.getMainProfile());
  assertNull(config.getJsonAsObjectNode().get("loop"));
}

代码示例来源:origin: org.apache.taverna.language/taverna-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: org.apache.taverna.language/taverna-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: org.apache.taverna.language/taverna-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: org.apache.taverna.language/taverna-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: org.apache.taverna.language/taverna-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: org.apache.taverna.language/taverna-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: org.apache.taverna.language/taverna-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: org.apache.taverna.language/taverna-scufl2-wfbundle

@Test
public void iterationStrategyWait4Me() throws Exception {
  Processor wait4me = workflowBundle.getMainWorkflow().getProcessors()
      .getByName("wait4me");
  assertEquals(0, wait4me.getIterationStrategyStack().size());
}

代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-wfbundle

@Test
public void processorPortsWait4Me() throws Exception {
  Processor wait4me = workflowBundle.getMainWorkflow().getProcessors()
      .getByName("wait4me");
  assertEquals(0, wait4me.getInputPorts().size());
  assertEquals(0, wait4me.getOutputPorts().size());
}

代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-wfbundle

@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());
}

代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-wfbundle

@Test
public void processorBinding() throws Exception {
  assertEquals(1, profile.getProcessorBindings().size());
  ProcessorBinding hello = profile.getProcessorBindings().getByName(
      "Hello");
  assertEquals(profile.getActivities().getByName("HelloScript"),
      hello.getBoundActivity());
  assertEquals(bundle.getMainWorkflow().getProcessors()
      .getByName("Hello"), hello.getBoundProcessor());
  assertEquals("Hello", hello.getName());
  assertEquals(10, hello.getActivityPosition().intValue());
}

相关文章