Previous Topic: Invoking the Informatica CLINext Topic: Example: Start a Workflow on Informatica from a Task


informatica Script—Integrate with Informatica PowerCenter

The informatica script provides integration with Informatica PowerCenter.

The script has the following format:

informatica [--verbose=true|false] [--infaTarget=infa_target_name] [--repositoryName=repository_name] 
[--user=user_name] [--password=password] --command=command --folderName=repository_folder_name --keyword=value ...
--verbose=true|false

(Optional) Indicates whether the agent logs the detailed messages for the step-by-step execution of the command in the spool files. The additional information logged is received from the agent and is not sent by Informatica.

true

Logs the detailed messages for the step-by-step execution of the command in the spool files.

false

Displays only the final output in the job spool file.

Default: false

--infaTarget=infa_target_name

(Optional) Specifies the name of the Informatica target (infaTarget). The install_dir/config/informatica/infaTarget directory contains the properties for connecting to the Informatica server and one or more database repositories.

Note: If this argument is not specified, the agent uses the default value specified in the informatica.server.target.default parameter in the agentparm.txt file.

--repositoryName=repository_name

(Optional) Specifies the name of the repository created on the Informatica server. The repository can be obtained from the Informatica Administrative console. The repositoryName.properties file for a specified Informatica target (infaTarget) contains the database connection properties.

Limits: Up to 128 characters; cannot contain delimiters (such as spaces) and special characters

Notes: If this argument is not specified, the agent uses the default value specified in the informatica.repository.name.default parameter in the informatica.properties file.

--user=user_name

(Optional) Specifies the Informatica server user name.

Notes:

--password=password

(Optional) Specifies the password for the Informatica server user name.

Important! To avoid specifying passwords in job definitions, omit the user and password arguments and use the default user settings specified in the informatica.properties file. We recommend that you secure and restrict access to any job definitions that contain encrypted passwords.

Notes:

--command=command

Specifies the command that you want to run. Options are as follows:

startWorkflow

Starts the specified workflow or its instance from the beginning of the workflow or from a specified task.

listAllWorkflows

Lists workflows defined in Informatica that match specified filtering criteria. The command returns a table that contains the following columns:

  • Workflow name
  • Workflow IDs
  • Workflow validity
  • Workflow instance names
listWorkflowTasks

Lists all the tasks within a specified workflow. The command returns a table that contains the following columns:

  • Workflow name
  • Task name
  • Task type
getWorkflowDetails

Displays the sequence of tasks for a specified Informatica workflow and the details of the links connecting the tasks.

getObjectHierarchyInWorkflow

Retrieves the hierarchy of objects within a specified workflow. The command returns a table that contains the following columns:

  • Workflow name
  • Workflow ID
  • Workflow hierarchy
getTaskDetails

Displays the details of a task within a specified workflow. The command returns the following details about the task:

  • Task type
  • Mapping name
  • Folder ID
  • Workflow ID
  • Workflow name
  • Task instance ID
  • Task instance name
getWorkflowStatus

Retrieves the status of a specified workflow or its instance.

Note: The status of the last run of the workflow or its instance is retrieved.

getWorkflowlog

Retrieves the log information of the last run of a specified workflow or its instance or its sessions.

Note: The log of the last run of the workflow or its instance is retrieved.

getWorkflowRunDetails

Displays the details of the last run of a specified workflow or its instance. The following details are included:

  • Workflow start time
  • Workflow end time
  • Workflow total run time
  • Workflow status (including error code and messages in case of workflow failure)
  • Start time of tasks in the workflow
  • End time of tasks in the workflow
  • Total run time of tasks in the workflow
  • Status of tasks (including error code and messages in case of task failure)
  • Task type

Note: The details of the last run of the workflow or its instance is retrieved.

monitorWorkflow

Monitors continuously a running workflow and its corresponding tasks. If the workflow is not running, the command provides the last run details of the workflow and all its tasks.

