Data migration tasks often require us to move records that are dependent on each other or linked with foreign keys. Since those connections are mostly modeled with the primary keys of those entities, we are forced to migrate those records in a particular order. We need to get the IDs of the entities in the new system, first, before we can use those keys to link them with their dependent entities. A common example would be the migration of accounts, including their associated contacts. We first move the accounts over to the new system. In the next step, we migrate the contacts and use an account lookup to determine the IDs of their associated accounts within the new system. We then can use those IDs to populate the account ID field in the new contact records.
In Informatica we have two ways to process this type of sequential mapping.
1. Task Flows
The most obvious choice for this problem is the use of task flows. We simply create two individual mappings. One that takes care of the accounts and another processes the contacts. We can now create a task flow that executes both mappings in a sequence. We can manage our task flows by clicking Design/Task Flows in the navigation bar.
During the creation of a new task flow, we can specify a name, description or schedule and create a list of data mappings or data synchronization tasks, including their execution order. We can also determine how the sequence needs to react if one task in the chain produces warnings or errors.
This is an example task flow that moves some accounts and contacts from flat files to Salesforce.
2. Single Mapping
A lesser known way to enforce a particular execution order is to take advantage of the way Informatica processes mappings. With this technique, we can perform all the tasks with one single mapping. This has the advantage of nicely encapsulating dependent operations without having to rely on multiple mappings that could potentially perform incomplete operations when executed on their own. We also don’t need an orchestrating task flow. The trick is quite simple: we can have multiple data flows in one mapping consisting of multiple sources and multiple destinations. As long as they are completely separate from each other, Informatica will treat them as individual mapping processes. Those processes are executed in a sequential order. The order is determined by the relative position of the top sources of each individual process, executed from top to bottom.
Here is an example of a mapping with two individual data flows that migrate accounts and their contacts from flat files to Salesforce. Accounts gets processed first because the account source is above the source for the contacts. By carefully placing the source objects in the correct vertical order, we can easily control the execution order for two or more individual data flows.
About the Author:
TopLine Strategies delivers the complete integration and development of sales, marketing and customer service technologies that enable corporate clientele to improve revenue streams and strengthen customer interactions. Our project management and consulting is designed to achieve timely delivery, 100 percent user adoption of the technologies we implement and deliver measurable returns on investments for our clients.