@Override protected ScuflModel getModel() { return (ScuflModel)ModelMap.getInstance().getNamedModel(ModelMap.CURRENT_WORKFLOW); } }
@Override protected ScuflModel getModel() { return (ScuflModel)ModelMap.getInstance().getNamedModel(ModelMap.CURRENT_WORKFLOW); }
public void actionPerformed(ActionEvent e) { if (runningWorkflows.size()!=0) { JOptionPane.showMessageDialog(EnactorInvocation.this, "Sorry, unable to close whilst other workflows are running","Unable to close results",JOptionPane.OK_OPTION); } else { int r=JOptionPane.showConfirmDialog(EnactorInvocation.this, "Are you sure you wish to close this workflow run?","Close workflow run?",JOptionPane.YES_NO_OPTION); if (r==JOptionPane.YES_OPTION) { ModelMap.getInstance().setModel(workflowInstance.getID(), null); } } }
@Override protected void registerComponent(JComponent comp) { if (comp instanceof WorkflowModelViewSPI) { ScuflModel model = (ScuflModel) ModelMap.getInstance() .getNamedModel(ModelMap.CURRENT_WORKFLOW); if (model != null) { ((WorkflowModelViewSPI) comp).attachToModel(model); } } }
/** * Prompt for a file name, and then save the current workflow to the file. * * @return true if file was saved, or false if the action was cancelled * @throws FileNotFoundException * if the file exists but is a directory rather than a regular * file, does not exist but cannot be created, or cannot be * opened for any other reason * @throws SecurityException * if a security manager exists and its <code>checkWrite</code> * method denies write access to the file. */ public boolean saveToFile() throws FileNotFoundException, SecurityException { ScuflModel currentModel = (ScuflModel) ModelMap.getInstance() .getNamedModel(ModelMap.CURRENT_WORKFLOW); if (currentModel == null) { logger.warn("Can't save null model"); return false; } return saveToFile(parentComponent, currentModel); }
ModelMap.getInstance().setModel(ModelMap.CURRENT_WORKFLOW, model);
/** * Immediately execute workflow. Workflow is submitted to the enactor with the * given input values, and invocation is initiated. Switches to the * @link{EnactPerspective}. * * @param workflow Workflow to run * @param inputs Map of input values to run the workflow with * @throws */ public static void executeWorkflow(ScuflModel workflow, Map<String, DataThing> inputs) { EnactorProxy enactor = FreefluoEnactorProxy.getInstance(); WorkflowInstance instance; try { instance = enactor.compileWorkflow(workflow, inputs, EnactorInvocation.USERCONTEXT); } catch (WorkflowSubmissionException e) { logger.error("Could not compile workflow " + workflow, e); return; } logger.debug("Compiled workflow " + instance); ModelMap.getInstance().setModel(instance.getID(), instance); logger.info("Running the workflow " + instance); try { instance.run(); } catch (InvalidInputException e) { logger.warn("Could not run workflow " + instance, e); } }
if (ret == JOptionPane.YES_OPTION) { PerspectiveSPI p = (PerspectiveSPI) ModelMap.getInstance().getNamedModel( ModelMap.CURRENT_PERSPECTIVE); if (p != null) {