Skip to content

Commit

Permalink
analysis: execute any workflow version, #TASK-6445
Browse files Browse the repository at this point in the history
  • Loading branch information
pfurio committed Sep 19, 2024
1 parent 49ec23e commit d1d2551
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.StopWatch;
import org.opencb.commons.datastore.core.ObjectMap;
import org.opencb.commons.datastore.core.Query;
import org.opencb.commons.datastore.core.QueryOptions;
import org.opencb.commons.utils.DockerUtils;
import org.opencb.opencga.analysis.tools.OpenCgaToolScopeStudy;
import org.opencb.opencga.analysis.utils.InputFileUtils;
import org.opencb.opencga.catalog.db.api.WorkflowDBAdaptor;
import org.opencb.opencga.core.common.JacksonUtils;
import org.opencb.opencga.core.common.TimeUtils;
import org.opencb.opencga.core.common.UserProcessUtils;
Expand Down Expand Up @@ -70,7 +72,14 @@ protected void check() throws Exception {
throw new IllegalArgumentException("Missing Nextflow ID");
}

OpenCGAResult<Workflow> result = catalogManager.getWorkflowManager().get(study, nextflowParams.getId(), QueryOptions.empty(), token);
OpenCGAResult<Workflow> result;
if (nextflowParams.getVersion() != null) {
Query query = new Query(WorkflowDBAdaptor.QueryParams.VERSION.key(), nextflowParams.getVersion());
result = catalogManager.getWorkflowManager().get(study, Collections.singletonList(nextflowParams.getId()), query,
QueryOptions.empty(), false, token);
} else {
result = catalogManager.getWorkflowManager().get(study, nextflowParams.getId(), QueryOptions.empty(), token);
}
if (result.getNumResults() == 0) {
throw new ToolException("Workflow '" + nextflowParams.getId() + "' not found");
}
Expand Down Expand Up @@ -169,7 +178,7 @@ protected void run() throws Exception {
// And give ownership permissions to the user running this process
stringBuilder.append("; chown -R ")
.append(UserProcessUtils.getUserUid()).append(":").append(UserProcessUtils.getGroupId()).append(" ").append(outputDir)
.append("\"");
.append("\"");

startTraceFileMonitor();

Expand Down

0 comments on commit d1d2551

Please sign in to comment.