/** * 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); }
/** * 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); }
outputs = launcher.execute(inputs); } catch (InvalidInputException e) { System.err.println("Invalid inputs for workflow " + workflowURL
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(); }
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); }
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; }