mrinal.wadhwa

4 Posts

Last week at TechEd Bangalore, Marilyn Pratt and I were having a conversation about Gravity – Collaborative Business Process Modelling within Google Wave, we talked about how innovative it was and how such collaborative user interfaces could be useful in various different business applications, in addition to just BPM. During this discussion, I expressed to her that I don't understand why Google Wave was chosen as a platform for building Gravity ... don't get me wrong, I really like Wave and I'm very excited about its potential, but at the same time I realize that Wave will probably not become a reality in our workplace for another few years. Gravity, on the other hand is something people have a need for today and that is the reason I wonder why it was not built on a platform that can be delivered sooner.

Looking at the Gravity – Collaborative Business Process Modelling within Google Wave I can make out that the core functionality Gravity needs from Wave is the ability of keeping multiple clients synchronized to create a realtime collaborative environment, which is what makes me wonder, since creating such an environment should be feasible outside of Wave, I'm thinking XMPP, JMS or even a simple custom protocol.

Later that night, I spent some time actually writing a rudimentary prototype of such a server. I've been learning Erlang for the past month or so and creating such a server seemed like an interesting learning exercise. So 47 lines of erlang code later, here's what I had ...          

 


As you watch the above video, note as I drag a rectangle in any one Flash application, its sends messages to the server and the server multicasts those messages to other connected clients and those clients update in almost realtime. While in the example above all the application instances are running on the same system, they could just as easily be running on different system in the browser and still communicate via the server.
 
Here's the code for the Erlang server ..
 
 

Click to download code

  

This ability of having realtime synchronized clients, as I understand it, is the primary ability that Gravity needs from Wave which is why I'm puzzled.
 
It should be feasible to build Gravity's realtime messaging on top of existing solutions like Adobe's Lifecycle Data Services, XMPP or even custom protocols like a more elaborate version of the code I wrote above, so I wonder what were the reasons to choose Google Wave as the base for building Gravity. I'm also curious if Gravity's messaging layer is replaceable with some other protocol, if so, then I would love to know if the team behind gravity is considering any other such options.
 

As I read through Mogens Enevoldsen's post about Use SAP Flash Island/Adobe Cocomo to build a social network in SAP I was reminded of my own little experiment that I did while at TechED Bangalore but totally forgot to write about ....  

 

First a little context ...

Flash Islands is a new feature in SAP Netweaver 7.0 Enhancement Pack 1 that allows you to embed Flash Movies inside Web Dynpro interfaces. The Web Dypro part of the interface can interact seamlessly with Flash and vice versa. This enables some very exciting ways of extending your SAP user interfaces. http://www.ribbit.com/platform/

Ribbit is a web service that enables making phone calls from a Flash client.    

 

As I sat through SDN Community Day Mentor Hands-On Workshop at TechED and learned about the new features coming in Web Dynpro .. I was very excited and felt this urge to get my hands dirty. So, next day morning, I sat at the Community Clubhouse and started writing my very first Flash Island .... an Island that would let you make phone calls from Web Dynpro apps using Ribbit. I can think of several workflows where it would make sense for a user to be able to call a number by just clicking a button in his SAP screen instead of having to to pick up the phone.  

 

http://www.ribbit.com/platform/

My limitation ...

Before I could build this though, I had one limitation ... No SAP system :) ... so no way to actually test what i was building .. so I decided I will have to finish building it before that day ends so that I can get one of the guys there at TechED to test it with Web Dynpro inside an SAP system. Now since Web Dynpro at runtime is HTML and JavaScript I created a simple JavaScript file to act as my test harness during development.  

 

Flash Islands from a Flex developer's perspective

So what are Flash Islands? and how do I build one ... here are a few observations I made as I got started ...
         
  1. Web Dynpro at runtime is HTML+JavaScript
  2.      
  3. A Flash Island is a SWF embedded inside this HTML page
  4.      
  5. Since this is a SWF it can be a child of either Sprite or MovieClip
  6.      
  7. This SWF has to link in a library (SWC) provided by SAP to be able to communicate with the Web Dynpro container
  8.      
  9. This library, internally, I can assume uses Flash Player's ExternalInterface to communicate with the Web Dynpro (HTML+JS) container
  10.      
  11. The first thing you have to do is register your SWF with Web Dynpro by calling ...
    FlashIsland.register(this);
    The FlashIsland class is present in the SAP provided library that we linked in.
  12.      
  13. The SWF can fire events that the Web Dynpro container can listen to ... these events are fired using ...
    FlashIsland.fireEvent(this, "string_to_identify_event");
  14.      
  15. The container can set and read public properties of this SWFs document class
  16.      
  17. The callback mechanism available in ExternalInterface has not been used, so Web Dynpro can't call methods of the SWF
  18.      
  19. Since Web Dynpro can't call methods of the SWF I will have to use a setter of a public property to invoke things inside the SWF

I'll not get into the details of how to use the Ribbit API, there is enough documentation on that at the Ribbit Developer Site

At this point I had enough to get started with writing code ...  

 

Some fun in between ..

While I wrote my code sitting at the Community Clubhouse, Craig recorded the Live from Bangalore episode of Friday Morning Report .. he did mention what i was doing and you can even see a preview of the code working at around the 15th minute of the podcast.    

 

The first attempt that did not work ...

View Source

