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

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

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

Workflow.getName介绍

暂无

代码示例

代码示例来源:origin: org.apache.taverna.engine/taverna-run-api

/**
 * Returns the name of the <code>Workflow</code> to run. If no
 * <code>Workflow</code> name is set the main <code>Workflow</code> from the
 * <code>WorkflowBundle</code> will be run.
 * 
 * @return the <code>Workflow</code> to run
 */
public String getWorkflowName() {
  if (workflowName == null && workflowBundle.getMainWorkflow() != null)
    return workflowBundle.getMainWorkflow().getName();
  return workflowName;
}

代码示例来源:origin: org.apache.taverna.engine/taverna-run-impl

@Override
public String getRunName(String runID) throws InvalidRunIdException {
  WorkflowReport workflowReport = getWorkflowReport(runID);
  return workflowReport.getSubject().getName() + "_" + ISO_8601.format(workflowReport.getCreatedDate());
}

代码示例来源:origin: org.apache.taverna.engine/taverna-report-api

private int getLongestName(WorkflowReport workflowReport, int level) {
  int result = 0;
  result = Math.max(result, getSubject().getName().length() + level);
  for (ProcessorReport processorReport : workflowReport.getProcessorReports()) {
    result = Math.max(result, processorReport.getSubject().getName().length());
    for (ActivityReport activityReport : processorReport.getActivityReports()) {
      WorkflowReport nestedWorkflowReport = activityReport.getNestedWorkflowReport();
      if (nestedWorkflowReport != null)
        result = Math.max(result, getLongestName(nestedWorkflowReport, level + 1));
    }
  }
  return result;
}

代码示例来源:origin: org.apache.taverna.engine/taverna-report-api

@Override
public String toString() {
  DateFormat dateFormat = new SimpleDateFormat(dateFormatString);
  StringBuilder sb = new StringBuilder();
  int max = getLongestName(this, 0);
  spaces(sb, max + 1);
  sb.append("Status    ");
  sb.append("Queued    ");
  sb.append("Started   ");
  sb.append("Complete  ");
  sb.append("Errors    ");
  sb.append("Started             ");
  sb.append("Finished\n");
  sb.append(getSubject().getName());
  spaces(sb, max - getSubject().getName().length() + 1);
  sb.append(getState());
  spaces(sb, 10 - getState().name().length());
  sb.append("-");
  spaces(sb, 9);
  sb.append("-");
  spaces(sb, 9);
  sb.append("-");
  spaces(sb, 9);
  sb.append("-");
  spaces(sb, 9);
  addDates(sb, getStartedDate(), getCompletedDate(), dateFormat);
  for (ProcessorReport processorReport : getProcessorReports())
    addProcessor(sb, max, 0, processorReport, dateFormat);
  return sb.toString();
}

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

@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
    ConfigBean configBean, ParserState parserState) throws ReaderException {
  DataflowConfig dataflowConfig = unmarshallConfig(t2FlowParser,
      configBean, "dataflow", DataflowConfig.class);
  Configuration configuration = new Configuration();
  configuration.setType(nestedUri.resolve("#Config"));		
  String wfId = dataflowConfig.getRef();
  URI wfUri = WORKFLOW_ROOT.resolve(wfId + "/");
  Workflow wf = (Workflow) getUriTools().resolveUri(wfUri, parserState.getCurrentWorkflowBundle());        
  if (wf == null)
    throw new ReaderException("Can't find nested workflow with id " + wfId);
  ObjectNode json = configuration.getJsonAsObjectNode();
  json.put("nestedWorkflow", wf.getName());
  return configuration;
}

代码示例来源:origin: org.apache.taverna.engine/taverna-run-api

/**
 * Test method for
 * {@link org.apache.taverna.platform.run.api.RunProfile#RunProfile(org.apache.taverna.scufl2.api.container.WorkflowBundle, org.apache.taverna.scufl2.api.core.Workflow, org.apache.taverna.scufl2.api.profiles.Profile, java.util.Map, org.apache.taverna.reference.ReferenceService, org.apache.taverna.platform.execution.api.ExecutionService)}
 * .
 */
@Test
public void testRunProfileWorkflowBundleWorkflowProfileMapOfStringT2ReferenceReferenceServiceExecutionService() {
  runProfile = new RunProfile(executionEnvironment, workflowBundle, workflow.getName(), profile.getName(), dataBundle);
}

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

@Test
public void workflow() throws Exception {
  Workflow wf = new Workflow();
  UUID uuid = UUID.fromString(wf.getName());
  assertEquals(4, uuid.version());
}

代码示例来源:origin: org.apache.taverna.engine/taverna-run-api

/**
 * Test method for
 * {@link org.apache.taverna.platform.run.api.RunProfile#setWorkflow(org.apache.taverna.scufl2.api.core.Workflow)}
 * .
 */
@Test
public void testSetWorkflow() {
  runProfile.setWorkflowName(null);
  assertNotNull(runProfile.getWorkflowName());
  assertEquals(mainWorkflow.getName(), runProfile.getWorkflowName());
  runProfile.setWorkflowBundle(new WorkflowBundle());
  runProfile.setWorkflowName(null);
  assertNull(runProfile.getWorkflowName());
  runProfile.setWorkflowName(workflow.getName());
  assertEquals(workflow.getName(), runProfile.getWorkflowName());
  runProfile.setWorkflowName(mainWorkflow.getName());
  assertEquals(mainWorkflow.getName(), runProfile.getWorkflowName());
}

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

} else
  logger.warning("Can't find bundle URI for workflow document "
      + wf.getName());

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

