From 81424be9d19171a14685e7dad67c8f0794aa131c Mon Sep 17 00:00:00 2001 From: "michele.artini" Date: Fri, 5 May 2023 11:31:01 +0200 Subject: [PATCH] wf templates --- .../conf/RegisterWfConfigurationNode.java | 13 +- .../wf_templates/simple_repo_bye.json | 123 +++++++++ .../wf_templates/simple_repo_hi.json | 234 ++++++++++++++++++ 3 files changed, 368 insertions(+), 2 deletions(-) create mode 100644 libs/dnet-wf-service/src/main/resources/wf_templates/simple_repo_bye.json create mode 100644 libs/dnet-wf-service/src/main/resources/wf_templates/simple_repo_hi.json diff --git a/libs/dnet-wf-service/src/main/java/eu/dnetlib/manager/wf/nodes/conf/RegisterWfConfigurationNode.java b/libs/dnet-wf-service/src/main/java/eu/dnetlib/manager/wf/nodes/conf/RegisterWfConfigurationNode.java index 1f0305f4..9937a39b 100644 --- a/libs/dnet-wf-service/src/main/java/eu/dnetlib/manager/wf/nodes/conf/RegisterWfConfigurationNode.java +++ b/libs/dnet-wf-service/src/main/java/eu/dnetlib/manager/wf/nodes/conf/RegisterWfConfigurationNode.java @@ -1,6 +1,7 @@ package eu.dnetlib.manager.wf.nodes.conf; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import java.util.UUID; @@ -32,6 +33,12 @@ public class RegisterWfConfigurationNode extends AbstractJobNode { @WfInputParam private Api api; + @WfInputParam + private String nativeMdStoreId; + + @WfInputParam + private String cleanedMdStoreId; + @WfOutputParam private String wfConfId; @@ -72,8 +79,10 @@ public class RegisterWfConfigurationNode extends AbstractJobNode { } private Map prepareSystemParams() { - // TODO Auto-generated method stub - return null; + final Map map = new LinkedHashMap<>(); + map.put("nativeMdStoreId", nativeMdStoreId); + map.put("cleanedMdStoreId", cleanedMdStoreId); + return map; } private boolean verifyConfiguration() { diff --git a/libs/dnet-wf-service/src/main/resources/wf_templates/simple_repo_bye.json b/libs/dnet-wf-service/src/main/resources/wf_templates/simple_repo_bye.json new file mode 100644 index 00000000..9e8969e0 --- /dev/null +++ b/libs/dnet-wf-service/src/main/resources/wf_templates/simple_repo_bye.json @@ -0,0 +1,123 @@ +{ + "parameters":[ + { + "name":"wfConfId", + "description":"the Configuration to delete" + }, + { + "name":"dsId", + "description":"the Datasource ID" + }, + { + "name":"apiId", + "description":"the Api ID" + }, + { + "name":"nativeMdStoreId", + "description":"Native Metadata Store ID" + }, + { + "name":"cleanedMdStoreId", + "description":"Cleaned Metadata Store ID" + } + ], + "graph":[ + { + "name":"LOAD_DS_INFO", + "type":"loadDatasourceInfo", + "start": true, + "input":[ + { + "name":"dsId", + "ref":"dsId" + }, + { + "name":"apiId", + "ref":"apiId" + } + ], + "output":[ + { + "name":"ds", + "env":"ds" + }, + { + "name":"api", + "env":"api" + } + ], + "arcs":[ + { + "to":"DELETE_DC" + }, + { + "to":"DELETE_DMF" + } + ] + }, + { + "name":"DELETE_DC", + "type":"deleteMdStore", + "input":[ + { + "name":"mdId", + "ref":"nativeMdStoreId" + } + ], + "arcs":[ + { + "to":"DELETE_WF_CONF" + } + ] + }, + { + "name":"DELETE_OAF", + "type":"deleteMdStore", + "input":[ + { + "name":"mdId", + "ref":"cleanedMdStoreId" + } + ], + "arcs":[ + { + "to":"DELETE_WF_CONF" + } + ] + }, + { + "name":"DELETE_WF_CONF", + "type":"registerWfConfiguration", + "join": true, + "input":[ + { + "name":"wfConfId", + "ref":"wfConfId" + } + ] + } + ] +} + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libs/dnet-wf-service/src/main/resources/wf_templates/simple_repo_hi.json b/libs/dnet-wf-service/src/main/resources/wf_templates/simple_repo_hi.json new file mode 100644 index 00000000..c1433b63 --- /dev/null +++ b/libs/dnet-wf-service/src/main/resources/wf_templates/simple_repo_hi.json @@ -0,0 +1,234 @@ +{ + "parameters":[ + { + "name":"wfId", + "description":"the workflow to be configured", + "defaultValue": "wf-aggr-dc2oaf" + }, + { + "name":"destroyWfId", + "description":"the workflow to remove the configuration", + "defaultValue": "wf-destroy-dc2oaf" + }, + { + "name":"dsId", + "description":"the Datasource ID" + }, + { + "name":"apiId", + "description":"the Api ID" + }, + { + "name":"expectedEoscDatasourceTypes", + "description":"the expected ds types (comma separated)" + }, + { + "name":"expectedCompatibilities", + "description":"the expected compatibilities (comma separated)" + } + ], + "graph":[ + { + "name":"LOAD_DS_INFO", + "type":"loadDatasourceInfo", + "start": true, + "input":[ + { + "name":"dsId", + "ref":"dsId" + }, + { + "name":"apiId", + "ref":"apiId" + } + ], + "output":[ + { + "name":"ds", + "env":"ds" + }, + { + "name":"api", + "env":"api" + } + ], + "arcs":[ + { + "to":"VERIFY_DS" + } + ] + }, + { + "name":"VERIFY_DS", + "type":"verifyDatasource", + "input":[ + { + "name":"expectedEoscDatasourceTypes", + "ref":"expectedEoscDatasourceTypes" + }, + { + "name":"expectedCompatibilities", + "ref":"expectedCompatibilities" + }, + { + "name":"ds", + "env":"ds" + }, + { + "name":"api", + "env":"api" + } + + ], + "output":[ + { + "name":"outputStream", + "env":"origStream" + } + ], + "arcs":[ + { + "to":"CREATE_DC" + }, + { + "to":"CREATE_OAF" + } + ] + }, + { + "name":"CREATE_DC", + "type":"createMdStore", + "input":[ + { + "name":"format", + "value":"oai_dc" + }, + { + "name":"layout", + "value":"native" + }, + { + "name":"interpretation", + "value":"store" + }, + { + "name":"ds", + "env":"ds" + }, + { + "name":"api", + "env":"api" + } + ], + "output":[ + { + "name":"mdId", + "env":"mdId_dc" + } + ], + "arcs":[ + { + "to":"REGISTER_WF_CONF" + } + ] + }, + { + "name":"CREATE_OAF", + "type":"createMdStore", + "input":[ + { + "name":"format", + "value":"OAF" + }, + { + "name":"layout", + "value":"cleaned" + }, + { + "name":"interpretation", + "value":"store" + }, + { + "name":"ds", + "env":"ds" + }, + { + "name":"api", + "env":"api" + } + ], + "output":[ + { + "name":"mdId", + "env":"mdId_oaf" + } + ], + "arcs":[ + { + "to":"REGISTER_WF_CONF" + } + ] + + }, + { + "name":"REGISTER_WF_CONF", + "type":"registerWfConfiguration", + "join": true, + "input":[ + { + "name":"wfId", + "ref":"wfId" + }, + { + "name":"destroyWfId", + "ref":"destroyWfId" + }, + { + "name":"ds", + "env":"ds" + }, + { + "name":"api", + "env":"api" + }, + { + "name":"nativeMdStoreId", + "env":"mdId_dc" + }, + { + "name":"cleanedMdStoreId", + "env":"mdId_oaf" + } + ], + "output":[ + { + "name":"wfConfId", + "env":"wfConfId" + } + ] + } + ] +} + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file