Project

General

Profile

1
package eu.dnetlib.msro.workflows.nodes.sel;
2

    
3
import com.googlecode.sarasvati.Arc;
4
import com.googlecode.sarasvati.NodeToken;
5

    
6
import eu.dnetlib.msro.workflows.nodes.SimpleJobNode;
7
import eu.dnetlib.msro.workflows.util.WorkflowParam;
8
import eu.dnetlib.msro.workflows.util.WorkflowsConstants;
9

    
10
/**
11
 * The Class SelectiveNode allows to decide which path a workflow must take.
12
 */
13
public class SelectiveNode extends SimpleJobNode {
14

    
15
	/** The selection. */
16
	private String selection = Arc.DEFAULT_ARC;
17

    
18
	/*
19
	 * (non-Javadoc)
20
	 * 
21
	 * @see eu.dnetlib.msro.workflows.nodes.SimpleJobNode#execute(com.googlecode.sarasvati.NodeToken)
22
	 */
23
	@Override
24
	protected String execute(final NodeToken token) throws Exception {
25
		token.getEnv().setAttribute(WorkflowsConstants.MAIN_LOG_PREFIX + "selection", getSelection());
26
		return getSelection();
27
	}
28

    
29
	/**
30
	 * Gets the selection.
31
	 *
32
	 * @return the selection
33
	 */
34
	public String getSelection() {
35
		return selection;
36
	}
37

    
38
	/**
39
	 * Sets the selection.
40
	 *
41
	 * @param selection
42
	 *            the new selection
43
	 */
44
	public void setSelection(final String selection) {
45
		this.selection = selection;
46
	}
47

    
48
}
    (1-1/1)