Saturday, January 29, 2011

Create Business Processes, Human Tasks, with many other features


Suppose you need to write a business process/human task with some quality of service features like security, throttling caching etc. Or suppose you need inject ESB characteristics like service mediation, routing, load balancing, message enrichment etc. to incoming and outgoing message sequences.
Now what if you can do all these stuff with one server instance without using different products for different requirements, isn't it great?
WSO2 Carbon is capable on this due to its component architecture. Not only that you can do these stuff using Carbon UI very easily.
Due to WSO2 Carbon's OSGi based component architecture, you can customize WSO2 products based on your requirements.

Here I'm writing about how those stuff can be done in a very high level.

1. Security, Caching, Throttling to Business processes/Human tasks.
WSO2 BPS is inherently support this, and you can use the BPS Web UI to configure, monitor and maintain business processes with these features. The more interesting thing is; the whole set of WSO2 carbon products, have this unique interface. So once you get familiar with one product, you can use other products very easily. As an example, to enable throttling to service mashup, data service or SOAP service etc, user sees an unique interface.

Here are some screen-shots of the service dashboard.

Main service dashboard

Security configuration

Throttling configuration

Caching configuration

Try-it configuration


2. How to embed ESB like features
How to install ESB features - To use WSO2 ESB features what you need to do is install ESB related features to BPS. But I would prefer install BPS features into ESB as the number of BPS features are less than ESB features. As any WSO2 product is a set of OSGi components; there is no any difference in installing BPS features to ESB product and installing ESB features to BPS product.

Here is a screen-shot of feature management page


Now if you are already familiar with WSO2 ESB; using ESB features on business processes/ human tasks is no different from using ESB features on any other service.
eg - writing a proxy service for a business process and use message mediation in in-sequence and out-sequence. etc

Friday, January 28, 2011

How to reuse Eclipse EMF.edit to write GEF editors


If you are into Eclipse Plugin development you’ve definitely heard of Eclipse Modeling Framework (EMF).
EMF provides a framework to define, code-generate, extend etc, for user-defined structured data models.
There are various ways to define the data model. One example would be using a define data model in XSD and use EMF to code generation.
EMF handles the code-generation of the model as well it also generate a general GEF based editor to manipulate the model instances using a tree-view, list-view, table-view etc.
Apart from it EMF provides many features to seamlessly extend the model.

This blog-post talks about the basic initial steps to implement a eclipse editor using EMF.edit package. If you are not that much familiar with EMF.edit refer this documentation.

Few features provided by EMF.edit is
  1. Content provider and Label provider
  2. Property Source
  3. Command framework
  4. Change notifier
1. Content provider and Label provider
These classes are used to represent data to the end-user. Here I’m not going much deeper. I’ll show you a code snippet that can be used on top of EMF.edit code and reuse the content and label providers used by the EMF framework.

adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
adapterFactory.addAdapterFactory(new NamespaceItemProviderAdapterFactory());

TableViewer notificationsTableViewer;
notificationsTableViewer = new TableViewer(parent, SWT.SINGLE);
notificationsTableViewer.setContentProvider(new AdapterFactoryContentProvider(adaptorFactory));
notificationsTableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adaptorFactory));
notificationsTableViewer.setInput(notifications);

2. Property Source
Property source provider is used to represent the properties involved with a particular model object. In EMF.edit the item provider classes implements org.eclipse.emf.edit.provider.IItemPropertySource.
Here is a code snippet that can be used to integrate property source providers generated from EMF framework.

propertySheetPage =new PropertySheetPage ();
propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory));

If you go into provider classes generated from EMF.edit, you’ll see those classes have three methods, that implement the interface IItemPropertySource.

List getPropertyDescriptors(Object object);
IItemPropertyDescriptor getPropertyDescriptor(Object object, Object propertyID);
Object getEditableValue(Object object);

So you can reuse/study the above three method implementations to represent properties for each element.

3. Command Framework
If you have heard of Eclipse Command Framework, you’ve already realized how it is easy and cool to use eclipse commands to edit the EMF model objects.
Here’s a sample code to add a new element to the parent. This code is not general for all commands. So you may need to refer some documentations on this.

Group group = _200803Factory.eINSTANCE.createGroup();
group.setName(“Group Name”);
List<group> list = new BasicEList<group>();
list.add(group);
 
Command addGroup= AddCommand.create(domain, group, _200803Package.eINSTANCE.getGroups_Group(), list);
if(addGroup.canExecute()){
  domain.getCommandStack().execute(addGroup);
}else {
  System.out.println("Cannot execute");
}

4. Change notifier
In EMF.edit framework item provider adapters extends ItemProviderAdapter class which extends AdapterImpl. The method NotifyChange() is implemented in order to notify the viewers related to changes occurred to a model.

public void notifyChanged(Notification notification) {
  updateChildren(notification);
  switch (notification.getFeatureID(TExtensibleElements.class)) {
    case _200803Package.TEXTENSIBLE_ELEMENTS__DOCUMENTATION:
    case _200803Package.TEXTENSIBLE_ELEMENTS__ANY:
    case _200803Package.TEXTENSIBLE_ELEMENTS__ANY_ATTRIBUTE:
    fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
  return;
  }
  super.notifyChanged(notification);
}

