if(currentWorkspace instanceof Workspace) { try { String workflowFile = ((Workspace)currentWorkspace).getWorkflowFile(workflowName); if(workflowFile != null) monitor.addFileChangeListener(this, workflowName, workflowFile, 5000); } catch(FileNotFoundException e) {  e.printStackTrace(); } }
  public void createGraph(String workflowName)  {    //Workspace currentWorkspace = manager.getCurrentWorkspace();    WorkflowFactory currentWorkspace = manager.getCurrentWorkspace();    Layout layout = (Layout)currentWorkspace.getLayout(workflowName);    WorkflowGraphModel model = new WorkflowGraphModel(layout);    model.setPalette(palette);    model.addGraphModelListener(this);    boolean hasLayout = layout != null;    if(layout == null) layout = new Layout();    WorkflowDescriptor descriptor;    try    {      descriptor = currentWorkspace.getWorkflow(workflowName, false);    }    catch(FactoryException e)    {      e.printStackTrace();      return;    }    WorkflowGraph graph = new WorkflowGraph(model, descriptor, layout, !hasLayout);    graph.addGraphSelectionListener(this);    //graph.setName(workflowName);    if(descriptor != null)      graph.setName(descriptor.getName());    else      graph.setName(workflowName);    graphTabs.addGraph(graph);    graphTabs.setVisible(true);  }