本文整理了Java中net.sf.taverna.t2.workflowmodel.processor.activity.Activity.getInputPortMapping()
方法的一些代码示例,展示了Activity.getInputPortMapping()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.getInputPortMapping()
方法的具体详情如下:
包路径:net.sf.taverna.t2.workflowmodel.processor.activity.Activity
类名称:Activity
方法名:getInputPortMapping
[英]A processor may have different input port names to the activity or activities it contains. This map is keyed on the processor input port names with the corresponding value being the activity port name.
[中]处理器可能对其包含的一个或多个活动具有不同的输入端口名。此映射键入处理器输入端口名称,相应的值为活动端口名称。
代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-api
public static ProcessorInputPort getProcessorInputPort(Processor processor,
Activity<?> activity, InputPort activityInputPort) {
ProcessorInputPort result = null;
for (Entry<String, String> mapEntry : activity.getInputPortMapping()
.entrySet()) {
if (mapEntry.getValue().equals(activityInputPort.getName())) {
for (ProcessorInputPort processorInputPort : processor
.getInputPorts()) {
if (processorInputPort.getName().equals(mapEntry.getKey())) {
result = processorInputPort;
break;
}
}
break;
}
}
return result;
}
代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl
public static ProcessorInputPort getProcessorInputPort(Processor processor,
Activity<?> activity, InputPort activityInputPort) {
ProcessorInputPort result = null;
for (Entry<String, String> mapEntry : activity.getInputPortMapping()
.entrySet()) {
if (mapEntry.getValue().equals(activityInputPort.getName())) {
for (ProcessorInputPort processorInputPort : processor
.getInputPorts()) {
if (processorInputPort.getName().equals(mapEntry.getKey())) {
result = processorInputPort;
break;
}
}
break;
}
}
return result;
}
代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-impl
for (String processorInputName : describingActivity.getInputPortMapping()
.keySet()) {
Element mapElement = new Element(MAP, T2_WORKFLOW_NAMESPACE);
mapElement.setAttribute(FROM, processorInputName);
mapElement.setAttribute(TO, describingActivity.getInputPortMapping().get(
processorInputName));
ipElement.addContent(mapElement);
代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl
for (String processorInputName : activity.getInputPortMapping()
.keySet()) {
Element mapElement = new Element(MAP, T2_WORKFLOW_NAMESPACE);
mapElement.setAttribute(FROM, processorInputName);
mapElement.setAttribute(TO, activity.getInputPortMapping().get(
processorInputName));
ipElement.addContent(mapElement);
代码示例来源:origin: net.sf.taverna.t2/maelstrom-impl
for (String processorInputName : activity.getInputPortMapping()
.keySet()) {
Element mapElement = new Element(MAP);
mapElement.setAttribute(FROM, processorInputName);
mapElement.setAttribute(TO, activity.getInputPortMapping().get(
processorInputName));
ipElement.addContent(mapElement);
代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-impl
for (String processorInputName : activity.getInputPortMapping()
.keySet()) {
Element mapElement = new Element(MAP);
mapElement.setAttribute(FROM, processorInputName);
mapElement.setAttribute(TO, activity.getInputPortMapping().get(
processorInputName));
ipElement.addContent(mapElement);
代码示例来源:origin: net.sf.taverna.t2.ui-exts/loop-ui
private HashSet<String> findFeedbackPorts() {
HashSet<String> incoming = new HashSet<String>();
for (InputPort inputPort : activityToCompare.getInputPorts()) {
String activityPortName = inputPort.getName();
String processorPortName = activityToCompare.getInputPortMapping()
.get(activityPortName);
if (processorPortName == null) {
// We'll need to map it later
processorPortName = activityPortName;
}
incoming.add(processorPortName);
}
HashSet<String> outgoing = new HashSet<String>();
for (OutputPort outputPort : activityToCompare.getOutputPorts()) {
String activityPortName = outputPort.getName();
String processorPortName = activityToCompare.getOutputPortMapping()
.get(activityPortName);
if (processorPortName == null) {
// We'll need to map it later
processorPortName = activityPortName;
}
outgoing.add(processorPortName);
}
// Return the port names that are common
incoming.retainAll(outgoing);
return incoming;
}
}
代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-api
Map<String, String> portMapping = ra.getInputPortMapping();
Set<String> portNames = new HashSet<String>();
portNames.addAll(portMapping.keySet());
代码示例来源:origin: net.sf.taverna.t2/cyclone-impl
alternateActivity.getInputPortMapping().put(entry.getKey(),
entry.getValue());
代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl
if (a.getInputPortMapping().containsKey(ip.getName())) {
edits.add(new RemoveActivityInputPortMappingEdit(a,ip.getName()));
代码示例来源:origin: net.sf.taverna.t2/compatibility-impl
alternateActivity.getInputPortMapping().put(entry.getKey(),
entry.getValue());
代码示例来源:origin: net.sf.taverna.t2/cyclone-impl
.getName(), inputPort.getDepth());
addInputPortEdit.doEdit();
activity.getInputPortMapping().put(inputPort.getName(),
inputPort.getName());
代码示例来源:origin: net.sf.taverna.t2/compatibility-impl
@Test
public void testAlternateProcessorTranslation() throws Exception {
Dataflow dataflow = translateScuflFile("alternate_test_workflow.xml");
assertEquals(1, dataflow.getProcessors().size());
Processor processor = dataflow.getProcessors().get(0);
assertEquals(2, processor.getActivityList().size());
assertEquals(1, processor.getActivityList().get(0).getInputPorts().size());
assertEquals("input", processor.getActivityList().get(0).getInputPorts().iterator().next().getName());
assertEquals(1, processor.getActivityList().get(0).getOutputPorts().size());
assertEquals("output", processor.getActivityList().get(0).getOutputPorts().iterator().next().getName());
assertEquals(1, processor.getActivityList().get(1).getInputPorts().size());
assertEquals("in", processor.getActivityList().get(1).getInputPorts().iterator().next().getName());
assertEquals(1, processor.getActivityList().get(1).getOutputPorts().size());
assertEquals("out", processor.getActivityList().get(1).getOutputPorts().iterator().next().getName());
assertEquals(1, processor.getActivityList().get(1).getInputPortMapping().keySet().size());
assertEquals("input", processor.getActivityList().get(1).getInputPortMapping().keySet().iterator().next());
assertEquals(1, processor.getActivityList().get(1).getInputPortMapping().values().size());
assertEquals("in", processor.getActivityList().get(1).getInputPortMapping().values().iterator().next());
assertEquals(1, processor.getActivityList().get(1).getOutputPortMapping().keySet().size());
assertEquals("output", processor.getActivityList().get(1).getOutputPortMapping().keySet().iterator().next());
assertEquals(1, processor.getActivityList().get(1).getOutputPortMapping().values().size());
assertEquals("out", processor.getActivityList().get(1).getOutputPortMapping().values().iterator().next());
}
代码示例来源:origin: net.sf.taverna.t2/cyclone-impl
@Test
public void testAlternateProcessorTranslation() throws Exception {
Dataflow dataflow = translateScuflFile("alternate_test_workflow.xml");
assertEquals(1, dataflow.getProcessors().size());
Processor processor = dataflow.getProcessors().get(0);
assertEquals(2, processor.getActivityList().size());
assertEquals(1, processor.getActivityList().get(0).getInputPorts().size());
assertEquals("input", processor.getActivityList().get(0).getInputPorts().iterator().next().getName());
assertEquals(1, processor.getActivityList().get(0).getOutputPorts().size());
assertEquals("output", processor.getActivityList().get(0).getOutputPorts().iterator().next().getName());
assertEquals(1, processor.getActivityList().get(1).getInputPorts().size());
assertEquals("in", processor.getActivityList().get(1).getInputPorts().iterator().next().getName());
assertEquals(1, processor.getActivityList().get(1).getOutputPorts().size());
assertEquals("out", processor.getActivityList().get(1).getOutputPorts().iterator().next().getName());
assertEquals(1, processor.getActivityList().get(1).getInputPortMapping().keySet().size());
assertEquals("input", processor.getActivityList().get(1).getInputPortMapping().keySet().iterator().next());
assertEquals(1, processor.getActivityList().get(1).getInputPortMapping().values().size());
assertEquals("in", processor.getActivityList().get(1).getInputPortMapping().values().iterator().next());
assertEquals(1, processor.getActivityList().get(1).getOutputPortMapping().keySet().size());
assertEquals("out", processor.getActivityList().get(1).getOutputPortMapping().keySet().iterator().next());
assertEquals(1, processor.getActivityList().get(1).getOutputPortMapping().values().size());
assertEquals("output", processor.getActivityList().get(1).getOutputPortMapping().values().iterator().next());
}
代码示例来源:origin: net.sf.taverna.t2.compatibility/compatibility-impl
@Test
public void testAlternateProcessorTranslation() throws Exception {
Dataflow dataflow = translateScuflFile("alternate_test_workflow.xml");
assertEquals(1, dataflow.getProcessors().size());
Processor processor = dataflow.getProcessors().get(0);
assertEquals(2, processor.getActivityList().size());
assertEquals(1, processor.getActivityList().get(0).getInputPorts().size());
assertEquals("input", processor.getActivityList().get(0).getInputPorts().iterator().next().getName());
assertEquals(1, processor.getActivityList().get(0).getOutputPorts().size());
assertEquals("output", processor.getActivityList().get(0).getOutputPorts().iterator().next().getName());
assertEquals(1, processor.getActivityList().get(1).getInputPorts().size());
assertEquals("in", processor.getActivityList().get(1).getInputPorts().iterator().next().getName());
assertEquals(1, processor.getActivityList().get(1).getOutputPorts().size());
assertEquals("out", processor.getActivityList().get(1).getOutputPorts().iterator().next().getName());
assertEquals(1, processor.getActivityList().get(1).getInputPortMapping().keySet().size());
assertEquals("input", processor.getActivityList().get(1).getInputPortMapping().keySet().iterator().next());
assertEquals(1, processor.getActivityList().get(1).getInputPortMapping().values().size());
assertEquals("in", processor.getActivityList().get(1).getInputPortMapping().values().iterator().next());
assertEquals(1, processor.getActivityList().get(1).getOutputPortMapping().keySet().size());
assertEquals("output", processor.getActivityList().get(1).getOutputPortMapping().keySet().iterator().next());
assertEquals(1, processor.getActivityList().get(1).getOutputPortMapping().values().size());
assertEquals("out", processor.getActivityList().get(1).getOutputPortMapping().values().iterator().next());
}
代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-api
/**
* Create a DisabledActivity that represents a specific Activity that is now
* disabled e.g. by its remote endpoint going offline. Note that in this
* case, the ports of the DisabledActivity and their mapping to the
* containing Processor's ports can be inherited from the Activity that is
* now disabled.
*
* @param activity The Activity that is now disabled.
*/
public DisabledActivity(Activity<?> activity) {
this(activity, activity.getConfiguration());
for (ActivityInputPort aip : activity.getInputPorts()) {
this.addInput(aip.getName(), aip.getDepth(), aip
.allowsLiteralValues(), aip.getHandledReferenceSchemes(),
aip.getTranslatedElementClass());
}
for (OutputPort op : activity.getOutputPorts()) {
this.addOutput(op.getName(), op.getDepth(), op.getGranularDepth());
}
this.getInputPortMapping().clear();
this.getInputPortMapping().putAll(activity.getInputPortMapping());
this.getOutputPortMapping().clear();
this.getOutputPortMapping().putAll(activity.getOutputPortMapping());
}
代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-impl
activity.getInputPortMapping().clear();
activity.getOutputPortMapping().clear();
for (InputPort ip : activity.getInputPorts()) {
ProcessorInputPort pip = edits.createProcessorInputPort(processor,ip.getName(), ip.getDepth());
new AddProcessorInputPortEdit(processor, pip).doEdit();
activity.getInputPortMapping().put(ip.getName(), ip.getName());
代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl
activity.getInputPortMapping().clear();
activity.getOutputPortMapping().clear();
for (InputPort ip : activity.getInputPorts()) {
ProcessorInputPort pip = edits.createProcessorInputPort(processor,ip.getName(), ip.getDepth());
new AddProcessorInputPortEdit(processor, pip).doEdit();
activity.getInputPortMapping().put(ip.getName(), ip.getName());
代码示例来源:origin: net.sf.taverna.t2/compatibility-impl
.getAddProcessorInputPortEdit(t2Processor, port);
addInputPortEdit.doEdit();
activity.getInputPortMapping().put(inputPort.getName(),
inputPort.getName());
代码示例来源:origin: net.sf.taverna.t2/maelstrom-impl
activity.getInputPortMapping().clear();
activity.getOutputPortMapping().clear();
for (InputPort ip : activity.getInputPorts()) {
new CreateProcessorInputPortEdit(processor, ip.getName(), ip
.getDepth()).doEdit();
activity.getInputPortMapping().put(ip.getName(), ip.getName());
内容来源于网络,如有侵权,请联系作者删除!