Wednesday, November 16, 2011

Stream Realtime Salesforce Support Status with Jetstream Challenge Results

The results of our Stream Realtime Salesforce Support Status with Jetstream challenge are in (don't miss the video at the bottom!) and the results couldn't be cooler. The challenge was to write a Java app using the Force.com Streaming API and Jetstream toolkit that displays a Google Map showing open salesforce.com support cases. As new support cases are opened and closed, they should appear and disappear from the map.

Sgurumurthy was the clear winner for this challenge! Along with his video below he submitted some super documentation. He even went so far as to reuse some of his code from his Cloudspokes Office Relocator challenge submission. A great use of componentized software if I may say so. Here is a small over of the technology and features of his submission but make sure you watch the video at the end.

The following software components are being used:
  1. Salesforce streaming API
  2. Jetstream: Streaming proxy for salesforce streaming API
  3. org.json Java JSON parser
  4. Salesforce REST API to get account information for a case
  5. OAuth to authenticate and authorize to Salesforce. This is required for Salesforce REST API call and for native Salesforce streaming API connection. Jetstream uses a FORCE_FORCEDATABASE_URL environment variable to get Salesforce connection information. 
  6. Embedded jetty webserver
  7. Google maps API to geocode an account address. I am reusing my Cloudspokes officerelocator challenge code for this purpose.
  8. Google Maps Javascript API to render Map, markers and info windows.
The application has the following features:
  1. Application can use native salesforce streaming API or Jetstream proxy. The mode is selected via environment variable STREAMING_API_USE_JETSTREAM. 
  2. streamingCases.jsp is the main application UI. It can be accessed at <application path>/streamingCases.jsp. It can also be opened in debug mode using the URL <application path>/streamingCases.jsp?debugMode=true. The debug mode can be used to test out the Javascript map api.
  3. Once the application is up and running and you have navigated to streamingCases.jsp, any case creation or update is shown on the browser as follows:
    • A Case with status New is indicated on the map with a yellow marker.
    • A Case with status Working is indicated on the map with a blue marker.
    • A Case with status Escalated is indicate on the map with a red marker.
    • The marker (hover) title depicts the subject of the Case.
    • The marker infowindow (on click on marker) depicts the address of the Case billing account.
    • If the Case is not associated with an account or if the account does not have a valid address, a text is displayed on the map indicating the case creation/update.



1 comment:

  1. Great submission. Amazing to see all the technologies being combined together. Hat Tip to Sgurumurthy.

    ReplyDelete