You can follow Trey Roldan on Twitter.
Informatica has added long awaited real time integration capabilities in their latest summer release. Their cloud integrations are no longer bound by scheduled jobs, they can now be called in real time as needed. The latest release incorporates a full-featured REST API that seemingly performs as a cloud integration bus for outside SaaS platforms.
Here are a few examples of how real time integration might be used:
• Obtain a customer number from an outside system when a prospect is converted to an account
• Send sales information to a data warehouse enabling real time analytics
• Send an order to a warehouse for real time order fulfillment
The benefits of this new capability are endless. Real time means there is no time lapse or waiting, critical integrations can occur instantaneously without a reliance on batch schedules.
In this post I will be demonstrate a real time integration originating in Salesforce.com which will call an Informatica job to send closed opportunities (orders) to a warehouse for fulfillment. We have an existing Informatica integration called OrderFulfillment that we want to call in real time via a Salesforce trigger:
.png)
The first step is to create an Apex class to call the Informatica REST webservice. For this we have created an Apex Class called OrderIntegration. We have defined the class to run asynchronously to help prevent callout timeouts. Note that the query below is based on a pre-release version of the Informatica REST API, some of the parameters may change in the final release. We are using the standard HttpRequest class to call out to the Informatica REST service. As we are attempting to submit a job for processing, we will be doing a POST calling runjob which allows us to run any IoD integration job remotely.
public with sharing class OrderIntegration { @future (callout=true) public static void runjob(String username, String password, String jobName, String jobType) { HttpRequest req = new HttpRequest(); HttpResponse res = new HttpResponse(); Http http = new Http(); req.setEndpoint('https://app.informaticaondemand.com/saas/api/1/runjob'); req.setMethod('POST'); req.setBody('username='+EncodingUtil.urlEncode(username, 'UTF-8')+ '&password='+EncodingUtil.urlEncode(password, 'UTF-8')+ '&jobName='+EncodingUtil.urlEncode(jobName, 'UTF-8')+ '&jobType='+EncodingUtil.urlEncode(jobType, 'UTF-8')); try { res = http.send(req); } catch(System.CalloutException e) { System.debug('Job Error: '+ e); System.debug(res.toString()); } } }
Next, we will need to add the Informatica remote endpoint to our remote sites from within Salesforce. This will enable our callout to access the third party site:
Setup -> Security Controls -> Remote Site Settings

Finally, let's create a trigger on the opportunity object to call the integration each time a new opportunity record is created. Note that we have left out any business logic or integration transformations in our Apex code — all of the heavy lifting is done by the existing Informatica job. There are four parameters passed to our method, our IoD username & password, the job Name (the name of the Task), and the job type (DSS is equivalent to Data Synchronization Service).
trigger realTimeIntegration on Opportunity (after insert) {
for (Opportunity o : Trigger.new) {
OrderIntegration.runJob('username@email.com','Password123','OrderFulfillment','DSS');;
}
}
That's it! We've used Informatica's new REST API to quickly create a real time seamless integration between Salesforce.com and our order fulfillment system. I'm looking forward to this and many other great features of Informatica's summer release which will be available at the end of May '11 http://www.informaticacloud.com/products/323-summer-11-whats-new.html.

