Search in sources :

Example 1 with IridaWorkflowIdSet

use of ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowIdSet in project irida by phac-nml.

the class IridaWorkflowsServiceIT method setup.

@Before
public void setup() throws IOException, URISyntaxException, IridaWorkflowException {
    Path workflowVersion1DirectoryPath = Paths.get(TestAnalysis.class.getResource("workflows/TestAnalysis/1.0").toURI());
    Path workflowVersion2DirectoryPath = Paths.get(TestAnalysis.class.getResource("workflows/TestAnalysis/2.0").toURI());
    Path workflowPhylogenomicsDirectoryPath = Paths.get(TestAnalysis.class.getResource("workflows/AnalysisPhylogenomicsPipeline/0.1").toURI());
    iridaWorkflowsService = new IridaWorkflowsService(new IridaWorkflowSet(Sets.newHashSet()), new IridaWorkflowIdSet(Sets.newHashSet()));
    testWorkflow1v1 = iridaWorkflowLoaderService.loadIridaWorkflowFromDirectory(workflowVersion1DirectoryPath);
    testWorkflow1v2 = iridaWorkflowLoaderService.loadIridaWorkflowFromDirectory(workflowVersion2DirectoryPath);
    testWorkflowPhylogenomics = iridaWorkflowLoaderService.loadIridaWorkflowFromDirectory(workflowPhylogenomicsDirectoryPath);
}
Also used : Path(java.nio.file.Path) IridaWorkflowSet(ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowSet) IridaWorkflowsService(ca.corefacility.bioinformatics.irida.service.workflow.IridaWorkflowsService) IridaWorkflowIdSet(ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowIdSet) Before(org.junit.Before)

Example 2 with IridaWorkflowIdSet

use of ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowIdSet in project irida by phac-nml.

the class IridaWorkflowsConfig method defaultIridaWorkflows.

/**
 * A set of workflow ids to use as defaults.
 *
 * @return A set of workflow ids to use as defaults.
 */
@Bean
public IridaWorkflowIdSet defaultIridaWorkflows() {
    Set<UUID> defaultWorkflowIds = Sets.newHashSet();
    for (AnalysisType analysisType : AnalysisType.values()) {
        String analysisDefaultProperyName = IRIDA_DEFAULT_WORKFLOW_PREFIX + "." + analysisType;
        logger.trace("Getting default workflow id from property '" + analysisDefaultProperyName + "'");
        String analysisDefaultId = environment.getProperty(analysisDefaultProperyName);
        if (analysisDefaultId == null) {
            logger.warn("No default workflow id associated with property '" + analysisDefaultProperyName + "'");
        } else {
            try {
                UUID id = UUID.fromString(analysisDefaultId);
                logger.debug("Adding default workflow " + analysisDefaultProperyName + "=" + analysisDefaultId);
                defaultWorkflowIds.add(id);
            } catch (IllegalArgumentException e) {
                logger.error("Default workflow id for " + analysisDefaultProperyName + "=" + analysisDefaultId + " is not a valid workflow id");
            }
        }
    }
    return new IridaWorkflowIdSet(defaultWorkflowIds);
}
Also used : AnalysisType(ca.corefacility.bioinformatics.irida.model.enums.AnalysisType) UUID(java.util.UUID) IridaWorkflowIdSet(ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowIdSet) Bean(org.springframework.context.annotation.Bean)

Example 3 with IridaWorkflowIdSet

use of ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowIdSet in project irida by phac-nml.

the class IridaWorkflowsServiceTest method setup.

@Before
public void setup() throws IridaWorkflowException {
    iridaWorkflow = IridaWorkflowTestBuilder.buildTestWorkflow(iridaWorkflowId, IridaWorkflowTestBuilder.Input.SINGLE, "reference");
    iridaWorkflow2 = IridaWorkflowTestBuilder.buildTestWorkflow(iridaWorkflowId2, IridaWorkflowTestBuilder.Input.SINGLE, "reference");
    iridaWorkflow3 = IridaWorkflowTestBuilder.buildTestWorkflow(iridaWorkflowId3, IridaWorkflowTestBuilder.Input.SINGLE, "reference");
    iridaWorkflowSet = new IridaWorkflowSet(Sets.newHashSet(iridaWorkflow, iridaWorkflow2));
    defaultIridaWorkflowIdSet = new IridaWorkflowIdSet(Sets.newHashSet());
    iridaWorkflowsService = new IridaWorkflowsService(iridaWorkflowSet, defaultIridaWorkflowIdSet);
}
Also used : IridaWorkflowSet(ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowSet) IridaWorkflowsService(ca.corefacility.bioinformatics.irida.service.workflow.IridaWorkflowsService) IridaWorkflowIdSet(ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowIdSet) Before(org.junit.Before)

Aggregations

IridaWorkflowIdSet (ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowIdSet)3 IridaWorkflowSet (ca.corefacility.bioinformatics.irida.model.workflow.config.IridaWorkflowSet)2 IridaWorkflowsService (ca.corefacility.bioinformatics.irida.service.workflow.IridaWorkflowsService)2 Before (org.junit.Before)2 AnalysisType (ca.corefacility.bioinformatics.irida.model.enums.AnalysisType)1 Path (java.nio.file.Path)1 UUID (java.util.UUID)1 Bean (org.springframework.context.annotation.Bean)1