Take a look at the code of this method, you will find, fireNotifyChange() method is called with a parameter ViewerNotification, this method is defined in ItemProviderAdapter which implements the interface “IChangeNotifier”, both the viewers and property sheets are the listener of the IChangeNotifier (using addListener and removeListener method provided by ItemProviderAdapter to register as a listener of the item provider), and in the changeNotifier.fireNotifyChanged(notification) method will called all the listener’s notifyChange() method.

public void fireNotifyChanged(Notification notification) {
  if (changeNotifier != null) {
    changeNotifier.fireNotifyChanged(notification);
  }

  if (adapterFactory instanceof IChangeNotifier) {
    IChangeNotifier changeNotifier = (IChangeNotifier)adapterFactory;
    changeNotifier.fireNotifyChanged(notification);
  }
}

Saturday, January 15, 2011

WSO2 Annual Award Ceremony 2010


WSO2 Annual Award Ceremony 2010; was held at Kings Court, Cinnamon Lakeside, Colombo on 14th January 2011. The most tremendous contributors in WSO2 were honored. I personally congratulate all of them for a better future. You can Google them if you wanna know more about them :).
  • Afkham Azeez
  • Supun Kamburugamuwa
  • Thilina Mahesh Buddhika
  • Milinda Pathirage
  • Saminda Wijerathne
  • Chathuri Wimalasena
  • Hiranya Jayathilaka
  • Prabath Siriwardena
  • Kasun Indrasiri
  • Asanka Abeysinghe
  • Sumedha Rubasinghe
  • Selvaratnam Uthaiyashankar
  • Samisa Abeysinghe
  • Senaka Fernando
  • Charitha Kankanamge
  • Evanthika Amarasiri
  • Krishantha Samaraweera
  • Chamith Kumarage
  • Nirosh Perera
  • Janath Sivayoganathan
  • Hasmin AbdulCader
  • Udeshika Ratnavira
  • Devaka Randeniya
  • Padmika Dissanaike
As well I congratulate all the WSO2 team members who are very supportive to each other.

Friday, December 31, 2010

Horizontal Format Data Mining with Extended Bitmaps


My colleague Kathiravelu Pradeeban and the team; Buddhika Alwis, Supun Malinga and I presented the following slides at the 2nd International Conference of Soft Computing and Pattern Recognition, France.

Paper abstract -
Analysing the data warehouses to foresee the patterns of the transactions often needs high computational power and memory space due to the huge set of past history of the data transactions. Apriori algorithm is a mostly learned and implemented algorithm that mines the data warehouses to find the associations. Frequent item set mining with vertical data format has been proposed as an improvement over the basic Apriori algorithm.
In this paper we are proposing an algorithm as an alternative to Apriori algorithm, which will use bitmap indices in conjunction with a horizontal format data set converted to a vertical format data structure to mine frequent itemsets leveraging efficiencies of bitmap based operations and vertical format data orientation.


Mooshabaya: Mashup Generator for XBaya


Last November, I and my team; Buddhika Alwis, Kathiravel Pradeeabn, Supun Malinga presented the following slides at the 8th International Workshop on Middleware for Grids, Clouds and e-Science - Middleware 2010, India.

Paper can be found in http://portal.acm.org/citation.cfm?id=1890807

Paper abstract -
Visual composition of workflows enables end user to visually depict the workflow as a graph of activities in a process. Tools that support visual composition translate those visual models to traditional workflow languages such as BPEL and execute them thus freeing the end user of the need of knowing workflow languages. Mashups on the other hand, provide a lightweight mechanism for ordinary user centric service composition and creation, hence considered to have an active role in the web 2.0 paradigm. In this paper, we extend a visual workflow composition tool to support mashups, thus providing a comprehensive tooling platform for mashup development backed up by workflow style modeling capabilities, while expanding the reach of the workflow domain into web 2.0 resources with the potential of the mashups. Furthermore, our work opens up a new possibility of converging the mashup domain and workflow domain, thus capturing beneficial aspects from each domain.


Saturday, December 25, 2010

Twinkle lights - Eiffel Tower


The Eiffel tower twinkles for few minutes on the hour beginning after dark. I was able to see it four times in different angles. I've heard about it before, but couldn't imagine something like that. I filmed it for few seconds but this HD clip has captured its charm very nicely. Just ignore background voices for a moment :).






Wednesday, December 22, 2010

Louvre Museum: Paris


Few days back I went to Louvre museum, Paris; which is the largest art museum and the most visited museum in the world with over 35,000 exhibits. If you take different routes at the entrance, you can dive into different civilizations like Egyptian antiquities, Near Eastern antiquities, Greek, Etruscan, and Roman masterpieces etc. It's really amazing how they collected that amount of masterpieces like Mona Lisa(La Joconde), Venus de Milo, The Wedding Feast at Cana etc., over several centuries.


At the entrance

I guess it would take at least a week to visit the whole museum. As we even didn't have a single complete day, we managed to visit the most famous exhibits.
My favorite exhibit was The Wedding Feast at Cana which is the largest painting I've ever seen. The artist was Veronese(also Paolo Caliari, 1528-1588) who crowded 130 figures into this almost 10 meters-high painting.

The Wedding Feast at Cana

There were other quite beautiful paintings as well. But the Mona Lisa is the Louvre's most popular attraction. Another place, I liked most was the Napoleon's Apartments.

Napoleon's Apartments