本文整理汇总了Java中org.apache.taverna.scufl2.api.configurations.Configuration.setConfigures方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.setConfigures方法的具体用法?Java Configuration.setConfigures怎么用?Java Configuration.setConfigures使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.taverna.scufl2.api.configurations.Configuration
的用法示例。
在下文中一共展示了Configuration.setConfigures方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testIdenticalConfigurableTypes
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Test
public void testIdenticalConfigurableTypes() {
Configuration configuration = new Configuration();
Activity a = new Activity();
URI tavernaUri = null;
try {
tavernaUri = new URI("http://www.taverna.org.uk");
} catch (URISyntaxException e) {
return;
}
configuration.setConfigures(a);
configuration.setType(tavernaUri);
a.setType(tavernaUri);
CorrectnessValidator cv = new CorrectnessValidator();
ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
cv.checkCorrectness(configuration, false, rcvl);
Set<MismatchConfigurableTypeProblem> mismatchConfigurableTypeProblems = rcvl.getMismatchConfigurableTypeProblems();
assertEquals(0, mismatchConfigurableTypeProblems.size());
}
示例2: testEqualConfigurableTypes
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Ignore
public void testEqualConfigurableTypes() {
Configuration configuration = new Configuration();
Activity a = new Activity();
URI tavernaUri = null;
URI tavernaUri2 = null;
try {
tavernaUri = new URI("http://www.taverna.org.uk");
tavernaUri2 = new URI("http://www.taverna.org.uk");
} catch (URISyntaxException e) {
return;
}
configuration.setConfigures(a);
configuration.setType(tavernaUri);
a.setType(tavernaUri2);
CorrectnessValidator cv = new CorrectnessValidator();
ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
cv.checkCorrectness(configuration, false, rcvl);
Set<MismatchConfigurableTypeProblem> mismatchConfigurableTypeProblems = rcvl.getMismatchConfigurableTypeProblems();
assertEquals(0, mismatchConfigurableTypeProblems.size());
}
示例3: parseScuflObject
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的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);
}
示例4: createConfigurationFor
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
public Configuration createConfigurationFor(Activity activity,
URI configType) {
Profile profile = activity.getParent();
Configuration config = new Configuration(activity.getName());
profile.getConfigurations().addWithUniqueName(config);
config.setParent(profile);
config.setConfigures(activity);
config.setType(configType);
return config;
}
示例5: testMismatchingConfigurableTypes
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Ignore
public void testMismatchingConfigurableTypes() {
Configuration configuration = new Configuration();
Activity a = new Activity();
URI tavernaUri = null;
URI myGridUri = null;
try {
tavernaUri = new URI("http://www.taverna.org.uk");
myGridUri = new URI("http://www.mygrid.org.uk");
} catch (URISyntaxException e) {
return;
}
configuration.setConfigures(a);
configuration.setType(tavernaUri);
a.setType(myGridUri);
CorrectnessValidator cv = new CorrectnessValidator();
ReportCorrectnessValidationListener rcvl = new ReportCorrectnessValidationListener();
cv.checkCorrectness(configuration, false, rcvl);
Set<MismatchConfigurableTypeProblem> mismatchConfigurableTypeProblems = rcvl.getMismatchConfigurableTypeProblems();
assertEquals(1, mismatchConfigurableTypeProblems.size());
boolean mismatchProblem = false;
for (MismatchConfigurableTypeProblem nlp : mismatchConfigurableTypeProblems) {
if (nlp.getBean().equals(configuration) && nlp.getConfigurable().equals(a)) {
mismatchProblem = true;
}
}
assertTrue(mismatchProblem);
}
示例6: makeConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
public Configuration makeConfiguration() {
Configuration configuration = new Configuration("Hello");
configuration.setConfigures(activity);
configuration
.setType(
URI.create("http://ns.taverna.org.uk/2010/activity/beanshell#Config"));
ObjectNode json = (ObjectNode) configuration.getJson();
json.put("script",
"hello = \"Hello, \" + personName;\n"
+ "JOptionPane.showMessageDialog(null, hello);");
return configuration;
}
示例7: parseConfigurationAndAddToProfile
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
protected Configuration parseConfigurationAndAddToProfile(ConfigBean configBean) throws JAXBException, ReaderException {
Configuration configuration = parseConfiguration(configBean);
if (configuration == null)
return null;
Profile profile = parserState.get().getCurrentProfile();
configuration.setName(parserState.get().getCurrentActivity()
.getName());
profile.getConfigurations().addWithUniqueName(configuration);
configuration.setConfigures(parserState.get().getCurrentConfigurable());
return configuration;
}
示例8: setUp
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Before
public void setUp() throws Exception {
a=new Activity();
Configuration configuration = new Configuration();
ObjectNode json = (ObjectNode) configuration.getJson();
ObjectNode operation = json.objectNode();
operation.put("name", "getReport");
json.set("operation", operation);
String wsdlUrl=TestWSDLActivityContextualView.class.getResource("/GMService.wsdl").toExternalForm();
operation.put("wsdl", wsdlUrl);
configuration.setConfigures(a);
}
开发者ID:apache,项目名称:incubator-taverna-workbench-common-activities,代码行数:13,代码来源:TestWSDLActivityContextualView.java
示例9: setup
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的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
示例10: parseConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
@Override
public Configuration parseConfiguration(T2FlowParser t2FlowParser,
ConfigBean configBean, ParserState parserState)
throws ReaderException {
LoopConfig loopConfig = unmarshallConfig(t2FlowParser, configBean,
"xstream", LoopConfig.class);
final Configuration c = new Configuration();
c.setType(scufl2Uri.resolve("Config"));
ObjectNode json = (ObjectNode) c.getJson();
json.put("runFirst", loopConfig.isRunFirst());
for (Property prop : loopConfig.getProperties().getProperty())
json.put(prop.getName(), prop.getValue());
String conditionXml = loopConfig.getConditionXML();
if (conditionXml == null)
// activity is unconfigured (bug in T2).
// Return c only if there are properties beyond "runFirst"
return json.size() > 1 ? c : null;
Activity conditionActivity = unmarshallXml(
parserState.getT2FlowParser(), conditionXml, Activity.class);
try {
ConditionalActivityParser internalParser = new ConditionalActivityParser(
parserState);
org.apache.taverna.scufl2.api.activity.Activity newActivity = internalParser
.parseActivity(conditionActivity);
String name = parserState.getCurrentProcessor().getName() + "-loop";
newActivity.setName(name);
parserState.getCurrentProfile().getActivities()
.addWithUniqueName(newActivity);
newActivity.setParent(parserState.getCurrentProfile());
Configuration newConfig = internalParser
.parseConfiguration(conditionActivity.getConfigBean());
newConfig.setName(name);
newConfig.setConfigures(newActivity);
parserState.getCurrentProfile().getConfigurations()
.addWithUniqueName(newConfig);
// URI uriActivity = uriTools.relativeUriForBean(newActivity, parserState.getCurrentProfile());
json.put("conditionActivity", newActivity.getName());
} catch (JAXBException e) {
throw new ReaderException("Can't parse conditional loop activity",
e);
}
return c;
}
示例11: testName
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的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);
}
示例12: makeConfiguration
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
private void makeConfiguration() {
URI BEANSHELL = URI
.create("http://ns.taverna.org.uk/2010/activity/beanshell");
/**
* Most activities also require a configuration in order to run. The
* name of the configuration is not important, but must be unique within
* the configurations of a profile. The default constructor
* Configuration() generates a UUID-based name as a fallback.
*/
Configuration beanshellConfig = new Configuration("beanshellConf");
/**
* The activity we configure. (DispatchStackLayer can also be
* configured)
*/
beanshellConfig.setConfigures(myBeanshell);
/**
* A configuration is of a specified type (specified as an URI), which
* is typically related to (but different from) the activity type - but
* might in some cases be shared amongst several activity types.
*/
beanshellConfig.setType(BEANSHELL.resolve("#Config"));
/**
* Configurations are normally shared in the same profile as the
* activity they configure (the parent) - but in some cases might also
* be added by other profiles in order to reuse a configuration across
* profiles. (Note: A profile is *stored* within its parent profile).
*/
beanshellConfig.setParent(profile);
profile.getConfigurations().add(beanshellConfig);
/**
* Depending on the configuration type specified above, certain
* *properties* should be specified, and other properties might be
* optional. In this case, only "script" is
* specified, as a string value. (more complex properties can be
* specified using Jackson JSON methods of the ObjectNode)
*/
beanshellConfig.getJsonAsObjectNode().put("script", "out1 = in1");
/**
* Note that property names are specified as URIs, which are often
* related to the URI of the configuration type - but might be reused
* across several configuration types.
*/
}
示例13: actionPerformed
import org.apache.taverna.scufl2.api.configurations.Configuration; //导入方法依赖的package包/类
public void actionPerformed(ActionEvent e) {
try {
Activity activity = new Activity();
activity.setType(STRING_CONSTANT);
Configuration configuration = new Configuration();
configuration.setType(STRING_CONSTANT.resolve("#Config"));
configuration.getJsonAsObjectNode().put("string", "");
configuration.setConfigures(activity);
StringConstantConfigView configView = new StringConstantConfigView(activity,
configuration, serviceRegistry);
int answer = JOptionPane.showConfirmDialog(component, configView,
"Text constant value", JOptionPane.OK_CANCEL_OPTION);
if (answer != JOptionPane.CANCEL_OPTION) {
configView.noteConfiguration();
configuration.setJson(configView.getJson());
Profile profile = selectionManager.getSelectedProfile();
Processor processor = new Processor();
processor.setName(inputPort.getName() + "_value");
CrossProduct crossProduct = new CrossProduct();
crossProduct.setParent(processor.getIterationStrategyStack());
ProcessorBinding processorBinding = new ProcessorBinding();
processorBinding.setBoundProcessor(processor);
processorBinding.setBoundActivity(activity);
// create activity port
OutputActivityPort activityPort = new OutputActivityPort(activity, "value");
activityPort.setDepth(0);
activityPort.setGranularDepth(0);
// create processor port
OutputProcessorPort processorPort = new OutputProcessorPort(processor,
activityPort.getName());
processorPort.setDepth(0);
processorPort.setGranularDepth(0);
// add a new port binding
new ProcessorOutputPortBinding(processorBinding, activityPort, processorPort);
// Add a data link between the string constant processor's output port
// and the processor containing the passed inputPort.
DataLink datalink = new DataLink();
datalink.setReceivesFrom(processorPort);
datalink.setSendsTo(inputPort);
List<Edit<?>> editList = new ArrayList<Edit<?>>();
editList.add(new AddChildEdit<Profile>(profile, activity));
editList.add(new AddChildEdit<Profile>(profile, configuration));
editList.add(new AddChildEdit<Profile>(profile, processorBinding));
editList.add(new AddProcessorEdit(dataflow, processor));
editList.add(new AddDataLinkEdit(dataflow, datalink));
editManager.doDataflowEdit(dataflow.getParent(), new CompoundEdit(editList));
}
} catch (EditException ex) {
logger.error("Adding default value for input port failed", ex);
}
}