String path = WORKFLOW + uriTools.validFilename(wf.getName()) + RDF;
    uriTools.validFilename(wf.getName()) + REVISIONS + RDF;
addRevisions(wf, path, 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.engine/taverna-run-api

/**
 * Test method for
 * {@link org.apache.taverna.platform.run.api.RunProfile#getWorkflow()}.
 */
@Test
public void testGetWorkflow() {
  assertNotNull(runProfile.getWorkflowName());
  assertEquals(workflow.getName(), runProfile.getWorkflowName());
  assertEquals(runProfile.getWorkflowName(), runProfile.getWorkflowName());
  runProfile.setWorkflowName(null);
  assertNotNull(runProfile.getWorkflowName());
  assertEquals(mainWorkflow.getName(), runProfile.getWorkflowName());
}

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

@Test
public void awkwardFilenames() throws Exception {
  workflowBundle.getProfiles().removeByName("tavernaServer");
  String funnyName = "Funny_%2f_characters_50%_of the time";
  workflowBundle.getMainProfile().setName(funnyName);        
  workflowBundle.getMainWorkflow().setName(funnyName);
  File bundleFile = tempFile();
  bundleIO.writeBundle(workflowBundle, bundleFile,
      APPLICATION_VND_TAVERNA_SCUFL2_WORKFLOW_BUNDLE);
  UCFPackage ucfPackage = new UCFPackage(bundleFile);
  Map<String, ResourceEntry> profiles = ucfPackage.listResources("profile");
  assertEquals(2, profiles.size());
  assertTrue(profiles.keySet().contains("Funny_%252f_characters_50%25_of%20the%20time.rdf"));
  assertTrue(profiles.keySet().contains("Funny_%252f_characters_50%25_of%20the%20time/"));
  
  Map<String, ResourceEntry> workflows = ucfPackage.listResources("workflow");
  assertEquals(1, workflows.size());
  assertEquals("Funny_%252f_characters_50%25_of%20the%20time.rdf", workflows.keySet().iterator().next());
  
  // and.. can we read it in again correctly?
  WorkflowBundle readBundle = bundleIO.readBundle(bundleFile, APPLICATION_VND_TAVERNA_SCUFL2_WORKFLOW_BUNDLE);
  assertEquals(funnyName, readBundle.getMainProfile().getName());
  assertEquals(funnyName, readBundle.getMainWorkflow().getName());
  // did the JSON parse back in?
  JsonNode oldJson = workflowBundle.getMainProfile().getConfigurations().getByName("Hello").getJson();
  assertTrue(oldJson.get("script").asText().startsWith("hello"));           
  JsonNode newJson = readBundle.getMainProfile().getConfigurations().getByName("Hello").getJson();
  assertTrue(newJson.get("script").asText().startsWith("hello"));        
  assertEquals(oldJson, newJson);
}

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

@Ignore
@Test
public void getWorkflowBundle() throws Exception {
  WorkflowBundleIO wfBundleIO = new WorkflowBundleIO();
  WorkflowBundle wfBundle = wfBundleIO.createBundle();
  
  String name = wfBundle.getName();
  String wfName = wfBundle.getMainWorkflow().getName();
  URI id = wfBundle.getIdentifier();
  
  DataBundles.setWorkflowBundle(dataBundle, wfBundle);
  // Reload the bundle
  wfBundle = DataBundles.getWorkflowBundle(dataBundle);        
  assertEquals(name, wfBundle.getName());
  assertEquals(wfName, wfBundle.getMainWorkflow().getName());        
  assertEquals(id, wfBundle.getIdentifier());        
}

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

@Test
public void readBundleFile() throws Exception {
  File bundleFile = tempFile();
  FileUtils.writeStringToFile(bundleFile,
      getStructureFormatWorkflowBundle(),
      UTF_8);
  WorkflowBundle wfBundle = bundleIO.readBundle(bundleFile,
      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 workflows() throws Exception {
  assertEquals(1, workflowBundle.getWorkflows().size());
  Workflow helloWorld = workflowBundle.getWorkflows().getByName(
      "HelloWorld");
  assertEquals("HelloWorld", helloWorld.getName());
  assertEquals(workflowBundle.getMainWorkflow(), helloWorld);
}

代码示例来源: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.engine/taverna-run-api

/**
 * @throws java.lang.Exception
 */
@Before
public void setUp() throws Exception {
  workflow = new Workflow();
  mainWorkflow = new Workflow();
  profile = new Profile();
  mainProfile = new Profile();
  workflowBundle = new WorkflowBundle();
  workflowBundle.setMainProfile(mainProfile);
  workflowBundle.setMainWorkflow(mainWorkflow);
  executionService = new LocalExecutionService();
  executionEnvironment = new LocalExecutionEnvironment(executionService, null, null);
  dataBundle = DataBundles.createBundle();
  runProfile = new RunProfile(executionEnvironment, workflowBundle, workflow.getName(), profile.getName(), dataBundle);
}

代码示例来源: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());
}

代码示例来源:origin: org.apache.taverna.engine/taverna-run-impl

assertNull(wfReport.getParentReport());
assertEquals(wfBundle.getMainWorkflow().getName(), wfReport.getSubject().getName());
URI mainWf = new URITools().uriForBean(wfBundle.getMainWorkflow());
assertEquals(mainWf, wfReport.getSubjectURI());

相关文章