Processing outbound messages with Node.js

19
Javascript on the server side Processing outbound messages with Node.js May 14th 2015

Transcript of Processing outbound messages with Node.js

Page 1: Processing outbound messages with Node.js

Javascript on the server sideProcessing outbound messages with Node.jsMay 14th 2015

Page 2: Processing outbound messages with Node.js

Aldo Fernandez Technical Consultant

@aldoforce

Page 3: Processing outbound messages with Node.js

Safe Harbor

Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.

The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, risks associated with possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal quarter ended July 31, 2011. This document and others are available on the SEC Filings section of the Investor Information section of our Web site.

Any unreleased services or features referenced in this or other press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.

Page 4: Processing outbound messages with Node.js

Follow UYSDUG for the latest news

@uysdug #uysdug

/Uruguay-Salesforce-Developer-User-Group/

www.uysdug.com

Page 5: Processing outbound messages with Node.js

Join us and share your knowledge!▪ Got something to share with the world?▪ We are open for talks/sessions▪ Check www.uysdug.com/cfp or get in contact with

someone from the Technical Board for more information

▪ UPCOMING EVENTS:▪ June (Ruby)*▪ July (Data Integration)*▪ August (OAuth2)*

Page 6: Processing outbound messages with Node.js

Agenda

▪ An outbound integration scenario example▪ Quick overview of Outbound Messages▪ Design considerations▪ Solution layout▪ Demo

Page 7: Processing outbound messages with Node.js

A process integration example

barkingtshirts.com ▪ yes, they are back!▪ Using EE▪ Requirement: for each closed won

Opportunity create an Order on the external ERP system so the process can continue. Keep a reference of the external id at Opportunity record.

Page 8: Processing outbound messages with Node.js

A process integration example

Salesforce org

Opportunity (closed/won)

ERP system

Create Order

Page 9: Processing outbound messages with Node.js

Moving data out of Salesforce

▪ Purpose▪ Sync▪ Extract only

▪ Timing▪ immediate▪ User/System can wait for results

▪ How▪ Manually /o\ (*horror_face)▪ ETL tools▪ Poll for changed records▪ Streaming API▪ Apex HTTP Callouts (sync/async)▪ Outbound Messages

Page 10: Processing outbound messages with Node.js

Outbound Messages

▪ Allows you to specify that changes to fields within Salesforce can cause messages with field values to be sent to designated external servers.

▪ Outbound messaging is part of the workflow rule functionality in Salesforce. Workflow rules watch for specific kinds of field changes and trigger automatic Salesforce actions, such as sending email alerts, creating task records, or sending an outbound message.

Page 11: Processing outbound messages with Node.js

Outbound Messages

▪ Originally created on the golden days of SOA▪ Defines a contract with WSDL▪ XML/SOAP based▪ Triggered by Workflow rules▪ Declarative friendly▪ Recommended method for outbound async process

integration (“Integration patterns overview”)▪ Used to implement the “Fire and Forget” pattern

Page 12: Processing outbound messages with Node.js

Fire and Forget

▪ A DML update or insert occurs on a given set of records in Salesforce

▪ A Salesforce workflow rule triggers based on a given condition

▪ This rule invokes a pre-configured OM that sends a SOAP message to a remote listener

▪ The remote listener receives the SOAP, places in a local queue and return positive ACK.

▪ Salesforce receives the ACK and completes the request. (It waits 10 seconds, then a retry is sent up to 24hs)

▪ In case remote app needs to perform operations against Salesforce a SessionID is provided to implement a callback

Page 13: Processing outbound messages with Node.js

Fire and Forget

ExpressJS MongoDB ERP

callbacknForce

Page 14: Processing outbound messages with Node.js

DEMO

(…or something like that)

Page 15: Processing outbound messages with Node.js

Response

Page 16: Processing outbound messages with Node.js

Processing

Page 17: Processing outbound messages with Node.js

Server console

Page 18: Processing outbound messages with Node.js

Resources + Kudos

▪ Jeff Douglas @jeffdonthemic “Salesforce outbound message catcher”

▪ Kevin O’hara @kevinohara80 “nForce”▪ “Integration Patterns and Practices” @salesforcedocs

(ebook)

Page 19: Processing outbound messages with Node.js

Thank You!

Javascript on the server sideProcessing outbound messages with Node.js

UruguaySalesforce Developer Group

May 14, 2015 #UYSDUG

Aldo FernandezTechnical Consultant

@aldoforce

#uysdug#javascript#nodejs#outboundMessages#integration