1 |
1 |
package eu.dnetlib.msro.workflows.nodes;
|
2 |
2 |
|
|
3 |
import org.apache.commons.logging.Log;
|
|
4 |
import org.apache.commons.logging.LogFactory;
|
|
5 |
import org.springframework.beans.factory.annotation.Autowired;
|
|
6 |
|
3 |
7 |
import eu.dnetlib.msro.workflows.graph.Arc;
|
4 |
8 |
import eu.dnetlib.msro.workflows.procs.Token;
|
5 |
9 |
import eu.dnetlib.msro.workflows.procs.WorkflowExecutor;
|
6 |
10 |
import eu.dnetlib.msro.workflows.util.ProcessCallback;
|
7 |
|
import org.apache.commons.logging.Log;
|
8 |
|
import org.apache.commons.logging.LogFactory;
|
9 |
|
import org.springframework.beans.factory.annotation.Autowired;
|
10 |
11 |
|
11 |
12 |
/**
|
12 |
13 |
* Created by michele on 18/11/15.
|
... | ... | |
23 |
24 |
public final void execute(final Token token) {
|
24 |
25 |
|
25 |
26 |
try {
|
26 |
|
final String procId = executor.startWorkflow(getWfId(), null, new ProcessCallback() {
|
|
27 |
final String procId = this.executor.startWorkflow(getWfId(), null, new ProcessCallback() {
|
27 |
28 |
|
28 |
29 |
@Override
|
29 |
30 |
public void onSuccess() {
|
30 |
31 |
log.debug("Child workflow has been completed successfully");
|
31 |
|
|
32 |
32 |
token.setNextArc(Arc.DEFAULT_ARC);
|
33 |
33 |
token.release();
|
34 |
34 |
}
|
... | ... | |
37 |
37 |
public void onFail() {
|
38 |
38 |
log.error("Child workflow is failed");
|
39 |
39 |
token.releaseAsFailed("Child workflow is failed");
|
40 |
|
token.release();
|
41 |
40 |
}
|
42 |
41 |
});
|
43 |
42 |
if (log.isDebugEnabled()) {
|
44 |
43 |
log.debug("The child workflow [" + getWfId() + "] is starting with procId: " + procId);
|
45 |
44 |
}
|
46 |
|
} catch (Throwable e) {
|
|
45 |
} catch (final Throwable e) {
|
47 |
46 |
log.error("got exception while launching child workflow", e);
|
48 |
47 |
token.releaseAsFailed(e);
|
49 |
|
token.release();
|
50 |
48 |
}
|
51 |
49 |
}
|
52 |
50 |
|
53 |
51 |
public String getWfId() {
|
54 |
|
return wfId;
|
|
52 |
return this.wfId;
|
55 |
53 |
}
|
56 |
54 |
|
57 |
55 |
public void setWfId(final String wfId) {
|
failure of wf templates