TEMERITY

us.temerity.pipeline.plugin.ScriptAction.v2_2_1
Class ScriptAction

java.lang.Object
  extended by us.temerity.pipeline.Named
      extended by us.temerity.pipeline.PluginID
          extended by us.temerity.pipeline.BasePlugin
              extended by us.temerity.pipeline.BaseAction
                  extended by us.temerity.pipeline.plugin.CommonActionUtils
                      extended by us.temerity.pipeline.plugin.ScriptAction.v2_2_1.ScriptAction
All Implemented Interfaces:
Serializable, Cloneable, Comparable<PluginID>, Glueable

public class ScriptAction
extends CommonActionUtils

Runs an executable script.

This action defines the following single valued parameters:

Script
The source node who's primary file sequence is a single executable script.

FullPaths
Whether to supply the values for the target/source file list environmental variables as fully resolved file name paths instead of the default simple file name.

In order to aid script writers in writing more general scripts, this action also adds a set of environmental variables to the environment under which the script is executed. These extra environmental variables correspond to the arguments passed to the prep method. The environmental variables are:

PIPELINE_JOB_ID
The unique job identifier of the job running this action.

PIPELINE_NODE_NAME
The fully resolved name of the target node.

PIPELINE_NODE_AUTHOR
The name of the user which owns the target node.

PIPELINE_NODE_VIEW
The name of the user's working area view which contains the target node.

PIPELINE_PRIMARY_TARGET
A colon seperated list of files which make up the primary file sequence to generate.

PIPELINE_NUM_SECONDARY_TARGETS
The number of secondary file sequences to generate.

