wf params

This commit is contained in:
Michele Artini 2024-01-05 14:15:09 +01:00
parent 36935e197f
commit 244db16d74
10 changed files with 17 additions and 118 deletions

View File

@ -1,13 +1,5 @@
{
"parameters": [
{
"name":"dsId",
"description":"the Datasource ID"
},
{
"name":"apiId",
"description":"the Api ID"
},
{
"name":"nativeMdStoreId",
"description":"Native Metadata Store ID"

View File

@ -1,13 +1,5 @@
{
"parameters":[
{
"name":"dsId",
"description":"the Datasource ID"
},
{
"name":"apiId",
"description":"the Api ID"
},
{
"name":"mode",
"description":"Collection Mode",
@ -35,16 +27,7 @@
"name":"LOAD_DS_INFO",
"type":"loadDatasourceInfo",
"start": true,
"input":[
{
"name":"dsId",
"ref":"dsId"
},
{
"name":"apiId",
"ref":"apiId"
}
],
"input":[],
"output":[
{
"name":"ds",

View File

@ -1,17 +1,5 @@
{
"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"
@ -26,16 +14,7 @@
"name":"LOAD_DS_INFO",
"type":"loadDatasourceInfo",
"start": true,
"input":[
{
"name":"dsId",
"ref":"dsId"
},
{
"name":"apiId",
"ref":"apiId"
}
],
"input":[],
"output":[
{
"name":"ds",
@ -89,12 +68,7 @@
"name":"DELETE_WF_CONF",
"type":"deleteWfConfiguration",
"join": true,
"input":[
{
"name":"wfConfId",
"ref":"wfConfId"
}
]
"input":[]
}
]
}

View File

@ -10,14 +10,6 @@
"description":"the workflow to remove the configuration",
"defaultValue": "wf-destroy-dc2dmf"
},
{
"name":"dsId",
"description":"the Datasource ID"
},
{
"name":"apiId",
"description":"the Api ID"
},
{
"name":"expectedEoscDsTypes",
"description":"the expected ds types (comma separated)",
@ -34,16 +26,7 @@
"name":"LOAD_DS_INFO",
"type":"loadDatasourceInfo",
"start": true,
"input":[
{
"name":"dsId",
"ref":"dsId"
},
{
"name":"apiId",
"ref":"apiId"
}
],
"input":[],
"output":[
{
"name":"ds",

View File

@ -1,13 +1,5 @@
{
"parameters":[
{
"name":"dsId",
"description":"the Datasource ID"
},
{
"name":"apiId",
"description":"the Api ID"
},
{
"name":"inputMdStoreId",
"description":"Input Metadata Store ID"
@ -22,16 +14,7 @@
"name":"LOAD_DS_INFO",
"type":"loadDatasourceInfo",
"start": true,
"input":[
{
"name":"dsId",
"ref":"dsId"
},
{
"name":"apiId",
"ref":"apiId"
}
],
"input":[],
"output":[
{
"name":"ds",

View File

@ -48,18 +48,6 @@ public class WfConfigurationUtils {
if (conf.getSystemParams() != null) {
all.putAll(conf.getUserParams());
}
if (StringUtils.isNotBlank(conf.getId())) {
all.put("wfConfId", conf.getId());
}
if (StringUtils.isNotBlank(conf.getDsId())) {
all.put("dsId", conf.getDsId());
}
if (StringUtils.isNotBlank(conf.getDsName())) {
all.put("dsName", conf.getDsName());
}
if (StringUtils.isNotBlank(conf.getApiId())) {
all.put("apiId", conf.getApiId());
}
if (log.isDebugEnabled()) {
log.debug("** CONFIGURED INPUT WF PARAMETERS **");

View File

@ -1,8 +1,9 @@
package eu.dnetlib.wfs.nodes.conf;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import eu.dnetlib.wfs.annotations.WfInputParam;
import eu.dnetlib.errors.WorkflowManagerException;
import eu.dnetlib.wfs.annotations.WfNode;
import eu.dnetlib.wfs.nodes.AbstractJobNode;
import eu.dnetlib.wfs.repository.WfConfigurationRepository;
@ -10,14 +11,15 @@ import eu.dnetlib.wfs.repository.WfConfigurationRepository;
@WfNode("deleteWfConfiguration")
public class DeleteWfConfigurationNode extends AbstractJobNode {
@WfInputParam
private String wfConfId;
@Autowired
private WfConfigurationRepository wfConfigurationRepository;
@Override
protected void execute() throws Exception {
final String wfConfId = getProcess().getWfConfId();
if (StringUtils.isBlank(wfConfId)) { throw new WorkflowManagerException("wfConfId is null"); }
wfConfigurationRepository.deleteById(wfConfId);
}

View File

@ -11,10 +11,6 @@ import eu.dnetlib.wfs.nodes.AbstractJobNode;
@WfNode("clearApiExtraFields")
public class ClearApiExtraFieldsNode extends AbstractJobNode {
@WfInputParam
private String dsId;
@WfInputParam
private String apiId;
@WfInputParam
private String infoType; // COLLECT, TRANSFORM, DOWNLOAD
@ -26,6 +22,8 @@ public class ClearApiExtraFieldsNode extends AbstractJobNode {
final DsmClient dsm = clientFactory.getClient(DsmClient.class);
final String apiId = getProcess().getDsInterface();
switch (infoType.toUpperCase()) {
case "COLLECT":
dsm.updateApiCollectionInfo(apiId, null, 0);

View File

@ -6,7 +6,6 @@ import eu.dnetlib.common.clients.DnetServiceClientFactory;
import eu.dnetlib.common.clients.DsmClient;
import eu.dnetlib.domain.dsm.Api;
import eu.dnetlib.domain.dsm.Datasource;
import eu.dnetlib.wfs.annotations.WfInputParam;
import eu.dnetlib.wfs.annotations.WfNode;
import eu.dnetlib.wfs.annotations.WfOutputParam;
import eu.dnetlib.wfs.nodes.AbstractJobNode;
@ -14,12 +13,6 @@ import eu.dnetlib.wfs.nodes.AbstractJobNode;
@WfNode("loadDatasourceInfo")
public class LoadDatasourceInfoNode extends AbstractJobNode {
@WfInputParam
private String dsId;
@WfInputParam
private String apiId;
@WfOutputParam
private Datasource ds;
@ -33,6 +26,9 @@ public class LoadDatasourceInfoNode extends AbstractJobNode {
protected void execute() throws Exception {
final DsmClient dsm = clientFactory.getClient(DsmClient.class);
final String dsId = getProcess().getDsId();
final String apiId = getProcess().getDsInterface();
ds = dsm.findDs(dsId);
api = dsm.findApi(apiId);

View File

@ -91,7 +91,7 @@ public class WorkflowProcess implements Comparable<WorkflowProcess> {
}
public String getDsId() {
return wfConf.getId();
return wfConf.getDsId();
}
public String getDsName() {