Skip to content

Commit 5b2f6dc

Browse files
committed
Merge pull request #282 from SeqWare/feature/fix_inmemory_workflow_params
Fix in memory workflow params (were not being stored properly)
2 parents 80ac3e5 + 163cf80 commit 5b2f6dc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

seqware-common/src/main/java/net/sourceforge/seqware/common/metadata/MetadataInMemory.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@
7070

7171
/**
7272
* This stores some metadata in memory as an exploration of running workflows without a running database or web service.
73-
*
73+
*
7474
* Data will only be stored while this VM is still active and cannot be accessed by other clients.
75-
*
75+
*
7676
* @author dyuen
7777
*/
7878
public class MetadataInMemory implements Metadata {
@@ -84,7 +84,7 @@ public class MetadataInMemory implements Metadata {
8484

8585
/**
8686
* Not really thread-safe, why does Guava not have a synchronized wrapper?
87-
*
87+
*
8888
* @return the store
8989
*/
9090
private static synchronized Table<Integer, Class, Object> getStore() {
@@ -323,7 +323,10 @@ public ReturnValue addWorkflow(String name, String version, String description,
323323
TreeSet<WorkflowParam> setOfDefaultParams = new TreeSet<>();
324324
for (Entry<String, Map<String, String>> e : hm.entrySet()) {
325325
WorkflowParam workflowParam = MetadataWS.convertMapToWorkflowParam(e.getValue(), workflow);
326+
int nextSwAccession = getNextSwAccession();
327+
workflowParam.setWorkflowParamId(nextSwAccession);
326328
setOfDefaultParams.add(workflowParam);
329+
MetadataInMemory.getStore().put(nextSwAccession, WorkflowParam.class, workflowParam);
327330
}
328331
workflow.setWorkflowParams(setOfDefaultParams);
329332
return returnValue;

0 commit comments

Comments
 (0)