The Event Wait Task in Informatica will wait for a particular (or specified) event to occur. You can define an event for which this Event Wait Task should wait.
For example, you can create an event to check whether the Employee Source file (Text or CSV) is available at the Source location or not. It means, Event Wait Task will wait for Employee, and once it is found the task will succeed and the next task will be executed.
In this article, we will show you, How to use Event Wait Task in Informatica with an example. For this example, we are going to use below show text file data (Employee table). From the below screenshot you can see that the Source table has 15 records
and the Destination table is Employee File. As you can see, it is an Empty table
Event Wait Task in Informatica Example
In order to do so, we have to provide the Informatica Admin Console credentials. So, Please provide the appropriate Username and Password, and click the Connect button.
TIP: Here you have to provide the Admin Username and password that you specified while installing the Informatica Server.
Step 1: Create Source Definition for Event Wait Task in Informatica
Once you connected successfully, Please navigate to Source Analyzer to define your Sources. As we said before, we are using Employee table present in the local File System as our source definitions.
TIP: We already explained the steps involved in importing a Text file in our previous article. So, Please refer Flat File Source in Informatica to understand the same.
Step 2: Create Target Definition for Event Wait Task in Informatica
Please navigate to Target Designer to define the Target. In this example, we are using the existing SQL table (Employee File) as our target definition. You can refer to Create Informatica Target Table to understand the process of creating a target definition
Step 3: Create Mapping for Event Wait Task in Informatica
To create a new mapping, Please navigate to Mappings menu in Menu Bar and select the Create.. option. Once you select the Create.. option, a new Mapping Name window will be opened as shown below. Let me provide m_EventWait as the mapping name and click OK button.
TIP: Please refer Informatica Mapping article to understand the procedure to create Mapping
Drag and drop the Employee source definitions from Flat File Sources folder to the mapping designer. Once you drag the source, Power Center designer will automatically create the source qualifier for you. I suggest you refer the Source Qualifier Transformation article
Next, Drag and drop the target definition (Employee File) from Targets folder to the mapping designer. Next, connect the source qualifier with the target definition. Please use the Autolink.. option to connect them.
Before we close the Mapping, Let us Save, and Validate the mapping by going to Mapping Menu bar, and select the Validate option.
Step 4: Create a Workflow for Event Wait Task in Informatica
After you finish creating the Mapping, we have to create the workflow for it. PowerCenter Workflow manager provides two approaches to create a workflow.
In this Informatica Event Wait Task example, we will create the Workflow manually. To do so, Please navigate to Workflows Menu and select the Create option.
This will open Create Workflow window as shown below. Please provide the unique name (wf_EventWait) and leave the default settings.
Once we created the workflow, our next step is to create a session task for our mapping.
Step 4(a): Create a Session for Event Wait Task in Informatica
There are two types of sessions in Informatica:
For this Informatica Event Wait Task example, we created a Non-reusable Session. In order to create Non-reusable Session, Please navigate to Tasks Menu and select the Create option as shown below.
Please provide a unique name for this session. Here, we are naming it as s_EventWait. Once you click on the Create button, a new window called Mappings will be opened. Here you have to select the mapping that you want to associate with this session i.e., m_EventWait.
Within the mappings tab, we have to configure the Source and Target Connections. First, let us configure the Source connection by clicking on the SQ_Employee present in the Sources folder.
- Source File directory: Informatica will use the default directory but you can change the directory by giving the full path. For example, D:\File Examples\
- Source filename: It will automatically detect. if not, Please specify the file name along with the extension.
Now we have to configure the Target connection. So, first select the EmployeeFile present in the Target folder. Next, within the Connections, click on the Arrow button beside the Relational type, and select Informatica Target
Step 4(b): Create an Event Wait Task in Informatica
In order to create an Event Wait Task, Please navigate to Tasks Menu and select the Create option as shown below.
Once you select the Create option, a new window called Create Task will be opened as we shown below.
First, select the Informatica Event Wait Task from the drop-down list. Next, provide a unique name for this task and click on the Create button to create a New Event Wait. Here, we are naming it as WaitFor_TestFile.
Double click on the Event Wait task will open the following window. Within the General Tab, we can rename the Event Wait Task to a more meaningful name. Please do not forget to provide a valid description of the Task.
Fail Parent if this task fails: Please check mark this option. If this Informatica Event Wait task fails then it will fail the workflow.
Within the Informatica Event Wait Task Events tab we have two options:
- Predefined: If you select this option, you have to define the event
- User Defined: You have to select the existing Event
As you can see, if you select the User-defined event, it is opening the Event browser. As w don’t have any existing event, it displays an empty window.
For this example, we are selecting the Pre-defined option and providing the path of an Employee text file. It means, Event Wait Task will wait for Employee text file (at that location) and once it is found the task will succeed
Next, navigate to Workflows Menu and select the Validate option to validate the Workflow. If you observe the workflow, First we are starting the Workflow, Next, it will wait for Employee file (Event Wait Task), and if it is found then Session task will load data from text file to SQL table.
Before we start running the workflow let me delete the Employee text file from the Source location.
Now, Let me start the Informatica Event Wait Task Workflow. To do so, navigate to the Workflows menu, and select the Start Workflow option.
As you can see the status, the Workflow is running infinitely.
Once you add the Employee text file at the location Workflow will succeed.
Thank You for Visiting Our Blog