本文整理了Java中org.apache.taverna.scufl2.api.core.Workflow.setName()
方法的一些代码示例,展示了Workflow.setName()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Workflow.setName()
方法的具体详情如下:
包路径:org.apache.taverna.scufl2.api.core.Workflow
类名称:Workflow
方法名:setName
暂无
代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-t2flow
protected Workflow skeletonDataflow(Dataflow df) {
Workflow wf = new Workflow();
parserState.get().setCurrentWorkflow(wf);
wf.setName(df.getName());
wf.setIdentifier(WORKFLOW_ROOT.resolve(df.getId() + "/"));
return wf;
}
代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-api
private void parseWorkflow(Scanner scanner) {
level = Level.Workflow;
workflow = new Workflow();
String workflowName = parseName(scanner);
workflow.setName(workflowName);
wb.getWorkflows().add(workflow);
if (workflowName.equals(mainWorkflow))
wb.setMainWorkflow(workflow);
}
代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-scufl
private Workflow parseWorkflow(ScuflType wf) {
Workflow oldCurrentWorkflow = parserState.get().getCurrentWorkflow();
Workflow workflow = new Workflow();
workflow.setParent(parserState.get().getCurrentWorkflowBundle());
parserState.get().addMapping(wf, workflow);
parserState.get().setCurrentWorkflow(workflow);
WorkflowDescriptionType description = wf.getWorkflowdescription();
workflow.setName(sanitiseName(description.getTitle()));
parseWorkflowInputs(wf);
parseWorkflowOutputs(wf);
parseProcessors(wf);
parseLinks(wf);
parseCoordinations(wf);
parseAnnotations(wf);
replaceDefaultsWithStringConstants(wf); // To be done
parserState.get().setCurrentWorkflow(oldCurrentWorkflow);
return workflow;
}
代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-api
/**
* Test method for {@link org.apache.taverna.scufl2.validation.correctness.CorrectnessVisitor#visitChild(org.apache.taverna.scufl2.api.common.Child)}.
*/
@Test
public void testCorrectnessOfMissingParent() {
Workflow w = new Workflow();
w.setName("fred");
CorrectnessValidator cv = new CorrectnessValidator();
ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
cv.checkCorrectness(w, false, rcvl);
Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
assertEquals(0, nullFieldProblems.size()); // only done when completeness check
}
代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-api
@Test
public void testCompletenessOfMissingParent() {
Workflow w = new Workflow();
w.setName("fred");
CorrectnessValidator cv = new CorrectnessValidator();
ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
cv.checkCorrectness(w, true, rcvl);
Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
assertEquals(1, nullFieldProblems.size()); // parent
boolean parentProblem = false;
for (NullFieldProblem nlp : nullFieldProblems) {
if (nlp.getBean().equals(w) && nlp.getFieldName().equals("parent")) {
parentProblem = true;
}
}
assertTrue(parentProblem);
}
代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-api
@Test
public void testCompletenessOfSpecifiedParent() {
Workflow w = new Workflow();
w.setName("fred");
WorkflowBundle wb = new WorkflowBundle();
w.setParent(wb);
CorrectnessValidator cv = new CorrectnessValidator();
ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
cv.checkCorrectness(w, true, rcvl);
Set<NullFieldProblem> nullFieldProblems = rcvl.getNullFieldProblems();
assertEquals(0, nullFieldProblems.size());
}
代码示例来源:origin: org.apache.taverna.language/taverna-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: org.apache.taverna.language/taverna-scufl2-api
@SuppressWarnings({ "unchecked", "unused" })
@Test
public void expectedOrder() throws Exception {
Workflow wf = new Workflow();
wf.setName("wf");
InputWorkflowPort a = new InputWorkflowPort(wf, "a");
InputWorkflowPort b = new InputWorkflowPort(wf, "b");
InputWorkflowPort c = new InputWorkflowPort(wf, "c");
OutputWorkflowPort x = new OutputWorkflowPort(wf, "x");
OutputWorkflowPort y = new OutputWorkflowPort(wf, "y");
OutputWorkflowPort z = new OutputWorkflowPort(wf, "z");
DataLink c_x = new DataLink(wf, c, x);
DataLink b_x = new DataLink(wf, b, x);
DataLink b_z = new DataLink(wf, b, z);
DataLink a_z = new DataLink(wf, a, z);
DataLink a_x = new DataLink(wf, a, x);
ArrayList<DataLink> links = new ArrayList<DataLink>(wf.getDataLinks());
assertEquals(Arrays.asList(a_x, a_z, b_x, b_z, c_x), links);
Collections.shuffle(links);
Collections.sort(links);
assertEquals(Arrays.asList(a_x, a_z, b_x, b_z, c_x), links);
}
代码示例来源: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-scufl2-api
public void nullSupport() throws Exception {
Workflow wf = new Workflow();
wf.setName("wf");
代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-api
workflow.setName("workflow1");
workflow.setParent(wb);
workflow.newRevision();
代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-api
wf.setName("wf");
InputWorkflowPort a = new InputWorkflowPort(wf, "a");
InputWorkflowPort b = new InputWorkflowPort(wf, "b");
代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-wfbundle
try {
if (workflow.getName() != null)
wf.setName(workflow.getName());
if (workflow.getWorkflowIdentifier() != null
&& workflow.getWorkflowIdentifier().getResource() != null)
代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-api
@Test
public void workflowsNotEqualsUnlessOrphans() {
Workflow wf1 = new Workflow();
Workflow wf2 = new Workflow();
wf1.setName("fred");
wf2.setName("fred");
// No parents, so they are equal
assertEquals(wf1, wf2);
WorkflowBundle wb1 = new WorkflowBundle();
WorkflowBundle wb2 = new WorkflowBundle();
// Make them look "equal"
wb2.setName(wb1.getName());
wb2.setGlobalBaseURI(wb1.getGlobalBaseURI());
assertFalse(wb1.equals(wb2));
wf1.setParent(wb1);
wf2.setParent(wb2);
assertFalse(wf1.equals(wf2));
wf1.setParent(null);
assertFalse(wf1.equals(wf2));
assertFalse(wf2.equals(wf1));
wf2.setParent(null);
assertTrue(wf1.equals(wf2));
}
代码示例来源:origin: org.apache.taverna.language/taverna-scufl2-api
public Workflow makeMainWorkflow() {
workflow = new Workflow();
workflow.setName("HelloWorld");
// NOTE: setWorkflowIdentifier should only be called when loading a
// workflow
// which already has an ID
workflow.setIdentifier(URI
.create("http://ns.taverna.org.uk/2010/workflow/00626652-55ae-4a9e-80d4-c8e9ac84e2ca/"));
InputWorkflowPort yourName = new InputWorkflowPort(workflow, "yourName");
yourName.setDepth(0);
OutputWorkflowPort results = new OutputWorkflowPort(workflow, "results");
// Not needed:
// workflow.getInputPorts().add(yourName);
// workflow.getOutputPorts().add(results);
workflow.getProcessors().add(makeProcessor());
workflow.getProcessors().add(makeProcessor2());
// Make links
DataLink directLink = new DataLink(workflow, yourName, results);
directLink.setMergePosition(1);
DataLink greetingLink = new DataLink(workflow, processorGreeting,
results);
greetingLink.setMergePosition(0);
nameLink = new DataLink(workflow, yourName, processorName);
condition = new BlockingControlLink(processor, wait4me);
return workflow;
}
内容来源于网络,如有侵权,请联系作者删除!