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, Informatica Event Wait Task will wait for Employee, and once it found, the task will succeed, and the next task will execute.
For this Informatica Event Wait Task 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
Before we start configuring the Event Wait Task in Informatica to Load Data from Text File to SQL Server. First, let me connect with the Informatica repository service.
To do so, we have to provide the Admin Console credentials. So, please enter the Username and Password you gave while installing the Server, and click the Connect button.
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 to Flat File Source 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 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 the Mappings menu in Menu Bar and select the Create.. option. Let me provide m_EventWait as the mapping name and click the OK button.
Drag and drop the Employee source definitions from the Flat File Sources folder to the mapping designer. It automatically creates the Source Qualifier Transformation for you
Next, Drag and drop the target definition (Employee File) from the Targets folder to the mapping designer. Next, connect the source qualifier with the target definition using the Autolink.. option.
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 Informatica Event Wait Task 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.
It opens the Create Workflow window. 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.
Create a Session for Event Wait Task in Informatica
There are two types of sessions:
For this Informatica Event Wait Task example, we created a Non-reusable Session. To create Non-reusable Session, Please navigate to Tasks Menu and select the Create option.
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 open. 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: It 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 choose target
Create an Event Wait Task in Informatica
To create an Event Wait Task, Please navigate to Tasks Menu and select the Create option.
Once you select the Create option, a new window called Create Task will open.
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 predefined option and providing the path of an Employee text file. It means, Event Wait Task will wait for an Employee text file (at that location) and once it found the task will succeed
Next, navigate to Workflows Menu and select the Validate option to validate the Workflow. If you observe the Informatica Event Wait Task Workflow, First, we are starting the Workflow. Next, it waits for Employee file (Event Wait Task), and if it found, 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.
Let us open the SQL Server Management Studio and write the following SQL Query.