Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/src/org/labkey/api/workflow/WorkflowService.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ static WorkflowService get()
boolean actionWillAddSamples(Long actionId);
boolean actionWillAddSources(Long actionId);

boolean isTaskAssayType(Long taskId, Long assayId);

DataIteratorBuilder getSampleCreationDataIteratorBuilder(DataIteratorBuilder data, Container container, User user);

DataIteratorBuilder getSourceCreationDataIteratorBuilder(DataIteratorBuilder data, Container container, User user);
Expand Down
8 changes: 8 additions & 0 deletions assay/src/org/labkey/assay/actions/ImportRunApiAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ public ApiResponse execute(ImportRunApiForm form, BindException errors) throws E
auditDetailsJsonStr = form.getAuditDetails();
}

if (workflowTaskId != null)
{
WorkflowService workService = WorkflowService.get();

if (workService != null && protocol != null && !workService.isTaskAssayType(workflowTaskId, protocol.getRowId()))
throw new ExperimentException("Invalid job task id " + workflowTaskId + ". Either the task does not exist or does not reference this assay type.");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so we weren't even validating that the workflowTaskId was an existing task before? Nice to get both of those validations here in one place.

}

if (reImportOption == null)
{
if (provider != null && protocol != null && provider.isPlateMetadataEnabled(protocol))
Expand Down