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

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

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

Workflow.getCurrentRevision介绍

暂无

代码示例

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

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

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

@Override
  protected void cloneInto(WorkflowBean clone, Cloning cloning) {
    super.cloneInto(clone, cloning);
    Workflow cloneWorkflow = (Workflow)clone;
    cloneWorkflow.setCurrentRevision(cloning.cloneIfNotInCache(getCurrentRevision()));		
  }
}

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

@Test
public void workflowWithoutRevisions() throws Exception {
  URL wfResource = getClass().getResource(WF_RANDOM);
  assertNotNull("Could not find workflow " + WF_RANDOM, wfResource);
  T2FlowParser parser = new T2FlowParser();
  parser.setValidating(true);
  parser.setStrict(true);
  WorkflowBundle wfBundle = parser.parseT2Flow(wfResource.openStream());
  List<String> expectedRevisions = Arrays.asList(
      "e87de19a-02c7-4106-ae81-0b8e28efb22c");
  List<String> foundRevisions = new ArrayList<String>();
  Revision revision = wfBundle.getMainWorkflow().getCurrentRevision();
  while (revision != null) {
    URI revisionUri = revision.getIdentifier();
    String revisionUUID = uriTools
        .relativePath(Workflow.WORKFLOW_ROOT, revisionUri)
        .toASCIIString().replace("/", "");
    foundRevisions.add(revisionUUID);
    revision = revision.getPreviousRevision();
  }
  assertEquals(expectedRevisions, foundRevisions);
}

代码示例来源:origin: org.apache.taverna.language/taverna-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());
}

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

@Test
public void readSimpleWorkflow() throws Exception {
  URL wfResource = getClass().getResource(WF_ANNOTATED);
  assertNotNull("Could not find workflow " + WF_ANNOTATED, wfResource);
  T2FlowParser parser = new T2FlowParser();
  parser.setValidating(true);
  parser.setStrict(true);
  WorkflowBundle wfBundle = parser.parseT2Flow(wfResource.openStream());
  List<String> expectedRevisions = Arrays.asList(
      "9e1f7ffd-3bf9-4ba8-9c63-03b79b1858ad",
      "bb902d82-b0e4-46fc-bed5-950a3b38bb98");
  List<String> foundRevisions = new ArrayList<String>();
  Revision revision = wfBundle.getMainWorkflow().getCurrentRevision();
  while (revision != null) {
    URI revisionUri = revision.getIdentifier();
    String revisionUUID = uriTools
        .relativePath(Workflow.WORKFLOW_ROOT, revisionUri)
        .toASCIIString().replace("/", "");
    foundRevisions.add(revisionUUID);
    revision = revision.getPreviousRevision();
  }
  assertEquals(expectedRevisions, foundRevisions);
}

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

@Test
public void createBundle() throws Exception {
  WorkflowBundle wb = bundleIO.createBundle();
  assertEquals(wb, wb.getMainWorkflow().getParent());
  assertEquals(wb, wb.getMainProfile().getParent());
  assertEquals("bundle1", wb.getName());
  assertEquals("workflow1", wb.getMainWorkflow().getName());
  assertEquals("profile1", wb.getMainProfile().getName());
  assertNotNull(wb.getCurrentRevision());
  assertNotNull(wb.getMainWorkflow().getCurrentRevision());
  assertNotNull(wb.getMainProfile().getCurrentRevision());
}

相关文章