Note: The last run of the workflow or its instance is monitored.

restartWorkflow

Restarts a failed workflow or its instance from the beginning (similar to startWorkflow). Alternatively, if you specify a session task, the command recovers a workflow or its instance from a point of failure.

stopWorkflow

Stops a running workflow or its instance.

Note: The last run of the workflow or its instance is stopped.

-- folderName=repository_folder_name

Specifies the Informatica PowerCenter repository folder name where the specified workflow resides. You can obtain this value from the Informatica server.

--keyword=value

Specifies keywords for the command.

The startWorkflow command contains the following keywords:

--workflowName=workflow_name

Specifies the name of the PowerCenter workflow to be started. You can get the list of available workflows using the listAllWorkflows command.

--workflowInstanceName=workflow_instance_name

(Optional) Specifies the name of the workflow instance to be started. When the task name and the workflow instance name are specified, the workflow instance is started from the specified task. When the task name is not specified, the workflow instance starts from the beginning. If the instance name is not specified, the workflow is started. You can get a list of workflow instances using the listAllWorkflows command.

--taskName=task_name

(Optional) Specifies the name of the task to start the workflow from. If the task name is not specified, the workflow starts from the beginning. You can get a list of available tasks within a workflow using the listWorkflowTasks command.

--track=true|false

(Optional) Indicates whether to track the job to completion.

true

Tracks the job to completion. The CLI call returns when the job completes, whether successfully or not. The task and task step execution status is written to the spool file. The completion code of the CLI call indicates whether the job failed or succeeded. If the job was submitted successfully and the job completed successfully, 0 is returned. If job submission failed or the job failed during monitoring, a non-zero code is returned.

Note: Since the agent launches one JVM for every CLI call, the JVM overhead can be substantial when too many CLI calls are running concurrently. If the job takes a considerable amount of time to finish, system resources can be impacted.

false

Does not track the job to completion. The agent exits the JVM immediately after the job is submitted instead of waiting for the job completion. To retrieve the job running status, you can use the GetWorkflowStatus operation. The completion code of the CLI call indicates only whether the job submission succeeded or failed. If the job was submitted successfully, 0 is returned. If job submission failed, a non-zero code is returned. The spool file indicates the reason for the job submission error, such as a JDBC connection failure.

Default: true

--passOnSuccessOnly=true|false

(Optional) Indicates whether the status of the workflow is retrieved directly from Informatica or inferred depending on the successful execution of all the tasks. This argument is only used when the track argument is set to true.

true

Returns the workflow status based on the status of tasks in the Informatica workflow. If all tasks in the workflow complete successfully, the agent reports the status of the workflow as successful. If any task in the workflow fails, the agent reports the status of the workflow as failed.

false

Returns the workflow status as reported by Informatica. In Informatica, a workflow can succeed even if one or more tasks in the workflow fail.

Default: false

Notes:

  • The default value of the flag is read from the informatica.passonsuccessonly.default parameter in the agentparm.txt file.
  • If the passOnSuccessOnly flag is not specified in the job definition or configuration file, the default value is false.
--paramFile=parameter_file

(Optional) Specifies the path and name of a parameter file on the Informatica server. Informatica PowerCenter processes the parameter file when running a workflow. The parameter file contains values for symbolic variables and must adhere to the format that Informatica PowerCenter expects. A property value that is set in a parameter file overrides a value for this property that is set at the session level or elsewhere.

The listAllWorkflows command contains the following keywords:

--matchingPattern="workflow_pattern"

(Optional) Specifies the matching pattern string that is used to retrieve the names of the workflows. If you specify a matching pattern, only workflows whose names contain the search pattern are displayed. If you do not specify a matching pattern, all workflows that belong to the specified repository folder are displayed. % is the only wildcard character that is supported for the pattern matching.

