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

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

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

Workflow.getControlLinks介绍

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

代码示例

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

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

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

@SuppressWarnings("unchecked")
public List<BlockingControlLink> controlLinksBlocking(Processor blocked) {
  List<BlockingControlLink> controlLinks = new ArrayList<BlockingControlLink>();
  for (ControlLink link : blocked.getParent().getControlLinks()) {
    if (!(link instanceof BlockingControlLink)) {
      continue;
    }
    BlockingControlLink blockingControlLink = (BlockingControlLink) link;
    if (blockingControlLink.getBlock().equals(blocked)) {
      controlLinks.add(blockingControlLink);
    }
  }
  Collections.sort(controlLinks);
  return controlLinks;
}

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

@SuppressWarnings("unchecked")
public List<BlockingControlLink> controlLinksWaitingFor(
    Processor untilFinished) {
  List<BlockingControlLink> controlLinks = new ArrayList<BlockingControlLink>();
  for (ControlLink link : untilFinished.getParent().getControlLinks()) {
    if (!(link instanceof BlockingControlLink)) {
      continue;
    }
    BlockingControlLink blockingControlLink = (BlockingControlLink) link;
    if (blockingControlLink.getUntilFinished().equals(untilFinished)) {
      controlLinks.add(blockingControlLink);
    }
  }
  Collections.sort(controlLinks);
  return controlLinks;
}

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

@Override
public boolean accept(Visitor visitor) {
  if (visitor.visitEnter(this)) {
    List<WorkflowBean> children = new ArrayList<WorkflowBean>();
    children.addAll(getInputPorts());
    children.addAll(getOutputPorts());
    children.addAll(getProcessors());
    children.addAll(getDataLinks());
    children.addAll(getControlLinks());
    children.addAll(Collections.singleton(getCurrentRevision()));            
    for (WorkflowBean bean : children) {
      if (!bean.accept(visitor)) {
        break;
      }
    }
  }
  return visitor.visitLeave(this);
}

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

@Override
public void visitWorkflow(Workflow bean) {
  Set<DataLink> dataLinks = bean.getDataLinks();
  Set<ControlLink> controlLinks = bean.getControlLinks();

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

@Test
public void uriForControlLink() throws Exception {
  Processor hello = wfBundle.getMainWorkflow().getProcessors()
      .getByName("Hello");
  assertNotNull(hello);
  ControlLink condition = wfBundle.getMainWorkflow().getControlLinks()
      .iterator().next();
  assertTrue(condition instanceof BlockingControlLink);
  URI uri = uriTools.uriForBean(condition);
  assertEquals(
      HELLOWORLD_URI
          + "control?block=processor/Hello/&untilFinished=processor/wait4me/",
      uri.toASCIIString());
}

代码示例来源: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 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

@SuppressWarnings("unchecked")
@Test
public void expectedOrder() throws Exception {
  Workflow wf = new Workflow();		
  wf.setName("wf");
  
  Processor a = new Processor(wf, "a");
  Processor b = new Processor(wf, "b");
  Processor c = new Processor(wf, "c");
  Processor d = new Processor(wf, "d");
  BlockingControlLink b_blocks_c = new BlockingControlLink(c, b);
  BlockingControlLink a_blocks_c = new BlockingControlLink(c, a);
  BlockingControlLink a_blocks_b = new BlockingControlLink(b, a);
  BlockingControlLink b_blocks_d = new BlockingControlLink(d, b);
  BlockingControlLink a_blocks_d = new BlockingControlLink(d, a);
  
  ArrayList<ControlLink> links = new ArrayList<ControlLink>(wf.getControlLinks());
  assertEquals(Arrays.asList(a_blocks_b, a_blocks_c, a_blocks_d, b_blocks_c, b_blocks_d), links);
  Collections.shuffle(links);
  Collections.sort(links);
  assertEquals(Arrays.asList(a_blocks_b, a_blocks_c, a_blocks_d, b_blocks_c, b_blocks_d), links);
}

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

ArrayList<ControlLink> links = new ArrayList<ControlLink>(wf.getControlLinks());
assertEquals(Arrays.asList(null_blocks_null, null_blocks_c, a_blocks_b, b_blocks_null, b_blocks_c), links);

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

List<ControlLink> controlLinks = new ArrayList<ControlLink>(wf.getControlLinks());
if (!controlLinks.isEmpty()) {
  newLine(2);

相关文章