PIPELINE_SECONDARY_TARGET_#
A colon seperated list of files which make up a secondary file sequences to generate, where (#) is replaced by the index of the of the secondary file sequence. The index will be in the range [0,$PIPELINE_NUM_SECONDARY_TARGETS).

PIPELINE_NUM_SOURCES
The number of upstream source nodes.

PIPELINE_SOURCE_#
The fully resolved node name of a source node, where (#) is replaced by the index of the source. The index will be in the range [0,$PIPELINE_NUM_SOURCES).

PIPELINE_PRIMARY_SOURCE_#
A colon seperated list of files which make up the primary file sequence of a source node, where (#) is replaced by the index of the source. The index will be in the range [0,$PIPELINE_NUM_SOURCES).

PIPELINE_NUM_SECONDARY_SOURCES_#
The number of secondary file sequences associated with each source node, where (#) is replaced by the index of the source.

PIPELINE_SECONDARY_SOURCE_#_#
A colon seperated list of files which make up the secondary file sequence of a source node, where the first (#) is replaced by the index of the source and the second (#) is replaced by the index of the secondary file sequence. The first index will be in the range [0,$PIPELINE_NUM_SOURCES). The second index will be in the range [0,$PIPELINE_NUM_SECONDARY_SOURCES_#).

Note that some of these variables may not be defined if there are no secondary file sequences or node dependencies.

For new development, we would recommend using the Python Action instead of this Action for the best multi-platform support. Although you could provide a Python script to this Action as its Script source node, passing job prep information through the environment is less elegant than the dynamic module approach used by the Python Action plugin.

See Also:
Serialized Form

Field Summary
static String aFullPaths
           
static String aScript
           
 
Fields inherited from class us.temerity.pipeline.plugin.CommonActionUtils
aExtraOptions
 
Fields inherited from class us.temerity.pipeline.BasePlugin
pDescription
 
Fields inherited from class us.temerity.pipeline.PluginID
pVendor, pVersionID
 
Fields inherited from class us.temerity.pipeline.Named
pName
 
Constructor Summary
ScriptAction()
           
 
Method Summary
 SubProcessHeavy prep(ActionAgenda agenda, File outFile, File errFile)
          Construct a SubProcessHeavy instance which when executed will fulfill the given action agenda.
 
Methods inherited from class us.temerity.pipeline.plugin.CommonActionUtils
addExtraOptionsParam, addExtraOptionsParamToLayout, createScriptSubProcess, createSubProcess, createSubProcess, createSubProcess, createSubProcess, createTempCopySubProcess, createTempScript, escPath, escPath, getExtraOptionsArgs, getPrimarySourcePath, getPrimarySourcePath, getPrimarySourcePath, getPrimarySourcePaths, getPrimarySourcePaths, getPrimarySourcePaths, getPrimaryTargetPath, getPrimaryTargetPath, getPrimaryTargetPath, getPrimaryTargetPaths, getPrimaryTargetPaths, getPrimaryTargetPaths, getSecondarySourceBooleanParamValue, getSecondarySourceDoubleParamValue, getSecondarySourceDoubleParamValue, getSecondarySourceEnumParamIndex, getSecondarySourceIntegerParamValue, getSecondarySourceIntegerParamValue, getSecondarySourceLongParamValue, getSecondarySourceLongParamValue, getSecondarySourceOptionalBooleanParamValue, getSecondarySourceStringParamValue, getSecondarySourceStringParamValue, getSingleBooleanParamValue, getSingleDoubleParamValue, getSingleDoubleParamValue, getSingleEnumParamIndex, getSingleIntegerParamValue, getSingleIntegerParamValue, getSingleLongParamValue, getSingleLongParamValue, getSingleOptionalBooleanParamValue, getSingleStringParamValue, getSingleStringParamValue, getSingleTuple2dParamValue, getSingleTuple2dParamValue, getSingleTuple2dParamValue, getSingleTuple2iParamValue, getSingleTuple2iParamValue, getSingleTuple2iParamValue, getSingleTuple3dParamValue, getSingleTuple3dParamValue, getSingleTuple3dParamValue, getSingleTuple3iParamValue, getSingleTuple3iParamValue, getSingleTuple3iParamValue, getSingleTuple4dParamValue, getSingleTuple4dParamValue, getSingleTuple4dParamValue, getSourceBooleanParamValue, getSourceDoubleParamValue, getSourceDoubleParamValue, getSourceEnumParamIndex, getSourceIntegerParamValue, getSourceIntegerParamValue, getSourceLongParamValue, getSourceLongParamValue, getSourceOptionalBooleanParamValue, getSourceStringParamValue, getSourceStringParamValue, getWorkingNodeFilePath, getWorkingNodeFilePath, getWorkingNodeFilePath, getWorkingNodeFilePath, getWorkingNodeFilePaths
 
Methods inherited from class us.temerity.pipeline.BaseAction
addPreset, addPresetValues, addSingleParam, chmod, cleanupLater, clearAllLinkParams, clearLinkParams, clone, createTemp, createTemp, equals, equalSingleParams, equalSourceParams, fromGlue, getInitialSourceParams, getPluginType, getPresetChoices, getPresetValues, getSecondarySequences, getSecondarySourceNames, getSecondarySourceParam, getSecondarySourceParams, getSecondarySourceParamValue, getSingleLayout, getSingleParam, getSingleParams, getSingleParamValue, getSourceLayout, getSourceNames, getSourceParam, getSourceParams, getSourceParamValue, getTempDir, getTempPath, hasSecondarySourceParams, hasSingleParams, hasSourceParams, initSecondarySourceParams, initSourceParams, removeAllSourceParams, removeSecondarySourceParams, removeSecondarySourceParams, removeSourceParams, setSecondarySourceParamValue, setSingleLayout, setSingleParamValue, setSingleParamValues, setSourceLayout, setSourceParamValue, setSourceParamValues, supportsSourceParams, toGlue
 
Methods inherited from class us.temerity.pipeline.BasePlugin
addSupport, compareTo, getDescription, getFullMessage, getPluginID, getResource, getResources, getResourceSize, getSupports, isUnderDevelopment, removeSupport, setSupports, supports, toString, underDevelopment
 
Methods inherited from class us.temerity.pipeline.PluginID
getVendor, getVersionID
 
Methods inherited from class us.temerity.pipeline.Named
getName
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

aScript

public static final String aScript
See Also:
Constant Field Values

aFullPaths

public static final String aFullPaths
See Also:
Constant Field Values
Constructor Detail

ScriptAction

public ScriptAction()
Method Detail

prep

public SubProcessHeavy prep(ActionAgenda agenda,
                            File outFile,
                            File errFile)
                     throws PipelineException
Construct a SubProcessHeavy instance which when executed will fulfill the given action agenda.

Overrides:
prep in class BaseAction
Parameters:
agenda - The agenda to be accomplished by the action.
outFile - The file to which all STDOUT output is redirected.
errFile - The file to which all STDERR output is redirected.
Returns:
The SubProcess which will fulfill the agenda.
Throws:
PipelineException - If unable to prepare a SubProcess due to illegal, missing or imcompatable information in the action agenda or a general failure of the prep method code.

TEMERITY