当前位置: 首页>>代码示例>>Java>>正文


Java Activity.setParent方法代码示例

本文整理汇总了Java中org.apache.taverna.scufl2.api.activity.Activity.setParent方法的典型用法代码示例。如果您正苦于以下问题:Java Activity.setParent方法的具体用法?Java Activity.setParent怎么用?Java Activity.setParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.taverna.scufl2.api.activity.Activity的用法示例。


在下文中一共展示了Activity.setParent方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testCorrectnessOfInScopeBoundActivity1

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Test
public void testCorrectnessOfInScopeBoundActivity1() {
	// Test when in same profile
	WorkflowBundle wb = new WorkflowBundle();
	Profile profile = new Profile();
	profile.setParent(wb);
	ProcessorBinding pb = new ProcessorBinding();
	Activity activity = new Activity();
	activity.setParent(profile); 
	pb.setBoundActivity(activity);
	pb.setParent(profile);
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(pb, false, rcvl);
	
	Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems();
	boolean problem = false;
	for (OutOfScopeValueProblem nlp : outOfScopeValueProblems) {
		if (nlp.getBean().equals(pb) && nlp.getFieldName().equals("boundActivity") && nlp.getValue().equals(activity)) {
			problem = true;
		}
	}
	assertFalse(problem);	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:26,代码来源:TestProcessorBinding.java

示例2: createProcessorFromActivity

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Test
public void createProcessorFromActivity() throws Exception {
	Profile profile = new Profile();
	Activity a = new Activity();
	a.setParent(profile);
	new InputActivityPort(a, "in1");
	new InputActivityPort(a, "in2").setDepth(1);		
	new OutputActivityPort(a, "out1");
	new OutputActivityPort(a, "out2").setDepth(0);		
	OutputActivityPort aOut3 = new OutputActivityPort(a, "out3");
	aOut3.setDepth(2);
	aOut3.setGranularDepth(1);
	
	ProcessorBinding binding = scufl2Tools.createProcessorAndBindingFromActivity(a);
	Processor p = binding.getBoundProcessor();
	assertEquals(profile, binding.getParent());
	
	assertEquals(2, p.getInputPorts().size());
	assertEquals(3, p.getOutputPorts().size());
	assertEquals(2, binding.getInputPortBindings().size());
	assertEquals(3, binding.getOutputPortBindings().size());
	assertEquals(a, binding.getBoundActivity());
	assertEquals(p, binding.getBoundProcessor());

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

示例3: parseScuflObject

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Override
public void parseScuflObject(Object o) {
	StringconstantType sc = (StringconstantType) o;
	Configuration configuration = new Configuration();
	configuration.setParent(getParserState().getCurrentProfile());
	configuration.setType(CONSTANT.resolve("#Config"));
	((ObjectNode) configuration.getJson()).put("string", sc.getValue());

	Activity activity = new Activity();
	getParserState().setCurrentActivity(activity);
	activity.setParent(getParserState().getCurrentProfile());
	activity.setType(CONSTANT);
	OutputActivityPort valuePort = new OutputActivityPort(activity, VALUE);
	valuePort.setDepth(0);
	valuePort.setGranularDepth(0);
	configuration.setConfigures(activity);

	ProcessorBinding pb = new ProcessorBinding();
	pb.setParent(getParserState().getCurrentProfile());
	pb.setBoundProcessor(getParserState().getCurrentProcessor());
	pb.setBoundActivity(activity);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:23,代码来源:StringConstantExtensionParser.java

示例4: parseActivity

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
protected void parseActivity(
		org.apache.taverna.scufl2.xml.Activity original) {
	Activity activity = new Activity();

	getParserState().push(activity);
	try {
		mapBean(original.getAbout(), activity);
		if (original.getName() != null)
			activity.setName(original.getName());
		activity.setParent(getParserState().getCurrent(
				org.apache.taverna.scufl2.api.profiles.Profile.class));
		if (original.getType() != null)
			activity.setType(resolve(original.getType().getResource()));
		for (org.apache.taverna.scufl2.xml.Activity.InputActivityPort inputActivityPort : original
				.getInputActivityPort())
			parseInputActivityPort(inputActivityPort.getInputActivityPort());
		for (org.apache.taverna.scufl2.xml.Activity.OutputActivityPort outputActivityPort : original
				.getOutputActivityPort())
			parseOutputActivityPort(outputActivityPort
					.getOutputActivityPort());
	} finally {
		getParserState().pop();
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:25,代码来源:ProfileParser.java

示例5: createActivityFromProcessor

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
public Activity createActivityFromProcessor(Processor processor,
		Profile profile) {
	Activity activity = new Activity();
	activity.setName(processor.getName());
	activity.setParent(profile);
	createActivityPortsFromProcessor(activity, processor);
	bindActivityToProcessorByMatchingPorts(activity, processor);
	return activity;
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:10,代码来源:Scufl2Tools.java

示例6: testCorrectnessOfInScopeBoundActivity2

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Test
public void testCorrectnessOfInScopeBoundActivity2() {
	// Test when in same profile
	WorkflowBundle wb = new WorkflowBundle();
	Profile profile = new Profile();
	profile.setParent(wb);
	ProcessorBinding pb = new ProcessorBinding();
	
	Profile otherProfile = new Profile();
	otherProfile.setParent(wb);
	Activity activity = new Activity();
	activity.setParent(otherProfile); 
	pb.setBoundActivity(activity);
	pb.setParent(profile);
	CorrectnessValidator cv = new CorrectnessValidator();
	ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
	
	cv.checkCorrectness(pb, false, rcvl);
	
	Set<OutOfScopeValueProblem> outOfScopeValueProblems = rcvl.getOutOfScopeValueProblems();
	boolean problem = false;
	for (OutOfScopeValueProblem nlp : outOfScopeValueProblems) {
		if (nlp.getBean().equals(pb) && nlp.getFieldName().equals("boundActivity") && nlp.getValue().equals(activity)) {
			problem = true;
		}
	}
	assertFalse(problem);	
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:29,代码来源:TestProcessorBinding.java

示例7: addDataflowToNestingProcessor

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
private void addDataflowToNestingProcessor(Processor nestingProcessor,
		Workflow nestedDataflow, Profile profile) {
	Activity da = new Activity();
	da.setParent(profile);
	da.createConfiguration(NESTED_WORKFLOW).getJsonAsObjectNode()
			.put("nestedWorkflow", nestedDataflow.getName());
	try {
		new AddActivityEdit(nestingProcessor, da).doEdit();
		new SetIterationStrategyStackEdit(nestingProcessor, null/*FIXME*/).doEdit();
		for (InputActivityPort aip : da.getInputPorts()) {
			InputProcessorPort pip = new InputProcessorPort();
			pip.setName(aip.getName());
			pip.setDepth(aip.getDepth());
			new AddProcessorInputPortEdit(nestingProcessor, pip).doEdit();
			new AddActivityInputPortMappingEdit(da, pip, aip).doEdit();
		}
		for (OutputActivityPort aop : da.getOutputPorts()) {
			OutputProcessorPort pop = new OutputProcessorPort();
			pop.setName(aop.getName());
			pop.setDepth(aop.getDepth());
			pop.setGranularDepth(aop.getGranularDepth());
			new AddProcessorOutputPortEdit(nestingProcessor, pop).doEdit();
			new AddActivityOutputPortMappingEdit(da, pop, aop).doEdit();
		}
	} catch (EditException e1) {
		logger.error("failed to add ports to processor", e1);
	}
}
 
开发者ID:apache,项目名称:incubator-taverna-plugin-component,代码行数:29,代码来源:NestedWorkflowCreationDialog.java

示例8: setup

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Before
public void setup() throws Exception {
	activity = new Activity();
	activity.setParent(new Profile());

	Element el = getQueryElement("biomart-query.xml");

	Configuration configuration = new Configuration();
	configuration.setType(URI.create("http://ns.taverna.org.uk/2010/activity/biomart").resolve("#Config"));
	String queryText = new XMLOutputter().outputString(new Document(el));
	((ObjectNode) configuration.getJson()).put("martQuery", queryText);

	configuration.setConfigures(activity);
}
 
开发者ID:apache,项目名称:incubator-taverna-plugin-bioinformatics,代码行数:15,代码来源:TestBiomartActivityContextualView.java

示例9: testName

import org.apache.taverna.scufl2.api.activity.Activity; //导入方法依赖的package包/类
@Test
public void testName() throws Exception {
	// Workflow
	WorkflowBundle wb = new WorkflowBundleIO().createBundle();
	
	Workflow wf = wb.getMainWorkflow();
	wf.setName("test_wf");
	InputWorkflowPort raw = new InputWorkflowPort(wf, "RAW");
	OutputWorkflowPort msconvert_log = new OutputWorkflowPort(wf, "MSCONVERT_LOG");
	OutputWorkflowPort cmd = new OutputWorkflowPort(wf, "cmd");
	
	// processor
	Processor msconvert = new Processor(wf, "MSCONVERT");
	InputProcessorPort ms_raw = new InputProcessorPort(msconvert, "raw");
	OutputProcessorPort ms_out = new OutputProcessorPort(msconvert, "out");
	OutputProcessorPort ms_cmd = new OutputProcessorPort(msconvert, "cmd");
	
	// links
	new DataLink(wf, raw, ms_raw);
	new DataLink(wf, ms_out, msconvert_log);
	new DataLink(wf, ms_cmd, cmd);
	
	// Beanshell script
	Activity script = new Activity("msconvert");
	script.setType(BEANSHELL);

	Profile profile = wb.getMainProfile();
	script.setParent(profile);
	profile.getActivities().add(script);
	
	scufl2Tools.createActivityPortsFromProcessor(script, msconvert);
	scufl2Tools.bindActivityToProcessorByMatchingPorts(script, msconvert);
	
	Configuration config = new Configuration();
	config.setConfigures(script);
	config.setType(BEANSHELL.resolve("#Config"));
	((ObjectNode)config.getJson()).put("script", 
			"blablalbal");
	profile.getConfigurations().add(config);
	
	// Save to file (or System.out ? )
	File file = File.createTempFile("test", ".wfbundle");
	bundleIo.writeBundle(wb, file, bundleType);
	System.out.println(file);
}
 
开发者ID:apache,项目名称:incubator-taverna-language,代码行数:46,代码来源:TestSimpleWf.java


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