• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Workflow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.taverna.scufl2.api.core.Workflow的典型用法代码示例。如果您正苦于以下问题:Java Workflow类的具体用法?Java Workflow怎么用?Java Workflow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Workflow类属于org.apache.taverna.scufl2.api.core包,在下文中一共展示了Workflow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getDataflow

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
public Dataflow getDataflow(Workflow workflow)
		throws InvalidWorkflowException {
	if (!workflowToDataflow.containsKey(workflow)) {
		try {
			Dataflow dataflow = createDataflow(workflow);
			workflowToDataflow.put(workflow, dataflow);
			dataflowToWorkflow.put(dataflow, workflow);
		} catch (EditException | ActivityConfigurationException
				| DispatchLayerConfigurationException
				| ActivityNotFoundException
				| DispatchLayerNotFoundException e) {
			throw new InvalidWorkflowException(e);
		}
	}
	return workflowToDataflow.get(workflow);
}
 
开发者ID:apache,项目名称:incubator-taverna-engine,代码行数:17,代码来源:WorkflowToDataflowMapper.java


示例2: createCustomComponent

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
@Override
protected Component createCustomComponent() {
	Workflow workflow = (Workflow) getContextualSelection().getParent();
	Profile profile = workflow.getParent().getMainProfile();
	Port port = getSelectedPort();
	// Component component =
	// getContextualSelection().getRelativeToComponent();

	String label;
	if (port instanceof ReceiverPort) {
		label = CONNECT_WITH_OUTPUT_FROM;
	} else {
		label = CONNECT_AS_INPUT_TO;
	}
	JMenu connectMenu = new JMenu(new DummyAction(label,
			WorkbenchIcons.datalinkIcon));
	addPortMenuItems(workflow, port, connectMenu);
	addProcessorMenuItems(workflow, profile, port, connectMenu);
	return connectMenu;
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:21,代码来源:AbstractConnectPortMenuActions.java


示例3: checkOneConfiguration

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
private void checkOneConfiguration(InputWorkflowPort workflowPort,
		Integer depth, Workflow workflow, WorkflowBundle workflowBundle,
		Activity activity, Configuration c) {
	JsonNode nested = c.getJson().get("nestedWorkflow");
	Workflow nestedWorkflow = workflowBundle.getWorkflows().getByName(
			nested.asText());
	if (nestedWorkflow != workflow)
		return;

	ActivityPort activityPort = activity.getInputPorts().getByName(
			workflowPort.getName());
	activityPort.setDepth(depth);
	for (ProcessorBinding binding : scufl2Tools
			.processorBindingsToActivity(activity))
		for (ProcessorInputPortBinding portBinding : binding
				.getInputPortBindings())
			if (portBinding.getBoundActivityPort() == activityPort) {
				InputProcessorPort processorPort = portBinding
						.getBoundProcessorPort();
				processorPort.setDepth(depth);
			}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:23,代码来源:ChangeDepthEdit.java


示例4: workflowWithoutRevisions

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
@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);

}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:26,代码来源:TestAnnotationParsing.java


示例5: generateWorkflowReport

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
public WorkflowReport generateWorkflowReport(Workflow workflow) {
	WorkflowReport workflowReport = createWorkflowReport(workflow);
	for (Processor processor : workflow.getProcessors()) {
		ProcessorReport processorReport = createProcessorReport(processor);
		processorReport.setParentReport(workflowReport);
		workflowReport.addProcessorReport(processorReport);
		for (ProcessorBinding processorBinding : scufl2Tools.processorBindingsForProcessor(
				processor, profile)) {
			Activity boundActivity = processorBinding.getBoundActivity();
			ActivityReport activityReport = createActivityReport(boundActivity);
			activityReport.setParentReport(processorReport);
			if (scufl2Tools.containsNestedWorkflow(processor, profile)) {
				Workflow nestedWorkflow = scufl2Tools.nestedWorkflowForProcessor(processor,
						profile);
				WorkflowReport nestedWorkflowReport = generateWorkflowReport(nestedWorkflow);
				nestedWorkflowReport.setParentReport(activityReport);
				activityReport.setNestedWorkflowReport(nestedWorkflowReport);
			}
			processorReport.addActivityReport(activityReport);
		}
	}
	return workflowReport;
}
 
