Skip to content

Commit

Permalink
Provide task ID in provenance file (#9)
Browse files Browse the repository at this point in the history
To facilitate a simplified access on the assigned task id of a dataset registration, the ID is now written into the provenance file.
  • Loading branch information
sven1103 authored May 15, 2024
1 parent f29d2ef commit 998704c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ Here is an example of the provenance file:
{
"origin": "/Users/myuser/registration",
"user": "/Users/myuser",
"measurementId": "QTEST001AE-1234512312",
"measurementId": "NGSQTEST001AE-1234512312",
"datasetFiles" : [ "file1_1.fastq.gz", "file1_2.fastq.gz" ],
"taskId": "74c5d26f-b756-42c3-b6f4-2b4825670a2d",
"history": [
"/opt/scanner-app/scanner-processing-dir/74c5d26f-b756-42c3-b6f4-2b4825670a2d"
]
Expand All @@ -146,6 +148,10 @@ Here is an example of the provenance file:
>
> `measurementId`: any valid QBiC measurement ID that has been found in the dataset (this might
> be `null`) in case the evaluation has not been done yet.
>
> `datasetFiles`: a list of relative file paths belonging to the dataset
>
> `taskId`: a unique task ID assigned by the application to track the dataset registration progress
>
> `history`: a list of history items, which steps have been performed. The list is ordered by first
> processing steps being at the start and the latest at the end.
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/life/qbic/data/processing/Provenance.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ public class Provenance {
@JsonProperty("datasetFiles")
public List<String> datasetFiles;

@JsonProperty("taskId")
public String taskId;

/**
* A list of ordered processing folder stops the dataset has traversed and passed successfully.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ private void writeProvenanceInformation(Path taskDir, Path newLocation,
provenance.history.add(newLocation.toString());
provenance.userWorkDirectoryPath = String.valueOf(request.userPath());
provenance.qbicMeasurementID = measurementId;
provenance.taskId = taskDir.toFile().getName();
provenance.addDatasetFiles(datasetFiles);
ObjectMapper mapper = new ObjectMapper();
mapper.writerWithDefaultPrettyPrinter()
Expand Down

0 comments on commit 998704c

Please sign in to comment.