Skip to content

Commit f5ed491

Browse files
committed
Pass kinshipValidation setting through job XML
1 parent 7f2c987 commit f5ed491

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ehr/src/org/labkey/ehr/pipeline/GeneticCalculationsImportTask.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import org.labkey.api.pipeline.AbstractTaskFactorySettings;
4141
import org.labkey.api.pipeline.PipelineJob;
4242
import org.labkey.api.pipeline.PipelineJobException;
43+
import org.labkey.api.pipeline.PipelineJobService;
4344
import org.labkey.api.pipeline.RecordedAction;
4445
import org.labkey.api.pipeline.RecordedActionSet;
4546
import org.labkey.api.pipeline.file.FileAnalysisJobSupport;
@@ -153,7 +154,9 @@ public RecordedActionSet run() throws PipelineJobException
153154
processInbreeding(job.getContainer(), job.getUser(), support.getAnalysisDirectoryPath().toFile(), job.getLogger());
154155
processKinship(job.getContainer(), job.getUser(), support.getAnalysisDirectoryPath().toFile(), job.getLogger());
155156

156-
if (GeneticCalculationsJob.isKinshipValidation())
157+
// NOTE: pass this through XML in case the job runs on a remote server:
158+
boolean kinshipValidation = Boolean.parseBoolean(getJob().getParameters().getOrDefault("kinshipValidation", "false"));
159+
if (kinshipValidation)
157160
{
158161
validateKinship();
159162
}
@@ -521,6 +524,11 @@ private boolean validateKinship()
521524
PipelineJob job = getJob();
522525
job.getLogger().info("Validate kinship");
523526

527+
if (PipelineJobService.get().getLocationType() != PipelineJobService.LocationType.WebServer)
528+
{
529+
throw new IllegalStateException("Kinship validation must be run on the webserver. This task is set to execute on: " + PipelineJobService.get().getLocationType());
530+
}
531+
524532
UserSchema ehrSchema = QueryService.get().getUserSchema(job.getUser(), job.getContainer(), "ehr");
525533
if (ehrSchema == null)
526534
{

ehr/src/org/labkey/ehr/pipeline/GeneticCalculationsRunnable.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ private void startCalculation(User u, Container c, boolean allowRunningDuringDay
8686
String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
8787
"<bioml>\n" +
8888
"\t<note label=\"allowRunningDuringDay\" type=\"input\">" + allowRunningDuringDay + "</note>" +
89+
"\t<note label=\"kinshipValidation\" type=\"input\">" + GeneticCalculationsJob.isKinshipValidation() + "</note>" +
8990
"</bioml>";
9091

9192
AbstractFileAnalysisProtocol<?> protocol = factory.createProtocolInstance(protocolName, "", xml);

0 commit comments

Comments
 (0)