Skip to content

Commit 522af08

Browse files
committed
Merge pull request #126 from SeqWare/feature/migration_input_files_weird_status
Fix up the workflow population plugin for weird statuses and also give S... Former-commit-id: 935bdc1
2 parents 7477086 + 4730bfb commit 522af08

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

seqware-meta-db/1.0.4_to_1.0.5.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
update workflow_run set status='failed' where status = 'unknown';
2+
update workflow_run set status='failed' where status IS NULL;

seqware-pipeline/src/main/java/net/sourceforge/seqware/pipeline/plugins/WorkflowRunFilesInitialPopulationPlugin.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,12 @@ public List<int[]> handle(ResultSet rs) throws SQLException {
224224
*/
225225
private List<Integer> getListOfFiles(int workflowRunAcc) {
226226
Map<String, String> map = generateWorkflowRunMap(workflowRunAcc);
227-
List<Integer> indices = new ArrayList<Integer>();
227+
List<Integer> ranOnList = new ArrayList<Integer>();
228+
if (map.isEmpty()){
229+
return ranOnList;
230+
}
228231
String ranOnString = map.get("Immediate Input File SWIDs");
229232
String[] ranOnArr = ranOnString.split(",");
230-
List<Integer> ranOnList = new ArrayList<Integer>();
231233
if (ranOnString.isEmpty()) {
232234
return ranOnList;
233235
}
@@ -250,10 +252,13 @@ protected boolean reportLaunch() {
250252

251253
private Map<String, String> generateWorkflowRunMap(int workflowRunAcc) {
252254
String report = metadata.getWorkflowRunReport(workflowRunAcc);
255+
Map<String, String> map = new TreeMap<String, String>();
256+
if (report == null){
257+
return map;
258+
}
253259
String[] lines = report.split("\n");
254260
String[] reportHeader = lines[0].split("\t");
255261
String[] data = lines[1].split("\t");
256-
Map<String, String> map = new TreeMap<String, String>();
257262
for (int i = 0; i < reportHeader.length; i++) {
258263
map.put(reportHeader[i].trim(), data[i].trim());
259264
}

0 commit comments

Comments
 (0)