use of ca.corefacility.bioinformatics.irida.exceptions.IridaWorkflowDefaultException in project irida by phac-nml.
the class IridaWorkflowsService method setDefaultWorkflow.
/**
* Sets the given workflow as a default workflow for it's analysis type.
*
* @param workflowId
* The workflow id to set as default.
* @throws IridaWorkflowNotFoundException
* If the given workflow cannot be found.
* @throws IridaWorkflowDefaultException
* If the corresponding workflow type already has a default
* workflow set.
*/
public void setDefaultWorkflow(UUID workflowId) throws IridaWorkflowNotFoundException, IridaWorkflowDefaultException {
checkNotNull(workflowId, "workflowId is null");
IridaWorkflow iridaWorkflow = getIridaWorkflow(workflowId);
AnalysisType analysisType = iridaWorkflow.getWorkflowDescription().getAnalysisType();
if (defaultWorkflowForAnalysis.containsKey(analysisType)) {
throw new IridaWorkflowDefaultException("Cannot set workflow " + workflowId + " as default, already exists default workflow for \"" + analysisType + "\"");
} else {
defaultWorkflowForAnalysis.put(analysisType, workflowId);
}
}
Aggregations