Skip to content

An example to connect intranet system from Force.com platform using Streaming API

Notifications You must be signed in to change notification settings

stomita/fdc-secureconnect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

Force.com SecureConnect

Abstract

Force.com (or its application, Salesforce) is a cloud environment which can store various business data or run transactional business logics.

Because the service is located entirely in the "cloud", it is difficult to cooperate with "intranet" systems which are behind the firewall, especially when the trigger occurs in Force.com side.

This project is an attempt to accomplish cloud-to-intranet messaging, without breaking firewall policies, by using Force.com Streaming API.

Architecture

See the slides:

http://www.slideshare.net/shinichitomita/cloudtointranet-messaging-by-forcecom-streaming-api

Setup

Deploy Force.com Classes

  1. Open ${project_root}/forcedotcom/.project in Eclipse with Force.com IDE.
  2. Deploy it to your desired Salesforce organization.

Setup MySQL Database

  1. First, please make sure you installed MySQL and mysqld is running

  2. Run SQL script to setup demo objects into MySQL database

$ cd ${project_root}/nodejs/sql $ mysql test < deptemp.sql $ mysql test < crbilling.sql

Startup SecureConnect resource server (Node.js)

  1. Please make sure you installed Node.js, npm, and coffee script.

  2. Install bundled libraries

$ cd ${project_root}/nodejs $ npm install

  1. Startup SecureConnect resource server

$ SF_USERNAME=user@example.org
SF_PASSWORD=password
MYSQL_USER=root
MYSQL_PASWORD=pass
MYSQL_DATABASE=test
coffee server.coffee

Demo

Simple Hello World

  1. Log in to Salesforce and access "SC Client" tab.
  2. Put your name to first text field and press "Hello" button.
  3. It pops up "Hello, <your name>" alert box.
  4. Confirm the resource server log that the message is arrived from request client.

Query to MySQL

  1. Log in to Salesforce and access "SC Client" tab.
  2. Put a SQL "SELECT * FROM EMP" to the second text field and press "Query" button.
  3. After a few seconds, it shows query result in a table in the page.
  4. Confirm the data is queried from local MySQL database by checking the resource server log.

Opportunity Propagation

  1. Log in to Salesforce and access to Opportunity tab.
  2. Creaate an Opportunity record and save.
  3. Update the opportunity to set Stage field value to "Close - Won" (or equivalent). Please also input field values like Amount or Close Date field.
  4. After a few seconds, refresh the page, and check that External System ID field has a value. If there's no field entry in the page, please change page layout to include the field.
  5. Confirm that MySQL database has a new record in billing table, including sfdc_id, name, amount, and close_date column data, which is copied from opportunity record in Salesforce.

About

An example to connect intranet system from Force.com platform using Streaming API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published