This commit is contained in:
Michele Artini 2024-01-10 08:42:15 +01:00
parent 2bca2fbeca
commit 2422d4fe35
5 changed files with 18 additions and 6 deletions

View File

@ -52,7 +52,8 @@ CREATE VIEW wf_journal_view AS SELECT
coalesce(r.last_update, h.end_date) AS last_update,
coalesce(r.ds_id, h.ds_id) AS ds_id,
coalesce(r.ds_name, h.ds_name) AS ds_name,
coalesce(r.ds_api, h.ds_api) AS ds_api
coalesce(r.ds_api, h.ds_api) AS ds_api,
coalesce(r.details, h.details) AS details
FROM wf_runtime r JOIN wf_history h ON (r.process_id = h.process_id);
-- Workflows

View File

@ -238,7 +238,7 @@ public class WorkflowManagerService {
final WfTemplate tmpl = client.findResourceContent(r.getId(), WfTemplate.class);
final WfRepoHiDesc repohi = new WfRepoHiDesc();
repohi.setId(r.getId());
repohi.setId(r.getName());
repohi.setName(r.getName());
repohi.setDescription(r.getDescription());
repohi.setGraph(tmpl.getGraph());

View File

@ -15,7 +15,7 @@ import jakarta.persistence.Entity;
import jakarta.persistence.Table;
@Entity
@Table(name = "wf_runtine")
@Table(name = "wf_runtime")
public class WfRunningJob extends AbstractJob {
private static final long serialVersionUID = -3163064347762609210L;

View File

@ -1,6 +1,7 @@
package eu.dnetlib.wfs.controller;
import java.util.List;
import java.util.Set;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
@ -26,16 +27,21 @@ public abstract class AbstractWfExecutorApiController extends DnetRestController
@GetMapping("/process/{id}")
public WorkflowProcess findProcess(@PathVariable final String id) throws Exception {
return registry.findProcess(id);
return this.registry.findProcess(id);
}
@GetMapping("/procs")
public Set<String> findProcess() throws Exception {
return this.registry.listProcIds();
}
@DeleteMapping("/process/{id}")
public void killProcess(@PathVariable final String id) throws Exception {
engine.killProcess(id);
this.engine.killProcess(id);
}
@GetMapping("/node-types")
public List<String> listAvailableNodes() {
return graphLoader.getValidTypes().stream().sorted().toList();
return this.graphLoader.getValidTypes().stream().sorted().toList();
}
}

View File

@ -3,6 +3,7 @@ package eu.dnetlib.wfs.procs;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import org.apache.commons.logging.Log;
@ -29,6 +30,10 @@ public class ProcessRegistry {
return count;
}
public Set<String> listProcIds() {
return this.procs.keySet();
}
public WorkflowProcess findProcess(final String procId) {
return this.procs.get(procId);
}