Example: If you specify "A%ab%" as the matching pattern, all the workflows whose names start with A and contain ab in the middle or at the end are displayed. If you specify "%file%" as the matching pattern, all the workflows whose names contain file are displayed, for example: file_task, X_file_Task and T_file.

The listWorkflowTasks command contains the following keywords:

--workflowName=workflow_name

Specifies the name of the workflow that contains the tasks you want to list. You can list the available workflows using the listAllWorkflows command.

The getWorkflowDetails command contains the following keywords:

--workflowName=workflow_name

Specifies the name of the workflow that you want to display the details for. You can get the list of available workflows using the listAllWorkflows command.

The getObjectHierarchyInWorkflow command contains the following keywords:

--workflowName=workflow_name

Specifies the name of the workflow that you want to display the object hierarchy for. You can get the list of available workflows using the listAllWorkflows command.

--taskName=task_name

(Optional) Specifies the name of the task that you want to display the object hierarchy for. You can get the list of available tasks within a workflow using the listWorkflowTasks command.

The getTaskDetails command contains the following keywords:

--workflowName=workflow_name

Specifies the name of the workflow that you to display the task details for. You can get the list of available workflows using the listAllWorkflows command.

--taskName=task_name

Specifies the name of the task that you want to display the details for. You can get the list of available tasks within a workflow using the listWorkflowTasks command.

The getWorkflowStatus command contains the following keywords:

--workflowName=workflow_name

Specifies the name of the workflow that you want to retreive the status for. You can get the list of available workflows using the listAllWorkflows command.

--workflowInstanceName=workflow_instance_name

(Optional) Specifies the name of the workflow instance that you want to retrieve the status for. If the instance name is specified, the status of that instance in its last run is displayed. If the instance name is not specified, the workflow status of its last run is displayed. You can get the list of workflow instances using the listAllWorkflows command.

--passOnSuccessOnly=true|false

(Optional) Indicates whether the status of the workflow is retrieved directly from Informatica or inferred depending on the successful execution of all the tasks. This argument is only used when the track argument is set to true.

true

Returns the workflow status based on the status of tasks in the Informatica workflow. If all tasks in the workflow complete successfully, the agent reports the status of the workflow as successful. If any task in the workflow fails, the agent reports the status of the workflow as failed.

false

Returns the workflow status as reported by Informatica. In Informatica, a workflow can succeed even if one or more tasks in the workflow fail.

Default: false

Notes:

  • The default value of the flag is read from the informatica.passonsuccessonly.default parameter in the agentparm.txt file.
  • If the passOnSuccessOnly flag is not specified in the job definition or configuration file, the default value is false.

The getWorkflowLog command contains the following keywords:

--workflowName=workflow_name

Specifies the name of the workflow that you want to display the log for. You can get the list of available workflows using the listAllWorkflows command.

--workflowInstanceName=workflow_instance_name

(Optional) Specifies the name of the workflow instance that you want to display the log for. If the instance name is specified, the logs of that instance in its last run are displayed. If the instance name is not specified, the workflow log of its last run is displayed. You can get the list of workflow instances using the listAllWorkflows command.

--sessionName=session_name

(Optional) Specifies the name of the session within the workflow that you want to display the log for. If the session name is not specified, only the workflow logs are displayed. You can get the list of available sessions using the listWorkflowTasks command.

The getWorkflowRunDetails command contains the following keywords:

--workflowName=workflow_name

Specifies the name of the workflow that you want to display the run details for. You can get the list of available workflows using the listAllWorkflows command.

--workflowInstanceName=workflow_instance_name

(Optional) Specifies the name of the workflow instance that you want to display the run details for. If the instance name is not specified, the details of its last run of the workflow is displayed. You can get the list of workflow instances using the listAllWorkflows command.

The monitorWorkflow command contains the following keywords:

--workflowName=workflow_name

Specifies the name of the workflow that you want to monitor. You can get the list of available workflows using the listAllWorkflows command.

--workflowInstanceName=workflow_instance_name

