public UpdateDataflowNameEdit(Dataflow dataflow,String newName) { super(dataflow); this.newName=newName; this.oldName=dataflow.getLocalName(); }
public UpdateDataflowNameEdit(Dataflow dataflow,String newName) { super(dataflow); this.newName=newName; this.oldName=dataflow.getLocalName(); }
public MonitorResultListener(String context) { if ("".equals(context)) { this.context = graphController.getDataflow().getLocalName(); } else { this.context = context; } }
@Override public String getViewTitle() { return "Workflow " + limitName(dataflow.getLocalName()); }
/** * Generates a graph model of a dataflow. * * @return */ public Graph generateGraph() { dataflowToGraph.clear(); ports.clear(); inputControls.clear(); outputControls.clear(); nestedDataflowPorts.clear(); dataflowToActivityPort.clear(); graphElementMap.clear(); portToActivity.clear(); return generateGraph(dataflow, "", dataflow.getLocalName(), 0); }
private String determineFileName(final Dataflow dataflow) { String result; Object source = fileManager.getDataflowSource(dataflow); String fileName = null; if (source instanceof File) { fileName = ((File) source).getName(); } else if (source instanceof URL) { fileName = ((URL) source).getPath(); } if (fileName != null) { int lastIndex = fileName.lastIndexOf("."); if (lastIndex > 0) { fileName = fileName.substring(0, fileName.lastIndexOf(".")); } result = fileName; } else { result = dataflow.getLocalName(); } return result; }
public static String getRelativeName(Dataflow df, Activity activity) { String result = ""; if (df != null) { result += df.getLocalName(); Processor p = findProcessor(df, activity); if (p != null) { result += (":" + p.getLocalName()); } } return result; }
@Override protected String getRawTableRowsHtml() { return ("<tr><td colspan=2>" + getActivity().getConfiguration().getLocalName() + "</td></tr>"); }
@Override public void actionPerformed(ActionEvent event) { Dataflow d = FileManager.getInstance().getCurrentDataflow(); try { Version.ID ident = getNewComponentIdentification(d.getLocalName()); if (ident == null) return; saveWorkflowAsComponent(d, ident); } catch (Exception e) { JOptionPane.showMessageDialog(null, e.getCause().getMessage(), "Component creation failure", JOptionPane.ERROR_MESSAGE); logger.error("failed to save workflow as component", e); } }
@Override protected String getRawTableRowsHtml() { return ("<tr><td colspan=2>" + getActivity().getConfiguration().getLocalName() + "</td></tr>"); }
source = getDataflowSource(dataflow); String name = dataflow.getLocalName(); // Fallback if (source == null) { return name;
public String processWorkflowStructure(Dataflow df) { topLevelDataflowName = df.getLocalName(); topLevelDataflowID = df.getIdentifier(); // check whether we already have this WF in the DB List<String> workflowIds = null; try { workflowIds = pq.getAllworkflowIds(); } catch (SQLException e) { logger.warn("Problem processing workflow structure", e); } if (workflowIds != null && workflowIds.contains(topLevelDataflowID)) { // already in the DB } else { logger.info("new workflow structure with ID "+topLevelDataflowID); ProvenanceProcessor provProc = new ProvenanceProcessor(); provProc.setIdentifier(UUID.randomUUID().toString()); provProc.setProcessorName(topLevelDataflowName); provProc.setFirstActivityClassName(ProvenanceProcessor.DATAFLOW_ACTIVITY); provProc.setWorkflowId(topLevelDataflowID); provProc.setTopLevelProcessor(true); // record the top level dataflow as a processor in the DB try { pw.addProcessor(provProc); // pw.addProcessor(topLevelDataflowName, DATAFLOW_PROCESSOR_TYPE, topLevelDataflowID, true); // true -> is top level } catch (SQLException e) { logger.warn("Can't add processor " + topLevelDataflowID, e); } } // logger.info("top level wf name: "+topLevelDataflowName); return processDataflowStructure(df, topLevelDataflowID, df.getLocalName()); // null: no external name given to top level dataflow }
name.setText(df.getLocalName()); result.addContent(name);
name.setText(df.getLocalName()); result.addContent(name);
/** * Receive an input event, relay it through the internal output port to all * connected entities */ public void receiveEvent(WorkflowDataToken t) { WorkflowDataToken transformedToken = t.pushOwningProcess(dataflow.getLocalName()); // I'd rather avoid casting to the implementation but in this // case we're in the same package - the only reason to do this // is to allow dummy implementations of parts of this // infrastructure during testing, in 'real' use this should // always be a dataflowimpl if (dataflow instanceof DataflowImpl) { ((DataflowImpl) dataflow).tokenReceived(transformedToken .getOwningProcess(), t.getContext()); } for (Datalink dl : internalOutput.getOutgoingLinks()) { dl.getSink().receiveEvent(transformedToken); } }
/** * Receive an input event, relay it through the internal output port to all * connected entities */ public void receiveEvent(WorkflowDataToken t) { WorkflowDataToken transformedToken = t.pushOwningProcess(dataflow.getLocalName()); // I'd rather avoid casting to the implementation but in this // case we're in the same package - the only reason to do this // is to allow dummy implementations of parts of this // infrastructure during testing, in 'real' use this should // always be a dataflowimpl if (dataflow instanceof DataflowImpl) { ((DataflowImpl) dataflow).tokenReceived(transformedToken .getOwningProcess(), t.getContext()); } for (Datalink dl : internalOutput.getOutgoingLinks()) { dl.getSink().receiveEvent(transformedToken); } }
public static Version.ID createInitialComponent(Dataflow d, Version.ID ident) throws RegistryException { try { fm.saveDataflow(d, ComponentFileType.instance, ident, false); Edit<?> dummyEdit = edits.getUpdateDataflowNameEdit(d, d.getLocalName()); em.doDataflowEdit(d, dummyEdit); } catch (OverwriteException e) { throw new RegistryException(e); } catch (SaveException e) { throw new RegistryException(e); } catch (IllegalStateException e) { throw new RegistryException(e); } catch (EditException e) { throw new RegistryException(e); } return ident; }
/** * Receive an input event, relay it through the internal output port to all * connected entities */ public void receiveEvent(WorkflowDataToken t) { WorkflowDataToken transformedToken = t.pushOwningProcess(dataflow.getLocalName()); // I'd rather avoid casting to the implementation but in this // case we're in the same package - the only reason to do this // is to allow dummy implementations of parts of this // infrastructure during testing, in 'real' use this should // always be a dataflowimpl if (dataflow instanceof DataflowImpl) { ((DataflowImpl) dataflow).tokenReceived(transformedToken .getOwningProcess(), t.getContext()); } for (Datalink dl : internalOutput.getOutgoingLinks()) { dl.getSink().receiveEvent(transformedToken); } }
/** * Adds the selected dataflow to the currently opened one. Create a * processor with the same name as the nested dataflow (ie. the one just * opened). Add the configured dataflow activity to this processor. Then use * the {@link EditManager} to add the processor to the main dataflow so that * any GUI updates are forced * * @param dataflow */ private void addSelectedDataflowToCurrentDataflow(Dataflow dataflow) { createProcessor = EditsRegistry.getEdits().createProcessor( dataflow.getLocalName()); try { EditsRegistry.getEdits().getAddActivityEdit(createProcessor, dataflowActivity).doEdit(); EditManager.getInstance().doDataflowEdit( (Dataflow) ModelMap.getInstance().getModel( ModelMapConstants.CURRENT_DATAFLOW), EditsRegistry.getEdits() .getMapProcessorPortsForActivityEdit( createProcessor)); } catch (EditException e) { logger.error("Could not add nested workflow", e); } }
/** * Adds the selected dataflow to the currently opened one. Create a * processor with the same name as the nested dataflow (ie. the one just * opened). Add the configured dataflow activity to this processor. Then use * the {@link EditManager} to add the processor to the main dataflow so that * any GUI updates are forced * * @param dataflow */ private void addSelectedDataflowToCurrentDataflow(Dataflow dataflow) { createProcessor = EditsRegistry.getEdits().createProcessor( dataflow.getLocalName()); try { EditsRegistry.getEdits().getAddActivityEdit(createProcessor, dataflowActivity).doEdit(); EditManager.getInstance().doDataflowEdit( (Dataflow) ModelMap.getInstance().getModel( ModelMapConstants.CURRENT_DATAFLOW), EditsRegistry.getEdits() .getMapProcessorPortsForActivityEdit( createProcessor)); } catch (EditException e) { // TODO Auto-generated catch block e.printStackTrace(); } }