开发者ID:apache,项目名称:incubator-taverna-engine,代码行数:24,代码来源:AbstractExecution.java


示例6: setUp

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
/**
 * @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);
}
 
开发者ID:apache,项目名称:incubator-taverna-engine,代码行数:19,代码来源:RunProfileTest.java


示例7: parseWorkflowReport

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
protected WorkflowReport parseWorkflowReport(JsonNode reportJson,
		Path workflowReportJson, ActivityReport actReport,
		WorkflowBundle workflowBundle) throws ParseException {
	Workflow wf = (Workflow) getSubject(reportJson, workflowBundle);
	WorkflowReport workflowReport = new WorkflowReport(wf);
	workflowReport.setParentReport(actReport);

	parseDates(reportJson, workflowReport);

	for (JsonNode invocJson : reportJson.path("invocations"))
		// NOTE: Invocation constructor will add to parents
		parseInvocation(invocJson, workflowReportJson, workflowReport);

	for (JsonNode procJson : reportJson.path("processorReports")) {
		ProcessorReport procReport = parseProcessorReport(procJson,
				workflowReportJson, workflowReport, workflowBundle);
		workflowReport.addProcessorReport(procReport);
	}
	return workflowReport;
}
 
开发者ID:apache,项目名称:incubator-taverna-engine,代码行数:21,代码来源:WorkflowReportJSON.java


示例8: parseScufl

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
public WorkflowBundle parseScufl(ScuflType wf) throws ReaderException,
		JAXBException {
	try {
		parserState.get().setCurrentParser(this);
		WorkflowBundle wfBundle = new WorkflowBundle();
		parserState.get().setCurrentWorkflowBundle(wfBundle);
		makeProfile(wf);
		Workflow w = parseWorkflow(wf);
		wfBundle.setMainWorkflow(w);

		scufl2Tools.setParents(wfBundle);

		return wfBundle;
	} finally {
		parserState.remove();
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:18,代码来源:ScuflParser.java


示例9: considerEdit

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
private void considerEdit(EditManagerEvent message, Edit<?> edit) {
	// boolean result = false;
	if (edit instanceof CompoundEdit) {
		for (Edit<?> subEdit : ((CompoundEdit) edit).getChildEdits())
			considerEdit(message, subEdit);
		return;
	}

	Object subject = edit.getSubject();
	if (subject == owningProcessor) {
		// panel.reevaluate();
		setTitle(getRelativeName(owningWorkflowBundle, activity));
	} else if (subject == owningWorkflowBundle) {
		for (Workflow workflow : owningWorkflowBundle.getWorkflows())
			if (!workflow.getProcessors().contains(owningProcessor))
				clearDialog(activity);
	} else if (subject == activity) {
		if (message instanceof DataFlowUndoEvent) {
			logger.info("undo of activity edit found");
			panel.refreshConfiguration();
		} else if (message instanceof DataFlowRedoEvent) {
			logger.info("redo of activity edit found");
			panel.refreshConfiguration();
		}
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:27,代码来源:ActivityConfigurationDialog.java


示例10: expectedOrder

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
@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);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:25,代码来源:ControlLinkCompareTest.java


示例11: mergeAbcAndPIntoNew

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
@Test
public void mergeAbcAndPIntoNew() throws Exception {
	Workflow merged = new Workflow();
	DataflowMerger merger = new DataflowMerger(merged);
	merger.getMergeEdit(abc).doEdit();

	assertNotSame(abc, merged);
	merger.getMergeEdit(p).doEdit();


	// Assert abc and p were not modified
	checkAbc();
	checkP();

	checkMergedAbcP(merged);
	checkCopiedFromP(merged);
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:18,代码来源:TestSimpleMerge.java


示例12: createBundle

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
/**
 * Create a new WorkflowBundle with a default workflow and profile.
 * <p>
 * Unlike the {@link WorkflowBundle} constructor, this method will also make
 * a {@link WorkflowBundle#getMainWorkflow()} and
 * {@link WorkflowBundle#getMainProfile()}, simplifying construction of
 * workflow bundles from scratch.
 * <p>
 * Each of the bundle, workflow and profile will also have a revision set
 * using {@link Revisioned#newRevision()} and their names set to short
 * default values.
 * 
 * @return A template {@link WorkflowBundle} which has a main workflow and
 *         main profile
 */
