本文整理了Java中net.sf.taverna.t2.workflowmodel.processor.activity.Activity.getOutputPortMapping()
方法的一些代码示例,展示了Activity.getOutputPortMapping()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Activity.getOutputPortMapping()
方法的具体详情如下:
包路径:net.sf.taverna.t2.workflowmodel.processor.activity.Activity
类名称:Activity
方法名:getOutputPortMapping
[英]Outputs of the activity may be named differently to those of the processor. This map is keyed on an activity output port name with each corresponding value being the processor output port name to which the activity output is bound.
[中]活动的输出可能与处理器的输出命名不同。此映射键入活动输出端口名,每个对应的值都是活动输出绑定到的处理器输出端口名。
代码示例来源:origin: net.sf.taverna.t2.activities/external-tool-activity
private static ActivityOutputPort getActivityOutputPort(
Activity<?> activity, ProcessorPort processorOutputPort) {
ProcessorInputPort result = null;
for (Entry<String, String> mapEntry : activity.getOutputPortMapping()
.entrySet()) {
if (mapEntry.getKey().equals(processorOutputPort.getName())) {
for (OutputPort activityOutputPort : activity
.getOutputPorts()) {
if (activityOutputPort.getName().equals(mapEntry.getValue())) {
return (ActivityOutputPort) activityOutputPort;
}
}
break;
}
}
return null;
}
代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-api
public static ProcessorOutputPort getProcessorOutputPort(
Processor processor, Activity<?> activity,
OutputPort activityOutputPort) {
ProcessorOutputPort result = null;
for (Entry<String, String> mapEntry : activity.getOutputPortMapping()
.entrySet()) {
if (mapEntry.getValue().equals(activityOutputPort.getName())) {
for (ProcessorOutputPort processorOutputPort : processor
.getOutputPorts()) {
if (processorOutputPort.getName().equals(mapEntry.getKey())) {
result = processorOutputPort;
break;
}
}
break;
}
}
return result;
}
代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl
public static ProcessorOutputPort getProcessorOutputPort(
Processor processor, Activity<?> activity,
OutputPort activityOutputPort) {
ProcessorOutputPort result = null;
for (Entry<String, String> mapEntry : activity.getOutputPortMapping()
.entrySet()) {
if (mapEntry.getValue().equals(activityOutputPort.getName())) {
for (ProcessorOutputPort processorOutputPort : processor
.getOutputPorts()) {
if (processorOutputPort.getName().equals(mapEntry.getKey())) {
result = processorOutputPort;
break;
}
}
break;
}
}
return result;
}
代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-impl
for (String activityOutputName : describingActivity.getOutputPortMapping()
.keySet()) {
Element mapElement = new Element(MAP, T2_WORKFLOW_NAMESPACE);
mapElement.setAttribute(FROM, activityOutputName);
mapElement.setAttribute(TO, describingActivity.getOutputPortMapping().get(
activityOutputName));
opElement.addContent(mapElement);
代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl
for (String activityOutputName : activity.getOutputPortMapping()
.keySet()) {
Element mapElement = new Element(MAP, T2_WORKFLOW_NAMESPACE);
mapElement.setAttribute(FROM, activityOutputName);
mapElement.setAttribute(TO, activity.getOutputPortMapping().get(
activityOutputName));
opElement.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
editList.add(edits.getRemoveActivityInputPortMappingEdit(ra, portName));
portMapping = ra.getOutputPortMapping();
portNames.clear();
portNames.addAll(portMapping.keySet());
代码示例来源:origin: net.sf.taverna.t2.ui-exts/loop-ui
ActivityInputPortDefinitionBean inputDef = new ActivityInputPortDefinitionBean();
String activityPortName = outputPort.getName();
String processorPortName = activityToCompare.getOutputPortMapping()
.get(activityPortName);
if (processorPortName == null) {
代码示例来源:origin: net.sf.taverna.t2.ui-exts/loop-ui
outputDef = new ActivityOutputPortDefinitionBean();
String activityPortName = outputPort.getName();
String processorPortName = activityToCompare.getOutputPortMapping()
.get(activityPortName);
if (processorPortName == null) {
代码示例来源:origin: net.sf.taverna.t2/cyclone-impl
/**
* @param activity
* @param t2Processor
* @throws EditException
*/
private void addOutputPorts(Activity<?> activity, Processor t2Processor)
throws EditException {
Set<OutputPort> outputPorts = activity.getOutputPorts();
for (OutputPort outputPort : outputPorts) {
Edit<Processor> addOutputPortEdit = edits
.getCreateProcessorOutputPortEdit(t2Processor, outputPort
.getName(), outputPort.getDepth(), outputPort
.getGranularDepth());
addOutputPortEdit.doEdit();
activity.getOutputPortMapping().put(outputPort.getName(),
outputPort.getName());
}
}
代码示例来源:origin: net.sf.taverna.t2/cyclone-impl
alternateActivity.getOutputPortMapping().put(entry.getValue(),
entry.getKey());
代码示例来源:origin: net.sf.taverna.t2/compatibility-impl
alternateActivity.getOutputPortMapping().put(entry.getKey(),
entry.getValue());
代码示例来源:origin: net.sf.taverna.t2/compatibility-impl
/**
* @param activity
* @param t2Processor
* @throws EditException
*/
private void addOutputPorts(Activity<?> activity, Processor t2Processor)
throws EditException {
Set<OutputPort> outputPorts = activity.getOutputPorts();
for (OutputPort outputPort : outputPorts) {
ProcessorOutputPort port = edits.createProcessorOutputPort(
t2Processor, outputPort.getName(), outputPort.getDepth(),
outputPort.getGranularDepth());
Edit<Processor> addOutputPortEdit = edits
.getAddProcessorOutputPortEdit(t2Processor, port);
addOutputPortEdit.doEdit();
activity.getOutputPortMapping().put(outputPort.getName(),
outputPort.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.getOutputPortMapping().clear();
for (InputPort ip : activity.getInputPorts()) {
ProcessorInputPort pip = edits.createProcessorInputPort(processor,ip.getName(), ip.getDepth());
.getDepth(), op.getGranularDepth());
new AddProcessorOutputPortEdit(processor, pop).doEdit();
activity.getOutputPortMapping().put(op.getName(), op.getName());
代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl
activity.getOutputPortMapping().clear();
for (InputPort ip : activity.getInputPorts()) {
ProcessorInputPort pip = edits.createProcessorInputPort(processor,ip.getName(), ip.getDepth());
.getDepth(), op.getGranularDepth());
new AddProcessorOutputPortEdit(processor, pop).doEdit();
activity.getOutputPortMapping().put(op.getName(), op.getName());
代码示例来源:origin: net.sf.taverna.t2/maelstrom-impl
activity.getOutputPortMapping().clear();
for (InputPort ip : activity.getInputPorts()) {
new CreateProcessorInputPortEdit(processor, ip.getName(), ip
new CreateProcessorOutputPortEdit(processor, op.getName(), op
.getDepth(), op.getGranularDepth()).doEdit();
activity.getOutputPortMapping().put(op.getName(), op.getName());
内容来源于网络,如有侵权,请联系作者删除!