com.massimo.tools.scriptrunner.work
Class ProcessTask
java.lang.Object
com.massimo.tools.scriptrunner.AbstractTask
com.massimo.tools.scriptrunner.work.ProcessTask
- All Implemented Interfaces:
- Task
public class ProcessTask
- extends AbstractTask
Execute the script text using Runtime.exec()
Introduces boolean attributes Constants.ATTRIBUTE_SHOW_OUTPUT,
Constants.ATTRIBUTE_SHOW_ERROR.
These turn echoing of the command stdout or stderr output on/off. Default = false.
Introduces Constants.ELEMENT_INPUT Element.
The text of this element will be written to the Process input stream.
Methods inherited from class com.massimo.tools.scriptrunner.AbstractTask |
getBooleanProperty, getCurrentWorkingDirectory, getDefinition, getIntProperty, getName, getParent, getProperties, getStartProcessingRow, getText, getType, isIgnoreableError, isIgnoreableError, isInterrupted, isLogProgress, postProcess, preProcess, process, resultCodeToString, substituteParameters, toString, validate, validateConnections, validateParameters |
ProcessTask
public ProcessTask(Task parent,
String type,
Element definition,
Map<String,String> connectionProperties)
- Parameters:
parent
- type
- definition
- connectionProperties
-
doProcess
protected int doProcess(ExecutionContext context)
throws Exception
- Implementing classes only need to do their own work and log progress when appropriate.
- Specified by:
doProcess
in class AbstractTask
- Returns:
- O for success. Anything else is a failure.
- Throws:
Exception
- See Also:
AbstractTask.process(ExecutionContext)
doValidate
protected int doValidate(ValidationContext context)
- Check whether this task should be able to run.
Implementations should check for the prescence of files, attributes,...
- Specified by:
doValidate
in class AbstractTask
- Returns:
- O for success. Anything else is a failure.
getLogger
protected org.apache.log4j.Logger getLogger()
-
- Specified by:
getLogger
in class AbstractTask
- Returns:
- Class logger
interrupt
public void interrupt()
- Tells the Task to stop processing.
This does not garrantee that the task will return immediately.
- Specified by:
interrupt
in interface Task
- Overrides:
interrupt
in class AbstractTask