/** * Instantiate the WorkflowLauncher with a direct reference to the * ScuflModel to be executed. * * @param model * a {@link ScuflModel} */ public WorkflowLauncher(ScuflModel model) { initialise(); this.model = model; }
/** * Allows a workflow to be executed stand-alone. Usage: <workflowURL> [<inputName> * <inputDataURL>] ... * * @param args * @throws MalformedURLException */ @SuppressWarnings( { "deprecation", "static-access" }) public static void main(String args[]) throws MalformedURLException { new WorkflowLauncher(args); }
initialise(); File inputDoc = new File(line.getOptionValue("inputdoc")); try { inputs = loadInputDoc(inputDoc); } catch (JDOMException e) { System.err.println("Could not parse input document " + inputDoc try { URL inputURL = new URL(here, inputParams[i + 1]); inputs.put(inputName, loadDataThing(inputURL)); } catch (IndexOutOfBoundsException e) { System.err.println("Missing input filename for input " WorkflowLauncher launcher; try { launcher = new WorkflowLauncher(workflowURL); } catch (IOException e) { System.err.println("Could not read workflow " + workflowURL + ": " outputs = launcher.execute(inputs); } catch (InvalidInputException e) { System.err.println("Invalid inputs for workflow " + workflowURL String report = launcher.getProgressReportXML(); try { FileUtils.writeStringToFile(reportName, report, "utf8"); saveOutputs(outputs, outputDir);
static public void executeWorkflow(InputStream scufl, Map inputs, UserContext userContext, WorkflowEventListener[] listeners) throws Exception { setStupidLSIDProvider(); WorkflowLauncher launcher = new WorkflowLauncher(scufl, userContext); launcher.execute(inputs, listeners); scufl.close(); }
try { if (updater != null) { outputs = launcher.execute(inputs, updater.workflowEventListener); } else { outputs = launcher.execute(inputs); job.setReport(launcher.getProgressReportXML()); } catch (NotSuccessException e) { logger.warn("Could not set progress report for " + job, e);
/** * Executes the workflow with the provided inputs (which is a Map of * DataThings) and <code>userContext</code>. Returns the outputs of the * workflow (which is also a Map of DataThings). An array of * workflowEventListeners can be provided to allow handling of events as the * workflow is executed. * * @param inputs * @param workflowEventListeners * @return * @throws WorkflowSubmissionException * @throws InvalidInputException * @see org.embl.ebi.escience.baclava.DataThing * @see org.embl.ebi.escience.scufl.enactor.WorkflowEventListener */ public Map<String, DataThing> execute(Map<String, DataThing> inputs, WorkflowEventListener[] workflowEventListeners) throws WorkflowSubmissionException, InvalidInputException { initialise(); for (int i = 0; i < workflowEventListeners.length; i++) { WorkflowEventDispatcher.DISPATCHER .addListener(workflowEventListeners[i]); } return execute(inputs); }
/** * Executes the workflow with the provided inputs (which is a Map of * DataThings) and <code>userContext</code>. Returns the outputs of the * workflow (which is also a Map of DataThings). A workflowEventListener can * be provided to allow handling of events as the workflow is executed. * * @param inputs * @param workflowEventListener * @return * @throws WorkflowSubmissionException * @throws InvalidInputException * @see org.embl.ebi.escience.baclava.DataThing * @see org.embl.ebi.escience.scufl.enactor.WorkflowEventListener */ public Map<String, DataThing> execute(Map<String, DataThing> inputs, WorkflowEventListener workflowEventListener) throws WorkflowSubmissionException, InvalidInputException { WorkflowEventDispatcher.DISPATCHER.addListener(workflowEventListener); return execute(inputs); }
private void initialise(){ initialiseSPIRegistry(); initialisePluginManager(); }
/** * Set <code>userContext</code> and instantiate the WorkflowLauncher, * constructing an instance of the ScuflModel from the XML provided by the * given input stream. * * @param xmlStream * @param userContext * a {@link UserContext} * @throws ProcessorCreationException * @throws DataConstraintCreationException * @throws UnknownProcessorException * @throws UnknownPortException * @throws DuplicateProcessorNameException * @throws MalformedNameException * @throws ConcurrencyConstraintCreationException * @throws DuplicateConcurrencyConstraintNameException * @throws XScuflFormatException */ public WorkflowLauncher(InputStream xmlStream, UserContext userContext) throws ProcessorCreationException, DataConstraintCreationException, UnknownProcessorException, UnknownPortException, DuplicateProcessorNameException, MalformedNameException, ConcurrencyConstraintCreationException, DuplicateConcurrencyConstraintNameException, XScuflFormatException { initialise(); model = openWorkflowModel(xmlStream); this.userContext = userContext; }
boolean[] array = (boolean[]) list; for (int i = 0; i < array.length; i++) { newList.add(asObject(array[i])); newList.add(asObject(array[i])); newList.add(asObject(array[i])); newList.add(asObject(array[i])); newList.add(asObject(array[i])); newList.add(asObject(array[i])); newList.add(asObject(array[i])); newList.add(asObject(array[i])); Object obj = it.next(); if (obj instanceof Collection || obj.getClass().isArray()) { obj = asObjectList(obj);
return Lang.map("rexpToJava", vec, this); } else {
public ProvenanceGenerator executeWorkflow(InputStream scufl, Map inputs, UserContext userContext) throws Exception { setStupidLSIDProvider(); provenanceGenerator = ProvenanceGenerator.getInstance(); provenanceGenerator.setConfiguration(configuration); provenanceGenerator.initialise(); WorkflowLauncher launcher = new WorkflowLauncher(scufl, userContext); // Map outputs = launcher.execute(inputs, provenanceGenerator); scufl.close(); return provenanceGenerator; }
WorkflowLauncher launcher = new WorkflowLauncher(inStream); return launcher;
/** * Instantiate the WorkflowLauncher with a direct reference to the * ScuflModel to be executed, together with a UserContext for the user * executing this model. * * @param model * a {@link ScuflModel} * @param userContext * a {@link UserContext} */ public WorkflowLauncher(ScuflModel model, UserContext userContext) { initialise(); this.model = model; this.userContext = userContext; }
public static void main(String[] args) throws LogBookException { WorkflowEnactorHelper.setMygridLSIDProvider(); Properties configuration = ProvenanceConfigurator.getConfiguration(); for (int j = 0; j < DIRECTORIES.length; j++) { File workflowsDirectory = new File("workbench/examples/" + DIRECTORIES[j]); File[] workflows = workflowsDirectory.listFiles(); for (int i = 0; i < workflows.length; i++) { try { File workflow = workflows[i]; if (!workflow.isDirectory() && workflow.getName().endsWith(".xml")) { System.out.println("Running " + workflow); InputStream scufl = workflow.toURL().openStream(); OldProvenanceGenerator provenanceGenerator = new OldProvenanceGenerator( configuration); WorkflowLauncher launcher = new WorkflowLauncher(scufl, null); launcher.execute(new HashMap(), provenanceGenerator); scufl.close(); } } catch (Exception e) { e.printStackTrace(); } } } System.exit(0); }