Monday, 23 February 2015

How to create the Email Task (Re-usable)

Why re-usable?. Becuase we’d be using the same email task for all the sessions in this workflow.
1. Go to Workflow Manager and connect to the repository and the folder in which your workflow is present.
2. Go to the Workflow Designer Tab.
3. Click on Workflow > edit (from the Menu ) and create a workflow variable as below (to hold the failure email address).
Failure Email workflow variable
Failure Email workflow variable
4. Go to the “Task Developer” Tab and click create from the menu.
5. Select “Email Task”, enter “Email_Wkf_Test_Failure” for the name (since this email task is for different sessions in wkf_test).
Click “Create” and then “Done”. Save changes (Repository -> Save or the good old ctrl+S).
6. Double click on the Email Task and enter the following details in the properties tab.
Create Email Task
Create_Email_Task


We’ve created the workflow variable $$FailureEmail and used it in the email task. But how and when is the value assigned?
You can manage the failure emails by assigning the value in the parameter file.
Here is my parameter file for this example. You can seperate multiple emails using comma.
While it might look like a simpler approach initially, hard-coding emails IDs in the email task is a bad idea. Here’s why.
Like every other development cycle, Informatica ETLs go thorugh Dev, QA and Prod and the failure email for each of the environment will be different. When you promote components from Dev to QA and then to Prod, everything from Mapping to Session to Workflow should be identical in all environments. Anything that changes or might change should be handled using parameter files (similar to env files in Unix). This also works the other way around. When you copy a workflow from Production to Development and try to make changes, the failure emails will not go to business users or QA teams as the development parameter file only has the developer email Ids.
If you use parameter files, here is how it would be set up in different environments once.
After the initial set up, you’ll hardly change it in QA and Prod and migrations will never screw this up.

Command Task in Informatica

Command task in informatica is used to run the shell / unix commands during the workflow. You can specify unix commands in the command task to remove rejected files, ftp files, creating files etc. We can use the command task in the following ways:
  • Standalone command task: Create the command task in the workflow or worklet to run linux commands.
  • Pre and post session shell command: You can run the unix commands by specifying them in the pre or post session shell command for a session task.
Creating Command Task

Follow the below steps for creating a command task:
  • Go to workflow designer or task developer. Click on Task in the toolbar and then click Create.
  • Select the Task Type as Command Task.
  • Enter a name for the command task and then click create->done.
  • Edit the command task.
  • Go to the commands tab and then click on Add button.
  • In the name field enter a name for the command and in the command field enter the shell command.
  • To add more commands click on the Add button.
  • Click on Ok to close the command task.
Note1: You can create a reusable or non-reusable command task.

Note2: If a shell command fails to execute, the command task runs the remaining commands and shows the status as succeeded. To change this behavior, in the properties tab check the option "Fail task if any command fails". Now when a shell command fails, the command task also fails and wont run other shell commands.

Note3: Shell commands are executed in the order you have specified in the Command task.

Usage of Command Task

The basic usage of Command task is to run unix / linux commands or shell scripts. Some usages of the shell commands in real world are listed below:
  • To transfer (ftp) file from remote server to the informatica server.
  • To archive the source files. Move the source file from one directory to another directory.
  • To clean up disk space by removing old files.


Sunday, 22 February 2015

How to work with Informatica Debugger

While loading data through Informatica, some time we come across situations where data is not loaded properly to the Target as per the transformation logic set. if you could track the data flowing from Source to Target then come to know where went wrong.
Use of Debugger:-
  1. Informatica Debugger is useful for testing and tracking errors in Informatica in run time.
  2. The data flow can be checked at each transformation level and can be modified for testing and analyzing
  3. Any valid mapping can be debugged to gain troubleshooting information about data and error conditions.
  4. No More Dummy Data / Flat Files are required for testing mapping
Debugger Session Types:
  • There are 3 types of Debugger Sessions
  • Debugger runs a workflow for each session type
    • Using an existing non-reusable session
    1. Existing source, target, and session configuration properties used
    2. The Integration Service runs the non-reusable session in the existing workflow
    3. The Debugger does not suspend on error
    4. Existing source, target, and session configuration properties used.