public String getName() { if (theProcessor == null) { return "Template editor for unknown processor"; } else { return "Template editor for " + theProcessor.getName(); } }
public JComponent getComponent(Processor processor) { return new JTree(new String[] { processor.getName() }); }
/** * @param processor */ public void addOutputProcessor(Processor processor) { if (!processor.getName().equals("SCUFL_INTERNAL_SINKPORTS")) { outputProcessors.add(processor); } }
public String toString() { StringBuffer sb = new StringBuffer(); sb .append("Processor '" + processor.getName() + "' failed, cause :\n "); sb.append(cause.toString()); sb.append("\n"); return sb.toString(); }
public String toString() { StringBuffer sb = new StringBuffer(); sb .append("Nested Workflow '" + processor.getName() + "' failed, cause :\n "); sb.append(cause.toString()); sb.append("\n"); return sb.toString(); }
public Object getValue(Object node) { if(node instanceof Processor) { return ((Processor)node).getName(); } else if(node instanceof Port) { return ((Port)node).getName(); } return ""; }
public void actionPerformed(ActionEvent ae) { String ccName = target.getName() + "_BLOCKON_" + controller.getName(); try { // Constraints created by this menu are, for now, // always // of the form 'block scheduled to running until // completed', // as this is all the enactor can currently support. ConcurrencyConstraint cc = new ConcurrencyConstraint(model, ccName, controller, target, ConcurrencyConstraint.SCHEDULED, ConcurrencyConstraint.RUNNING, ConcurrencyConstraint.COMPLETED); model.addConcurrencyConstraint(cc); } catch (Exception e) { JOptionPane.showMessageDialog(null, "Something wasn't happy : \n" + e.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); } } });
public void actionPerformed(ActionEvent ae) { String ccName = target.getName() + "_BLOCKON_" + controller.getName(); try { // Constraints created by this menu are, for now, // always // of the form 'block scheduled to running until // completed', // as this is all the enactor can currently support. ConcurrencyConstraint cc = new ConcurrencyConstraint(model, ccName, controller, target, ConcurrencyConstraint.SCHEDULED, ConcurrencyConstraint.RUNNING, ConcurrencyConstraint.COMPLETED); model.addConcurrencyConstraint(cc); } catch (Exception e) { JOptionPane.showMessageDialog(null, "Something wasn't happy : \n" + e.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); } } });
private Processor getProcessor(String name) throws Exception { Processor processor; for (int j = 0; j < processors.length; j++) { if (processors[j].getName().equals(name)) { processor = processors[j]; return processor; } } throw new Exception("Processor not found"); }
/** * Print a summary of the event details */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("Process '" + processor.getName() + "' complete "); if (isIterating) { sb.append("(iterating)"); } else { sb.append("(simple)"); } sb.append("\n"); String prefix = "in "; for (Iterator i = inputMap.keySet().iterator(); i.hasNext();) { String inputKey = (String) i.next(); DataThing inputThing = (DataThing) inputMap.get(inputKey); String mainLSID = inputThing.getLSID(inputThing.getDataObject()); sb.append(prefix + "'" + inputKey + "'->" + mainLSID + "\n"); prefix = " "; } prefix = "out "; for (Iterator i = outputMap.keySet().iterator(); i.hasNext();) { String outputKey = (String) i.next(); DataThing outputThing = (DataThing) outputMap.get(outputKey); String mainLSID = outputThing.getLSID(outputThing.getDataObject()); sb.append(prefix + "" + mainLSID + "->'" + outputKey + "'\n"); prefix = " "; } return sb.toString(); }
/** * Print a summary of the event details */ public String toString() { StringBuffer sb = new StringBuffer(); sb.append("NestedWorkflow '" + processor.getName() + "' complete "); if (isIterating) { sb.append("(iterating)"); } else { sb.append("(simple)"); } sb.append("\n"); String prefix = "in "; for (Iterator i = inputMap.keySet().iterator(); i.hasNext();) { String inputKey = (String) i.next(); DataThing inputThing = (DataThing) inputMap.get(inputKey); String mainLSID = inputThing.getLSID(inputThing.getDataObject()); sb.append(prefix + "'" + inputKey + "'->" + mainLSID + "\n"); prefix = " "; } prefix = "out "; for (Iterator i = outputMap.keySet().iterator(); i.hasNext();) { String outputKey = (String) i.next(); DataThing outputThing = (DataThing) outputMap.get(outputKey); String mainLSID = outputThing.getLSID(outputThing.getDataObject()); sb.append(prefix + "" + mainLSID + "->'" + outputKey + "'\n"); prefix = " "; } return sb.toString(); }
private void doChildren(ScuflModel model) { Processor[] processors = model.getProcessors(); for (int i = 0; i < processors.length; i++) { // Create a new node for the factory corresponding to this processor String tagName = ProcessorHelper.getTagNameForClassName(processors[i].getClass().getName()); XMLHandler xh = ProcessorHelper.getXMLHandlerForTagName(tagName); logger.info(tagName + ":" + processors[i].getName()); if (xh != null) { ProcessorFactory pf = xh.getFactory(xh.elementForProcessor(processors[i])); pf.setName(processors[i].getName()); if (processors[i].getDescription().equals("") == false) { pf.setDescription(processors[i].getDescription()); } else { if (processors[i] instanceof WorkflowProcessor) { // Nested workflow with no description, explicitly set // it to say // this otherwise a 'fetch descriptions' will attempt to // load it // in online mode, this could well fail. pf.setDescription("<font color=\"red\">No description supplied for nested workflow</font>"); } } add(new DefaultMutableTreeNode(pf)); } } } }
public Object valueForCellChanged(Object cell, Object newValue) { if (cell instanceof Processor) { Processor processor = (Processor) cell; processor.setName(newValue.toString()); return processor.getName(); } if (cell instanceof Port) { Port port = (Port) cell; if (isPortOnWorkflowEdge(port)) { for (Port p : port.getProcessor().getPorts()) { //prevent renaming if a port already has that name if (p.getName().equals(newValue.toString())) { return port.getName(); } } port.setName(newValue.toString()); return port.getName(); } } return null; } }
public EnactorStatusTableModel(ScuflModel scufl) { this.scuflModel = scufl; // One row for each processor. Processor[] processors = scuflModel.getProcessors(); rows = processors.length; data = new Object[rows][columnNames.length]; // Put appropriate content in the rows for (int i = 0; i < rows; i++) { Processor p = processors[i]; // do the icon data[i][0] = org.embl.ebi.escience.scuflworkers.ProcessorHelper .getPreferredIcon(p); // do the name data[i][1] = p.getName(); // do status data[i][2] = "No data"; // do start time data[i][3] = "--"; // do end time data[i][4] = "--"; // do the breakpoint if (p.hasBreakpoint()) data[i][5] = TavernaIcons.tickIcon; else data[i][5] = TavernaIcons.nullIcon; } }
public void mouseClicked(MouseEvent e) { final Processor theProcessor = getPointedProcessor(e.getX(), e .getY(), processorTable); if (theProcessor != null) { if (!theProcessor.hasBreakpoint()) { theProcessor.addBreakpoint(); try { statusTableModel.update(getStatusText()); } catch (InvalidStatusReportException isre) { } processorTable.repaint(); workflowInstance.pause(theProcessor.getName()); } else { theProcessor.rmvBreakpoint(); try { statusTableModel.update(getStatusText()); } catch (InvalidStatusReportException isre) { } processorTable.repaint(); workflowInstance.resume(theProcessor.getName()); } } }
@Test public void testBeanshellActivityTranslator() throws Exception { ScuflModel model = loadScufl("beanshell.xml"); Processor p = model.getProcessorsOfType(BeanshellProcessor.class)[0]; assertEquals("beanshell", p.getName()); ActivityTranslator<?> translator = ActivityTranslatorFactory .getTranslator(p); Activity<?> s = translator.doTranslation(p); assertEquals("net.sf.taverna.t2.activities.beanshell.BeanshellActivity", s.getClass().getName()); }
@Test public void testBeanshellActivityTranslator() throws Exception { ScuflModel model = loadScufl("beanshell.xml"); Processor p = model.getProcessorsOfType(BeanshellProcessor.class)[0]; assertEquals("beanshell", p.getName()); ActivityTranslator<?> translator = ActivityTranslatorFactory .getTranslator(p); Activity<?> s = translator.doTranslation(p); assertEquals("net.sf.taverna.t2.activities.beanshell.BeanshellActivity", s.getClass().getName()); }
@Test public void testBeanshellActivityTranslator() throws Exception { setUpRavenRepository(); ScuflModel model = loadScufl("beanshell.xml"); Processor p = model.getProcessorsOfType(BeanshellProcessor.class)[0]; assertEquals("beanshell", p.getName()); ActivityTranslator<?> translator = ActivityTranslatorFactory .getTranslator(p); Activity<?> s = translator.doTranslation(p); assertEquals("net.sf.taverna.t2.activities.beanshell.BeanshellActivity", s.getClass().getName()); }
if (!t1InputPort.isBound() && t1InputPort.getDefaultValue() != null) { String processorName = t1Processor.getName() + "_" + sanitiseName(t1InputPort.getName()) + "_defaultValue";