Based on my observations above I started writing the Island as a pure ActionScript project with Sprite as the base class and everything seemed to work fine. As you can see in the podcast, the code was making phone calls. But, this was with my JavaScript test harness, later I showed the code to Thomas Jung, who very kindly agreed to help me test it in an SAP system.. at this point TechED had come to an end and I was kinda convinced that my code would work so I sent it to Thomas for trying out.

A few days later he emailed back saying that the code won't work in the state that I had sent it to him.  FlashIsland.register method expects the document class of the SWF to be a Flex Application. I was slightly surprised to find this out since I can not figure out why FlashIsland would need to be dependent on mx.core.Application. FlashIsland needs ExternalInterface to make the communication with the Web Dynpro container happen and ExternalInterface is a flash player API and does not need the Flex framework. The only possible reasons I can guess are ..

         
  1. The debugging capabilities of FlashIslands that Thomas mentioned in his workshop are some how dependent on the Flex framework
  2.      
  3. Or, FlashIslands framework somehow uses the Binding capabilities of Flex

Both these reasons I don't think justify the cost of including the Flex Framework .. I'm pretty sure this adds at least 200k to 300k to the size of the SWF.  I mentioned this to Thomas and he said he would discuss this with the Web Dynpro team. Even if there is a valid reason to be dependent on Flex I would really like it if SAP would release a light weight version of the SWC that does not use the Flex Framework.  

 

The Flex version ...

Given the above limitation I later refactored the code to use mx.core.Application as the document class, I haven't seen it work since I still don't have access to an SAP system but Thomas told me that he was able to get it working with some tweaking. I'm sharing the source here hoping that it would help someone understand Flash Islands better and maybe someone would even use it in a real application. Please do let me know if you do that. The source is shared under the MIT license so please do feel free to use it in any way you find useful.

View Source 

A special thanks to Thomas Jung for his help.   

I had a lot of fun at the RIA track last year at Community Day... Raghu and I led a session that got into the basics of Flex and AIR and we also showed some real life examples. I kinda ate into Craig's time who was nice enough to move his talk on Twitter+Netweaver into the hall (Thanks Craig) .. Thomas Jung's talk on FLOB and Arvind's talk on the Zoho API were both awesome.

 

A lot of exiting things have happened in the RIA world in the last year, so lets meet again at Community Day ... I've proposed an RIA Birds of a Feather session at the SDN day wiki but I'm looking for suggestions on what specific topics everyone wants to talk about. If most people attending are beginners then we could have a talk on the same lines a last year that could get into the basics of Flex and AIR .. we could get hands on and maybe build some simple applications. If people are interested in a more advanced topic then maybe we could talk about Flex Component Development or some other topic of that sort. I'm open to any suggestion so do let me know what you would like the talk to be about.

 

So what are you waiting for.. sign up to attend Community Day ...

SignUp Here

Mrinal Wadhwa

Hello World !

Posted by Mrinal Wadhwa Oct 23, 2008

This is my first blog post here on SCN so I thought, let me introduce myself to everyone and say "Hello World".

My name is Mrinal Wadhwa, I live Bangalore, I'm addicted to music and coffee.. and I build Rich Internet Applications (RIAs). Some of you may ask .. what are Rich Internet Applications? .. while there are many definitions on the web, I like to decide if something is an RIA or not based on the following criteria ...

 

  1. It has to be an Application ... something that deals with dynamic data, takes an input and processes it to produce valuable output.
  2. Its primary function should be to deal with data that lives on the Internet (or intranets).
  3. It should offer a user experience that is Richer than what we’ve been used to in the past in a particular environment.              
If a piece of software satisfies the above criteria, in my opinion, its an RIA. If you think about these points for a little bit, you’ll quickly realize that “RIA”, even though a fairly new buzzword, is not a new concept .... Microsoft Outlook, Yahoo Messenger, Gmail etc are all RIAs that came out several years ago. After some more thought, you’ll realize that in today’s context majority of applications that we build have something to do with data that lives elsewhere on the network, therefore the dominant factor that defines an RIA is the richness of the experience users have while using it. So if we oversimplify, RIAs are applications built with special attention to user interface and user experience.

 

Many modern interface development technologies have been labeled as Rich Internet Application Technologies .. these include AJAX, various Javascript libraries and frameworks, modern browsers, Gears, Flex, Flash Player, AIR, Silverlight, JavaFX etc .. while these technologies facilitate building an RIA it does not automatically imply that everything built with them is an RIA ... in fact, it is very easy to build a Not So Rich Internet Application ( NSRIA :D ) with these so called RIA technologies. At the same time, it is important to note that the use of these technologies is not a prerequisite to building an RIA either.

As you can see, I love talking about RIAs and that is what I do on my blog ... my posts here on SCN will be focused on the use and impact of RIAs and RIA technologies in the enterprise space. The increasing popularity of Flex in the SAP world is a strong indicator of the future of RIAs in the enterprise and I plan to use this space to learn and share knowledge on this subject. 

 

Apart from RIA, I also plan on using this SCN blog to to talk about ESME, my role in the ESME team has been primariy around building clients.. I developed the AIR based desktop client and I'm now working on our new Web interface that is still in development ..so I hope to write about the technologies/techniques used in building the clients, possible use cases and also share my experiences  working in the Community serendipity delivers value

 

I hope you all enjoy what I write and I look forward several fun filled discussions.

 

If you wish to talk or learn more about RIAs, please do join us at the RIA Birds Of a Feather session at Community Day, Bangalore. Register Here