com.informatica.powercenter.sdk.mapfwk.core
Class Command

java.lang.Object
  extended by com.informatica.powercenter.sdk.mapfwk.core.Task
      extended by com.informatica.powercenter.sdk.mapfwk.core.Command

public class Command
extends Task

Represent Command Task.

Workflow Manager contains many types of tasks to help you build workflows and worklets

Command task allows to specify one or more shell commands to run during in a workflow. For example, you can specify shell commands in the Command task to delete reject files, copy a file, or archive target files.

See Also:
Assignment, Control, Decision, EMail, Session, Timer

Field Summary
static java.lang.String FAIL_TASK_IF_ANY_COMMAND_FAILS
          Option to set whether the task should fail if any command fails.
static java.lang.String RECOVERY_STRATEGY
          Recovery strategy
static java.lang.String RECOVERY_STRATEGY_VALUE_FAIL_TASK
          Recovery strategy - Option Fail task and continue Workflow
static java.lang.String RECOVERY_STRATEGY_VALUE_RESTART_TASK
          Recovery strategy - Restart task
 
Fields inherited from class com.informatica.powercenter.sdk.mapfwk.core.Task
FAIL_PARENT_IF_INSTANCE_DIDNOT_RUN, FAIL_PARENT_IF_INSTANCE_FAILS, NO_OPTION, REUSABLE, TREAT_INPUT_LINK_AS_AND, YES_OPTION
 
Constructor Summary
Command(java.lang.String name, java.lang.String busName, java.lang.String desc)
          Create a new Command task
 
Method Summary
 void addCommand(java.lang.String commandName, java.lang.String command)
          Adds a new command to the task.
 void deleteCommand(java.lang.String commandName, java.lang.String command)
          Deletes a command from the command task.
 java.util.Iterator getCommandIterator()
          Returns an iterator for commands present in command task.
 boolean getFailTaskOption()
          Gets the value of "Fail task if any command fails" option
 java.lang.String getRecoveryStrategy()
          Gets recovery strategy Recovery strategy is one of the following RECOVERY_STRATEGY_VALUE_FAIL_TASK RECOVERY_STRATEGY_VALUE_RESTART_TASK
 void modifyCommand(java.lang.String commandName, java.lang.String command)
          Modifies a command present in the command task.
 void setFailTaskOption(boolean value)
          Set the value of "Fail task if any command fails" option to true or false.
 void setRecoveryStrategy(java.lang.String strategy)
          Sets recovery strategy.
 
Methods inherited from class com.informatica.powercenter.sdk.mapfwk.core.Task
connectToTask, connectToTask, deleteNameValuePair, getAllConnectedTasks, getAllConnectedTasksAndExpressions, getAttributes, getBusinessName, getConflictResolution, getDescription, getMetaExtensions, getName, getNamesOfValuePairs, getNameValuePairs, getProperties, getTaskInstanceProperty, getType, getValueOfNameValuePair, isModified, setAttributes, setBusinessName, setConflictResolution, setDescription, setMetaExtensions, setModified, setName, setNameValuePair, setTaskInstanceProperty, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FAIL_TASK_IF_ANY_COMMAND_FAILS

public static final java.lang.String FAIL_TASK_IF_ANY_COMMAND_FAILS
Option to set whether the task should fail if any command fails.

See Also:
Constant Field Values

RECOVERY_STRATEGY

public static final java.lang.String RECOVERY_STRATEGY
Recovery strategy

See Also:
Constant Field Values

RECOVERY_STRATEGY_VALUE_FAIL_TASK

public static final java.lang.String RECOVERY_STRATEGY_VALUE_FAIL_TASK
Recovery strategy - Option Fail task and continue Workflow

See Also:
Constant Field Values

RECOVERY_STRATEGY_VALUE_RESTART_TASK

public static final java.lang.String RECOVERY_STRATEGY_VALUE_RESTART_TASK
Recovery strategy - Restart task

See Also:
Constant Field Values
Constructor Detail

Command

public Command(java.lang.String name,
               java.lang.String busName,
               java.lang.String desc)
Create a new Command task

Parameters:
name - name of the command task
busName - business name
desc - description
Method Detail

addCommand

public void addCommand(java.lang.String commandName,
                       java.lang.String command)
Adds a new command to the task.

All commands will be added to the end of the list and the order of commands are maintained

Parameters:
commandName - name of the command
command - the corresponding command string

deleteCommand

public void deleteCommand(java.lang.String commandName,
                          java.lang.String command)
Deletes a command from the command task.

Since a commandName can be added multiple times, the tuple is used to uniquely identify the expression. If tuple exist multiple times, first such entry would be deleted.

Parameters:
commandName - name of the command to be deleted
command - the corresponding command string

modifyCommand

public void modifyCommand(java.lang.String commandName,
                          java.lang.String command)
Modifies a command present in the command task.

Since a commandName can be added multiple times, the tuple is used to uniquely identify the expression. If tuple exist multiple times, first such entry would be modfiied.

Parameters:
commandName - name of the command to be deleted
command - the corresponding command string

setRecoveryStrategy

public void setRecoveryStrategy(java.lang.String strategy)
Sets recovery strategy. Recovery strategy is one of the following

Parameters:
strategy - recovery srategy
See Also:
RECOVERY_STRATEGY_VALUE_FAIL_TASK, RECOVERY_STRATEGY_VALUE_RESTART_TASK, getRecoveryStrategy()

getRecoveryStrategy

public java.lang.String getRecoveryStrategy()
Gets recovery strategy Recovery strategy is one of the following

Returns:
String recovery strategy
See Also:
RECOVERY_STRATEGY_VALUE_FAIL_TASK, RECOVERY_STRATEGY_VALUE_RESTART_TASK, #setRecoveryStrategy()

setFailTaskOption

public void setFailTaskOption(boolean value)
Set the value of "Fail task if any command fails" option to true or false.

Parameters:
value - true, if task should be failed if a command fails false,if task should not be failed if a command fails
See Also:
getFailTaskOption()

getFailTaskOption

public boolean getFailTaskOption()
Gets the value of "Fail task if any command fails" option

Returns:
boolean true, if task should be failed if a command fails false,if task should not be failed if a command fails
See Also:
#setFailTaskOption()

getCommandIterator

public java.util.Iterator getCommandIterator()
Returns an iterator for commands present in command task. Each element in the iterator is an array of String with two elements Iterator.next() returns a String[]

Returns:
Iterator iterator for commands present in command task