public WorkflowBundle createBundle() {
	WorkflowBundle wb = new WorkflowBundle();
	wb.setName("bundle1");

	Workflow workflow = new Workflow();
	workflow.setName("workflow1");
	workflow.setParent(wb);
	workflow.newRevision();

	Profile profile = new Profile();
	profile.setName("profile1");
	profile.setParent(wb);
	profile.newRevision();

	wb.setMainWorkflow(workflow);
	wb.setMainProfile(profile);
	wb.newRevision();
	return wb;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:35,代码来源:WorkflowBundleIO.java


示例13: defineEditsForConfiguration

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
private void defineEditsForConfiguration(Workflow workflow,
		OutputWorkflowPort port, WorkflowBundle workflowBundle,
		Activity activity, Configuration c) {
	List<Edit<?>> edits = nestedPortEdit.getChildEdits();
	JsonNode nested = c.getJson().get("nestedWorkflow");
	Workflow nestedWorkflow = workflowBundle.getWorkflows().getByName(
			nested.asText());
	if (nestedWorkflow != workflow)
		return;

	OutputActivityPort activityPort = activity.getOutputPorts().getByName(
			port.getName());
	edits.add(new RemoveChildEdit<>(activity, activityPort));
	for (ProcessorBinding processorBinding : scufl2Tools
			.processorBindingsToActivity(activity))
		for (ProcessorOutputPortBinding portBinding : processorBinding
				.getOutputPortBindings())
			if (portBinding.getBoundActivityPort() == activityPort) {
				OutputProcessorPort processorPort = portBinding
						.getBoundProcessorPort();
				edits.add(new RemoveProcessorOutputPortEdit(
						processorBinding.getBoundProcessor(), processorPort));
				edits.add(new RemoveChildEdit<>(processorBinding,
						portBinding));
			}
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:27,代码来源:RemoveWorkflowOutputPortEdit.java


示例14: assertHasOutputPorts

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
protected void assertHasOutputPorts(Workflow dataflow,
		String... expectedOutputPorts) {
	Set<String> expectedNames = new HashSet<String>();
	for (String expected : expectedOutputPorts) {
		expectedNames.add(expected);
	}
	Set<String> foundNames = new HashSet<String>();
	for (OutputWorkflowPort port : dataflow.getOutputPorts()) {
		String name = port.getName();
		foundNames.add(name);
	}

	Set<String> extras = new HashSet<String>(foundNames);
	extras.removeAll(expectedNames);
	assertTrue("Unexpected output port  " + extras, extras.isEmpty());

	Set<String> missing = new HashSet<String>(expectedNames);
	missing.removeAll(foundNames);
	assertTrue("Could not find output port  " + missing, missing.isEmpty());
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:21,代码来源:AbstractTestHelper.java


示例15: GraphController

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
public GraphController(Workflow workflow, Profile profile,
		boolean interactive, Component componentForPopups,
		Alignment alignment, PortStyle portStyle, EditManager editManager,
		MenuManager menuManager, ColourManager colourManager) {
	this.workflow = workflow;
	this.profile = profile;
	this.interactive = interactive;
	this.componentForPopups = componentForPopups;
	this.alignment = alignment;
	this.portStyle = portStyle;
	this.editManager = editManager;
	this.colourManager = colourManager;
	this.graphEventManager = new DefaultGraphEventManager(this,
			componentForPopups, menuManager);
	graph = generateGraph();
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:17,代码来源:GraphController.java


示例16: toJson

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
protected JsonNode toJson(Processor proc) {
	ObjectNode p = mapper.createObjectNode();
	p.putPOJO("id",
			uriTools.relativeUriForBean(proc, proc.getParent().getParent()));
	p.put("name", proc.getName());
	addPorts(proc, p);
	p.putAll(annotations(proc));

	List<Workflow> nested = scufl2Tools.nestedWorkflowsForProcessor(proc,
			proc.getParent().getParent().getMainProfile());
	if (!nested.isEmpty()) {
		if (nested.size() == 1) {
			p.put("nestedWorkflow", toJson(nested.iterator().next()));
		} else {
			ArrayNode list = mapper.createArrayNode();
			for (Workflow w : nested) {
				list.add(toJson(w));
			}
			p.put("nestedWorkflow", list);
		}
	}
	return p;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:24,代码来源:ToJson.java


示例17: testCorrectnessOfMergePositionSpecifiedCorrectly

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
@Test
public void testCorrectnessOfMergePositionSpecifiedCorrectly() {
	Workflow w = new Workflow();
	DataLink dataLink = new DataLink();
	dataLink.setParent(w);
	
	InputWorkflowPort iwp = new InputWorkflowPort();
	iwp.setParent(w);
	
	OutputWorkflowPort owp = new OutputWorkflowPort();
	owp.setParent(w);
	
	dataLink.setReceivesFrom(iwp);
	dataLink.setSendsTo(owp);
	
	Integer mergePosition = Integer.valueOf(3);
	dataLink.setMergePosition(mergePosition);
	
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
			
	cv.checkCorrectness(dataLink, false, rcvl);
	
	Set<NegativeValueProblem> negativeValueProblems = rcvl.getNegativeValueProblems();
	assertEquals(Collections.EMPTY_SET, negativeValueProblems);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:27,代码来源:TestDataLink.java


示例18: findProcessors

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
protected Set<Processor> findProcessors(Workflow dataflow, Port targetPort) {
	Set<Processor> possibleProcessors = new HashSet<Processor>();
	if (targetPort instanceof InputProcessorPort) {
		InputProcessorPort inputProcessorPort = (InputProcessorPort) targetPort;
		possibleProcessors = scufl2Tools.possibleUpStreamProcessors(dataflow, inputProcessorPort.getParent());
	} else if (targetPort instanceof OutputProcessorPort) {
		OutputProcessorPort outputProcessorPort = (OutputProcessorPort) targetPort;
		possibleProcessors = scufl2Tools.possibleDownStreamProcessors(dataflow, outputProcessorPort.getParent());
	} else {
		// Probably a dataflow port, everything is allowed
		possibleProcessors = dataflow.getProcessors();
	}
	return possibleProcessors;
}
 
开发者ID:apache,项目名称:incubator-taverna-workbench,代码行数:15,代码来源:AbstractConnectPortMenuActions.java


示例19: addControlLinks

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
private void addControlLinks(Workflow workflow) throws EditException {
	for (ControlLink controlLink : workflow.getControlLinks()) {
		if (controlLink instanceof BlockingControlLink) {
			BlockingControlLink blockingControlLink = (BlockingControlLink) controlLink;
			Processor untilFinished = blockingControlLink
					.getUntilFinished();
			Processor block = blockingControlLink.getBlock();
			edits.getCreateConditionEdit(
					workflowToDataflowProcessors.get(untilFinished),
					workflowToDataflowProcessors.get(block)).doEdit();
		}
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-engine,代码行数:14,代码来源:WorkflowToDataflowMapper.java


示例20: SemanticAnnotationContextualView

import org.apache.taverna.scufl2.api.core.Workflow; //导入依赖的package包/类
public SemanticAnnotationContextualView(FileManager fileManager,
		ComponentFactory factory, AbstractNamed selection) {
	super(fileManager, true);
	this.fileManager = fileManager;
	this.factory = factory;
	super.setAnnotated(selection);
	List<SemanticAnnotationProfile> profiles = new ArrayList<>();
	try {
		Profile componentProfile = getComponentProfile();
		if (componentProfile != null) {
			if (selection instanceof Workflow
					|| selection instanceof WorkflowBundle)
				profiles = componentProfile.getSemanticAnnotations();
			else if (selection instanceof InputWorkflowPort)
				profiles = componentProfile
						.getInputSemanticAnnotationProfiles();
			else if (selection instanceof OutputWorkflowPort)
				profiles = componentProfile
						.getOutputSemanticAnnotationProfiles();
			else if (selection instanceof Processor)
				profiles = componentProfile
						.getActivitySemanticAnnotationProfiles();
		}
	} catch (ComponentException e) {
		logger.error("failed to look up semantic annotations", e);
	}
	super.setSemanticAnnotationProfiles(profiles);
	super.initialise();
}
 
开发者ID:apache,项目名称:incubator-taverna-plugin-component,代码行数:30,代码来源:SemanticAnnotationContextualView.java



注:本文中的org.apache.taverna.scufl2.api.core.Workflow类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java LayoutFlags类代码示例发布时间:2022-05-22
下一篇:
Java BigMushroom类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap