net.sf.taverna.t2.workflowmodel.Edit.doEdit()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(9.5k)|赞(0)|评价(0)|浏览(131)

本文整理了Java中net.sf.taverna.t2.workflowmodel.Edit.doEdit()方法的一些代码示例,展示了Edit.doEdit()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Edit.doEdit()方法的具体详情如下:
包路径:net.sf.taverna.t2.workflowmodel.Edit
类名称:Edit
方法名:doEdit

Edit.doEdit介绍

[英]Perform the edit
[中]执行编辑

代码示例

代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-impl

@Override
protected void doEditAction(ProcessorImpl processor) throws EditException {
  compoundEdit.doEdit();
}

代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl

@Override
protected void doEditAction(ProcessorImpl processor) throws EditException {
  compoundEdit.doEdit();
}

代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-impl

@Override
protected void undoEditAction(ProcessorImpl processor) {
  try {
    new EditsImpl().getAddProcessorOutputPortEdit(processor, port).doEdit();
  } catch (EditException e) {
    logger.error("There was an error adding an input port to a Processor whilst undoing a remove");
  }
}

代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl

@Override
protected void undoEditAction(ProcessorImpl processor) {
  try {
    new EditsImpl().getAddProcessorInputPortEdit(processor, port).doEdit();
  } catch (EditException e) {
    logger.error("There was an error adding an input port to a Processor whilst undoing a remove");
  }
}

代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-impl

@Override
protected void undoEditAction(ProcessorImpl processor) {
  try {
    new EditsImpl().getAddProcessorInputPortEdit(processor, port).doEdit();
  } catch (EditException e) {
    logger.error("There was an error adding an input port to a Processor whilst undoing a remove");
  }
}

代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl

@Override
protected void undoEditAction(ProcessorImpl processor) {
  try {
    new EditsImpl().getAddProcessorOutputPortEdit(processor, port).doEdit();
  } catch (EditException e) {
    logger.error("There was an error adding an input port to a Processor whilst undoing a remove");
  }
}

代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl

@SuppressWarnings("unchecked")
  public void buildConditions(Dataflow df, Element conditionsElement,
      Map<String, Processor> createdProcessors) throws DeserializationException, EditException {
    for (Element conditionElement : (List<Element>)conditionsElement.getChildren(CONDITION,T2_WORKFLOW_NAMESPACE)) {
      String control=conditionElement.getAttributeValue("control");
      String target=conditionElement.getAttributeValue("target");
      Processor controlProcessor=createdProcessors.get(control);
      Processor targetProcessor=createdProcessors.get(target);
      if (controlProcessor==null) throw new DeserializationException("Unable to find start processor for control link, named:"+control);
      if (targetProcessor==null) throw new DeserializationException("Unable to find target processor for control link, named:"+target);
      edits.getCreateConditionEdit(controlProcessor, targetProcessor).doEdit();
    }        
  }
}

代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-impl

@SuppressWarnings("unchecked")
  public void buildConditions(Dataflow df, Element conditionsElement,
      Map<String, Processor> createdProcessors) throws DeserializationException, EditException {
    for (Element conditionElement : (List<Element>)conditionsElement.getChildren(CONDITION,T2_WORKFLOW_NAMESPACE)) {
      String control=conditionElement.getAttributeValue("control");
      String target=conditionElement.getAttributeValue("target");
      Processor controlProcessor=createdProcessors.get(control);
      Processor targetProcessor=createdProcessors.get(target);
      if (controlProcessor==null) throw new DeserializationException("Unable to find start service for control link, named:"+control);
      if (targetProcessor==null) throw new DeserializationException("Unable to find target service for control link, named:"+target);
      edits.getCreateConditionEdit(controlProcessor, targetProcessor).doEdit();
    }        
  }
}

代码示例来源:origin: net.sf.taverna.t2.ui-activities/component-activity-ui

private Dataflow createNestedDataflow(ActionEvent e) {
  Dataflow nestedDataflow = edits.createDataflow();
  ((DataflowImpl) nestedDataflow).setLocalName(nameField.getText());
  try {
    AnnotationTools at = new AnnotationTools();
    at.setAnnotationString(nestedDataflow, DescriptiveTitle.class,
        nameField.getText()).doEdit();
  } catch (EditException e2) {
    logger.error("failed to put annotation on nested dataflow", e2);
  }
  return nestedDataflow;
}

代码示例来源:origin: net.sf.taverna.t2.activities/stringconstant-activity

protected void addOutput(String portName, int portDepth, String type) {
  OutputPort port = edits.createActivityOutputPort(
      portName, portDepth, portDepth);
  MimeType mimeType = new MimeType();
  mimeType.setText(type);
  try {
    edits.getAddAnnotationChainEdit(port, mimeType).doEdit();
  } catch (EditException e) {
    logger.debug("Error adding MimeType annotation to port", e);
  }
  outputPorts.add(port);
}

代码示例来源:origin: net.sf.taverna.t2/workflowmodel-impl

@SuppressWarnings("unchecked")
  public void deserializeDispatchStack(Processor processor,
      Element dispatchStack) throws ClassNotFoundException, InstantiationException, IllegalAccessException, EditException {
    int layers=0;
    for (Element layer : (List<Element>)dispatchStack.getChildren(DISPATCH_LAYER,T2_WORKFLOW_NAMESPACE)) {
      DispatchLayer<?> dispatchLayer = DispatchLayerXMLDeserializer.getInstance().deserializeDispatchLayer(layer);
      edits.getAddDispatchLayerEdit(processor.getDispatchStack(), dispatchLayer, layers++).doEdit();
    }
    
  }
}

代码示例来源:origin: net.sf.taverna.t2.core/workflowmodel-impl

@SuppressWarnings("unchecked")
  public void deserializeDispatchStack(Processor processor,
      Element dispatchStack) throws ClassNotFoundException, InstantiationException, IllegalAccessException, EditException {
    int layers=0;
    for (Element layer : (List<Element>)dispatchStack.getChildren(DISPATCH_LAYER,T2_WORKFLOW_NAMESPACE)) {
      DispatchLayer<?> dispatchLayer = DispatchLayerXMLDeserializer.getInstance().deserializeDispatchLayer(layer);
      if (dispatchLayer instanceof Invoke) {
        edits.getAddDispatchLayerEdit(processor.getDispatchStack(), new Stop(), layers++).doEdit();
      }
      edits.getAddDispatchLayerEdit(processor.getDispatchStack(), dispatchLayer, layers++).doEdit();
    }
    
  }
}

代码示例来源:origin: net.sf.taverna.t2/cyclone-impl

private void createOutputs(Dataflow dataflow) throws EditException {
  for (Port sinkPort : scuflModel.getWorkflowSinkPorts()) {
    edits.getCreateDataflowOutputPortEdit(dataflow, sinkPort.getName())
        .doEdit();
    for (DataflowOutputPort outputPort : dataflow.getOutputPorts()) {
      if (outputPort.getName().equals(sinkPort.getName())) {
        outputMap.put(sinkPort, outputPort);
        break;
      }
    }
  }
}

代码示例来源:origin: net.sf.taverna.t2/cyclone-impl

private void createInputs(Dataflow dataflow) throws EditException {
  for (Port sourcePort : scuflModel.getWorkflowSourcePorts()) {
    int portDepth = getPortDepth(sourcePort);
    edits.getCreateDataflowInputPortEdit(dataflow,
        sourcePort.getName(), portDepth, portDepth).doEdit();
    for (DataflowInputPort inputPort : dataflow.getInputPorts()) {
      if (inputPort.getName().equals(sourcePort.getName())) {
        inputMap.put(sourcePort, inputPort);
        break;
      }
    }
  }
}

代码示例来源:origin: net.sf.taverna.t2/maelstrom-impl

@Test(expected=EditException.class)
  public void invalidSinkPort() throws Exception {
    Edit<Merge> theEdit = new ConnectMergedDatalinkEdit(merge,sourcePort,sinkPort);
    theEdit.doEdit();
    
    ProcessorImpl p2=new ProcessorImpl();
    ProcessorInputPortImpl sinkPort2=new ProcessorInputPortImpl(p2,"sink_port2",0);
    theEdit = new ConnectMergedDatalinkEdit(merge,sourcePort,sinkPort2);
    theEdit.doEdit();
    
  }
}

代码示例来源:origin: net.sf.taverna.t2.activities/dataflow-activity

@Before
public void setUp() throws Exception {
  activity = new DataflowActivity();
  Edits edits = new EditsImpl();
  activity.setEdits(edits);
  dataflow = edits.createDataflow();
  edits.getCreateDataflowInputPortEdit(dataflow, "input", 0, 0).doEdit();
  edits.getCreateDataflowOutputPortEdit(dataflow, "output").doEdit();
  Datalink datalink = edits.createDatalink(dataflow.getInputPorts().get(0).getInternalOutputPort(), 
      dataflow.getOutputPorts().get(0).getInternalInputPort());
  edits.getConnectDatalinkEdit(datalink).doEdit();
}

代码示例来源:origin: net.sf.taverna.t2/dataflow-activity

@Before
public void setUp() throws Exception {
  activity = new DataflowActivity();
  configurationBean = new DataflowActivityConfigurationBean();
  Edits edits = EditsRegistry.getEdits();
  dataflow = edits.createDataflow();
  edits.getCreateDataflowInputPortEdit(dataflow, "input", 0, 0).doEdit();
  edits.getCreateDataflowOutputPortEdit(dataflow, "output").doEdit();
  configurationBean.setDataflow(dataflow);
}

代码示例来源:origin: net.sf.taverna.t2/maelstrom-impl

/**
 * Check that the outgoing link to the sink port is retained when undoing a second merged input.
 */
@Test
public void undoSecond() throws Exception {
  Edit<Merge> theEdit = new ConnectMergedDatalinkEdit(merge,sourcePort,sinkPort);
  theEdit.doEdit();
  ProcessorImpl p3=new ProcessorImpl();
  ProcessorOutputPortImpl sourcePort2=new ProcessorOutputPortImpl(p3,"source_port2",0,0);
  Edit<Merge> theEdit2 = new ConnectMergedDatalinkEdit(merge,sourcePort2,sinkPort);
  theEdit2.doEdit();
  theEdit2.undo();
  assertEquals(1,merge.getInputPorts().size());
  assertEquals(1,merge.getOutputPort().getOutgoingLinks().size());
}

代码示例来源:origin: net.sf.taverna.t2/maelstrom-impl

@Test
public void testThroughEditsImpl() throws Exception {
  //Essentially the same as testAddingOfProcessor, but a sanity test that it works correctly through the Edits API
  Dataflow f = new DataflowImpl();
  new EditsImpl().getAddProcessorEdit(f, processor).doEdit();
  
  assertEquals(1,f.getProcessors().size());
  assertEquals(processor,f.getProcessors().get(0));
}

代码示例来源:origin: net.sf.taverna.t2/maelstrom-impl

@Test
public void undo() throws Exception {
  Edit<Merge> theEdit = new ConnectMergedDatalinkEdit(merge,sourcePort,sinkPort);
  theEdit.doEdit();
  theEdit.undo();
  assertEquals(0,merge.getInputPorts().size());
  assertEquals(0,merge.getOutputPort().getOutgoingLinks().size());
  assertEquals(0,sourcePort.getOutgoingLinks().size());
  assertNull(sinkPort.getIncomingLink());
}

相关文章