(Optional) Specifies the name of the workflow instance that you want to monitor. If the instance name is not specified, the agent monitors the workflow. You can get a list of workflow instances using the listAllWorkflows command.

--passOnSuccessOnly=true|false

(Optional) Indicates whether the status of the workflow is retrieved directly from Informatica or inferred depending on the successful execution of all the tasks. This argument is only used when the track argument is set to true.

true

Returns the workflow status based on the status of tasks in the Informatica workflow. If all tasks in the workflow complete successfully, the agent reports the status of the workflow as successful. If any task in the workflow fails, the agent reports the status of the workflow as failed.

false

Returns the workflow status as reported by Informatica. In Informatica, a workflow can succeed even if one or more tasks in the workflow fail.

Default: false

Notes:

The restartWorkflow command contains the following keywords:

--workflowName=workflow_name

Specifies the name of the workflow that you want to restart. If the task name is not specified, the workflow is restarted from the beginning in recovery mode. You can get the list of available workflows using the listAllWorkflows command.

--workflowInstanceName=workflow_instance_name

(Optional) Specifies the name of the workflow instance that you want to restart. If the task name is not specified, the specified instance of the workflow is restarted from the beginning in recovery mode. You can get a list of workflow instances using the listAllWorkflows command.

--taskName=task_name

(Optional) Specifies the name of the session task that you want to restart the workflow from. The workflow or workflow instance is restarted in recovery mode from the specified session task. You can get the list of available tasks within a workflow using the listWorkflowTasks command.

Note: To restart a workflow or its instance from a point a failure, specify a session task. If a non-session task is specified, the agent reports an error.

--track=true|false

(Optional) Indicates whether to track the job to completion.

true

Tracks the job to completion. The CLI call returns when the job completes, whether successfully or not. The task and task step execution status is written to the spool file. The completion code of the CLI call indicates whether the job failed or succeeded. If the job was submitted successfully and the job completed successfully, 0 is returned. If job submission failed or the job failed during monitoring, a non-zero code is returned.

Note: Since the agent launches one JVM for every CLI call, the JVM overhead can be substantial when too many CLI calls are running concurrently. If the job takes a considerable amount of time to finish, system resources can be impacted.

false

Does not track the job to completion. The agent exits the JVM immediately after the job is submitted instead of waiting for the job completion. To retrieve the job running status, you can use the GetWorkflowStatus operation. The completion code of the CLI call indicates only whether the job submission succeeded or failed. If the job was submitted successfully, 0 is returned. If job submission failed, a non-zero code is returned. The spool file indicates the reason for the job submission error, such as a JDBC connection failure.

Default: true

--passOnSuccessOnly=true|false

(Optional) Indicates whether the status of the workflow is retrieved directly from Informatica or inferred depending on the successful execution of all the tasks. This argument is only used when the track argument is set to true.

true

Returns the workflow status based on the status of tasks in the Informatica workflow. If all tasks in the workflow complete successfully, the agent reports the status of the workflow as successful. If any task in the workflow fails, the agent reports the status of the workflow as failed.

false

Returns the workflow status as reported by Informatica. In Informatica, a workflow can succeed even if one or more tasks in the workflow fail.

Default: false

Notes:

--paramFile=parameter_file

(Optional) Specifies the path and name of a parameter file on the Informatica server. Informatica PowerCenter processes the parameter file when running a workflow. The parameter file contains values for symbolic variables and must adhere to the format that Informatica PowerCenter expects. A property value that is set in a parameter file overrides a value for this property that is set at the session level or elsewhere.

The stopWorkflow command contains the following keywords:

--workflowName=workflow_name

Specifies the name of the running workflow that you want to stop. You can get the list of available workflows using the listAllWorkflows command.

--workflowInstanceName=workflow_instance_name

(Optional) Specifies the name of the workflow instance that you want to stop. You can get the list of workflow instances using the listAllWorkflows command.