/** * 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; }
/** * 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; }
/** * 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; }
/** * 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); }