Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
richard_hirsch
Active Contributor
0 Kudos

Whenever I get developer access to a new environment, the first thing I do is try and integrate it with Apache Enterprise Social Messaging Environment (ESME) which is a collaboration environment for the enterprise associated with micro-messages and other activity streams content.
 
I’ve recently been access to the SAP River preview platform and decided to integrate this environment as well. “SAP River”  supports lightweight extensions to SAP’s on-premises ERP (enterprise resource planning) software [SOURCE] and is an important part of SAP’s new On-Demand strategy.

To help clarify where River fits into this strategy, I’ve identified where we are on SAP’s new OnDemand Strategy “Map”.
 
 
[SOURCE]

My Goal

My goal in this very early proof-of-concept was to explore River as a development platform and identify the ease of integrating this platform with other OnDemand tools.   Using ESME’s REST API, I quickly set up a custom action to send messages to ESME that reflected status changes in River records.

The following video provides details of the integration and shows how it works in realtime.  

At a very crude level, this functionality is similar to SalesForce Chatter where changes in business objects are sent to individuals’  activity streams. Currently, the POC shows the possibility of activity stream inclusion based on manual insertion of a custom action in a particular River application.  Ideally, there might be someway to have this available for different applications without having the necessity of including it manually in every application. I have yet to find out how or if this is possible in River. This is important functionality for developers providing functionality for a variety of customers. It is also central and typical of a PAAS environment.

Thanks are Due...

I’d like to thank Gigi Read and Juergen Schmerder for giving me access to the River Preview and Ethan Jewett for helping me with the CodeBox coding.  Jurgen also responded quickly to my irritating forum posts when I couldn’t find what I needed in the online River documentation.

Building on my POC

If you want to use my POC as the base for your own tests / explorations with River, here are the details.

Prerequisites

You will need an ESME token. 

  1. Go to the ESME Cloud instance and create a user or if already have a user, log-in.
  2. Go to “MyTokens” page
  3. Create a token.
  4. Use this token in your River Custom Action.

You will also need a user on the River Preview System.

If you want to get a headstart, I’ve added my test application to the River CodeX “Sample Apps” Project.  If you are a member of the Codex Project, you should be able to import the project - perhaps via URL - although I haven’t tried this yet.

Custom Action Code

var urlString = "http://esmecloudserverapache.dickhirsch.staxapps.net/api2/session?token=O1DSZT1U1KZY24KJXE2SNXGBTRECA4MYKT";
var request = $UTILS.http.createRequest(urlString, "POST");
var response = $UTILS.http.sendRequest(request);
var currInput = $CTX.getInput().getRecord(); 
default xml namespace =  $CTX.collection.getDefaultDataNamespace();
var inputXMLData = new XML(currInput.getData());
var fldvalue = inputXMLData.Test1.toString().replace(/\n/g,"");
var uservalue = inputXMLData.field.toString().replace(/\n/g,"");
var custname = inputXMLData.CustomerName.toString().replace(/\n/g,"");
$UTILS.log.info(uservalue);
$UTILS.log.info(custname);
var urlString2 = "http://esmecloudserverapache.dickhirsch.staxapps.net/api2/user/messages?via=SAPRiver&message=User+'"
+ uservalue + "'+has+changed+customer+data+-+the+new+description+is+'" + fldvalue +"' for customer '"+custname + "'";
var request2 = $UTILS.http.createRequest(urlString2, "POST");
request2.addHeader("Set-Cookie",response.getHeader("Set-Cookie"));
var response2 = $UTILS.http.sendRequest(request2);
$UTILS.log.info("response code is "+ response2.getResponseCode());
$UTILS.log.info("6 is " + response2.getBody().split("\n").join(""));
6 Comments