2023-02-27 11:43:28 +01:00
|
|
|
package eu.dnetlib.manager.wf.nodes;
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.BeanNameAware;
|
|
|
|
|
|
|
|
import eu.dnetlib.manager.wf.workflows.procs.Token;
|
2023-03-20 12:26:40 +01:00
|
|
|
import eu.dnetlib.manager.wf.workflows.util.ExecutionCallback;
|
2023-02-27 11:43:28 +01:00
|
|
|
|
|
|
|
public abstract class ProcessNode implements BeanNameAware {
|
|
|
|
|
|
|
|
private String beanName;
|
|
|
|
|
|
|
|
private String nodeName;
|
|
|
|
|
2023-03-20 12:26:40 +01:00
|
|
|
public abstract void execute(final Token token, ExecutionCallback<Token> callback);
|
2023-02-27 11:43:28 +01:00
|
|
|
|
2023-04-19 14:52:58 +02:00
|
|
|
protected void onStart(final Token token) {
|
|
|
|
// For optional overwrites
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void onDone(final Token token) {
|
|
|
|
// For optional overwrites
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void onFailed(final Token token) {
|
|
|
|
// For optional overwrites
|
|
|
|
}
|
|
|
|
|
2023-02-27 11:43:28 +01:00
|
|
|
public String getBeanName() {
|
|
|
|
return this.beanName;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void setBeanName(final String beanName) {
|
|
|
|
this.beanName = beanName;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String getNodeName() {
|
|
|
|
return this.nodeName;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setNodeName(final String nodeName) {
|
|
|
|
this.nodeName = nodeName;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String toString() {
|
|
|
|
return String.format("[node beanName=%s, name=%s]", this.beanName, this.nodeName);
|
|
|
|
}
|
2023-03-08 09:39:37 +01:00
|
|
|
|
2023-02-27 11:43:28 +01:00
|
|
|
}
|