1
|
package eu.dnetlib.msro.workflows.nodes.dedup;
|
2
|
|
3
|
import eu.dnetlib.msro.workflows.nodes.SimpleJobNode;
|
4
|
import eu.dnetlib.msro.workflows.nodes.dedup.utils.DedupConfigurationOrchestration;
|
5
|
import eu.dnetlib.msro.workflows.nodes.dedup.utils.DedupConfigurationOrchestrationLoader;
|
6
|
import eu.dnetlib.msro.workflows.procs.Env;
|
7
|
import org.apache.commons.lang3.StringUtils;
|
8
|
import org.apache.commons.logging.Log;
|
9
|
import org.apache.commons.logging.LogFactory;
|
10
|
import org.springframework.beans.factory.annotation.Autowired;
|
11
|
|
12
|
/**
|
13
|
* Created by claudio on 13/07/16.
|
14
|
*/
|
15
|
public class SelectWfPathByDedupEntityJobNode extends SimpleJobNode {
|
16
|
|
17
|
private static final Log log = LogFactory.getLog(SelectWfPathByDedupEntityJobNode.class);
|
18
|
|
19
|
@Autowired
|
20
|
private DedupConfigurationOrchestrationLoader dedupOrchestrationLoader;
|
21
|
|
22
|
private String dedupConfigSequence;
|
23
|
|
24
|
@Override
|
25
|
protected String execute(final Env env) throws Exception {
|
26
|
|
27
|
if (StringUtils.isBlank(getDedupConfigSequence())) throw new IllegalArgumentException("missing configuration sequence");
|
28
|
|
29
|
final DedupConfigurationOrchestration dedupOrchestration = dedupOrchestrationLoader.loadByActionSetId(getDedupConfigSequence());
|
30
|
|
31
|
final String entityName = dedupOrchestration.getEntity().getName();
|
32
|
|
33
|
log.info("following workflow path: " + entityName);
|
34
|
|
35
|
return entityName;
|
36
|
}
|
37
|
|
38
|
public String getDedupConfigSequence() {
|
39
|
return dedupConfigSequence;
|
40
|
}
|
41
|
|
42
|
public void setDedupConfigSequence(final String dedupConfigSequence) {
|
43
|
this.dedupConfigSequence = dedupConfigSequence;
|
44
|
}
|
45
|
|
46
|
}
|