public boolean isSelected() { return model.isOffline(); }
/** * Construct a new processor with a blank internal workflow */ public WorkflowProcessor(ScuflModel model, String name) throws ProcessorCreationException, DuplicateProcessorNameException { super(model, name); theInternalModel = new ScuflModel(); try { if (model != null) { theInternalModel.setOffline(model.isOffline()); } } catch (SetOnlineException soe) { // } }
/** * Construct a new processor with the given model to bind to, name and URL * of a workflow description to contain. */ public WorkflowProcessor(ScuflModel model, String name, String definitionURL) throws ProcessorCreationException, DuplicateProcessorNameException { super(model, name); this.definitionURL = definitionURL; try { // Create a new model instance theInternalModel = new ScuflModel(); try { theInternalModel.setOffline(model.isOffline()); } catch (SetOnlineException soe) { // } // Populate from the definition URL XScuflParser.populate(new URL(definitionURL).openStream(), theInternalModel, null); buildPorts(); } catch (MalformedURLException mue) { throw new ProcessorCreationException("The supplied definition URL was malformed, specified as '" + definitionURL + "'"); } catch (Exception e) { e.printStackTrace(); throw new ProcessorCreationException("The workflow processor '" + name + "' caused an exception :\n" + e.getMessage() + "\n during creation. The exception had type :\n" + e.getClass().toString()); } }
public void actionPerformed(ActionEvent ae) { try { int numberOfAlternates = theProcessor.getAlternatesArray().length; Processor alternateProcessor = pf.createProcessor("alternate" + (numberOfAlternates + 1), null); AlternateProcessor alternate = new AlternateProcessor(alternateProcessor); theProcessor.addAlternate(alternate); if (theProcessor.getModel() != null) { boolean isOffline = theProcessor.getModel().isOffline(); if (isOffline) { alternateProcessor.setOffline(); } else { alternateProcessor.setOnline(); } } // Set the appropriate offline / // online status } catch (Exception ex) { ex.printStackTrace(); JOptionPane.showMessageDialog(null, "Problem creating alternate : \n" + ex.getMessage(), "Exception!", JOptionPane.ERROR_MESSAGE); } }
/** * Construct a new processor from the supplied JDOM element, this element * being the 'scufl' top level workflow element from an inline nested * workflow declaration */ public WorkflowProcessor(ScuflModel model, String name, Element scuflElement) throws ProcessorCreationException, DuplicateProcessorNameException { super(model, name); // Have to clone the element because it already has a parent // so will not work with a new document instance try { Document doc = new Document((Element) scuflElement.clone()); theInternalModel = new ScuflModel(); try { if (model != null) { theInternalModel.setOffline(model.isOffline()); } } catch (SetOnlineException soe) { // } XScuflParser.populate(doc, theInternalModel, null); setDescription(theInternalModel.getDescription().getText()); buildPorts(); } catch (Exception e) { throw new ProcessorCreationException("The workflow processor '" + name + "' caused an exception :\n" + e.getMessage() + "\n during creation. The exception had type :\n" + e.getClass().toString()); } }