Monday, November 21, 2011

Lifecycle Management of SOA Artifacts for WSO2 Products

This is about another webinar we(Sadeep and My Self) did recently. Here we demonstrated how WSO2 products interact with each other and how to use WOS2 Governance Registry's lifecycle management feature to manage SOA artifacts in different environments. We addressed the following use case (problem) in this webinar.

To give you a more detailed description about the exact problem we addressed in this webinar: Say that we have 3 ESB environments, namely "Dev","QA" and "Prod". In these environments, development work is done on the "Dev" and for testing purposes the artifacts under "Dev" environment should be moved(copied) to the "QA" environment. Once the QA work has been done, the artifacts in the "QA"environment should be moved(copied) to the "Prod" environment. We need a way to automate this to some extent so that we have minimum user interactions in this process. 

The solution we proposed was to introduce the WSO2 Governance Registry as a control mechanism to this process. In that solution all the 3 ESB environments are taking to a WSO2 Governance Registry and each of these ESB environments will look there SOA artifacts from the registry. We used the concept call "registry mounting" in such a scenario and each of the 3 ESB instances are mounted to 3 different collections in the registry.




Then the Governance Registry uses its lifecycle management feature to move the SOA artifacts from one environment to another. We use a simple lifecycle with 3 states (Development, QA and Production) and in each state transition, we copy the contents to the next environment.


For demonstration purposes we use an environment where we have 3 ESB instances and each of these instances were mounted to a Governance Registry. We created a proxy service in the "Dev" environment and used the deployment synchronizer feature of WSO2 products to persist it to the Governance Registry. During the demo session we demonstrated how to apply the lifecycle to the collection where the resources are stored in and when we do a "Promote" action how the resources are moved to the next environment. Using the deployment synchronizer, the ESB instance in the QA environment was able to find the new proxy service(that was copied to the "QA" location in Governance Registry) and deploy it in that instance. 

Here I have given an overview of the webinar and you can find more details about this including the webinar slides and the complete recording using [1]. I would also like to thanks Chanaka and Sadeep for their efforts on making the slides. 



Monday, September 12, 2011

My First Webinar

Few weeks back I got the opportunity to conduct a Webinar for the first time in my life. It was an wonderful experience for me and I thought of sharing some of it with you.

Day : Thursday, August 11, 2011 
Topic : Service Governance with the WSO2 Governance Registry
PresentersJanaka Ranabahu and Isuru Wimalasundera

In here, I'm not going to discuss in detail about what we did on the webinar and what are the capabilities of the latest WSO2 Governance Registry. Instead, I'm trying to give an abstract of the webinar that we did. 

The webinar was conducted by myself and one of my colleagues "Isuru Wimalasundera".  We had to cover the topic of service governance using WSO2 Governance Registry. The idea behind this webinar was to give an introduction to the new lifecycle configuration model of WSO2 Governance Registry 4.0.0 and to give an introduction to WSO2 Governance Registry 4.0.0 UDDI v3 capabilities. During the webinar we covered about the new SCXML based lifecycle configuration model and some of its capabilities such as defining custom validations and defining permissions for lifecycle actions. Also during the webinar, we gave a brief description about the elements in the new lifecycle model and about the service version feature that we have introduced in WSO2 Governance Registry 4.0.0. 

Those who are interested more about this, visit here for the presentation slides and video cast. Also if you have any questions about what we discuss on this webinar, post them here or post them in our forum.

Stay tuned for more webinars about WSO2 Governance Registry by following our webinar page. There you can find about our past, present and upcoming webinars. 





Monday, August 1, 2011

Configure LifeCycles in WSO2 Governance Registry



Finally I thought of writing some technical stuff about WOS2 and its products. Currently I'm working in the WSO2 Governance Registry and this blog explains about the new lifeCycle configuration of WSO2 Governance Registry 4.0.0.

LifeCycles are a powerful concept when it comes to in the context of governance of different artifacts. The WOS2 Governance Registry (we'll call it G-Reg from this point onward) have the capability of associating lifeCycles for artifacts that are stored in the repository. The power of G-Reg's lifeCycles model is that the user has the ability to define his/her own lifeCycle. Users can do this using the configuration model we provide with G-Reg. The idea of this post is to describe about the new lifeCycle configuration model of G-Reg and what are the improvements that we have done to the configuration model itself.

Little detail about the configuration

First of all let me explain a bit about the current lifeCycle configuration. The new G-Reg lifeCycle configuration model is developed around the W3C specification of state chart XML or in other words SCXML[1]. The SCXML specification is a very powerful specification and we have used this mainly because of two reasons.


  1. SCXML is a stranded state machine language that has been adopted by the W3C
  2. The SCXML model is very extensible and therefore we can use our custom definitions without violating the specification


We have used this extensibility to our advantage and came up with a configuration model that has many capabilities. In the previous version of G-Reg(prior to G-Reg 4.0.0) we have used a simple lifeCycle configuration model. Even though the users had the ability to extend that lifeCycle configuration, it was somewhat a difficult talk. So what we did in this latest release was that, we took all of that hard work away from the user and made it part of the default implementation. First we'll look at the new configuration model and then let us see what a user can actually do with it.

Configuration Model

The new lifeCycle configuration model of G-Reg is given bellow. First let me explain a bit about the configuration model and later(most probably it will be another post) I will explain how a user can write their own configuration using this.
If you look at the new model carefully, you can see that it has some similarities to the previous configuration model as well. One such similarity is that we still use the same three elements to define this configuration as a lifeCycle. The elements "aspect","configuration" and "lifecycle" behave the same way as in previous lifeCycles configurations. The part that we need to concentrate is the element that has the name "scxml". This is the element that is defined according to to SCXML specification.

Let me explain the configuration element by element in detail.

<aspect name="" class="org.wso2.carbon.governance.registry.extensions.aspects.DefaultLifeCycle">
This element defines the aspect and note that G-Reg have defined lifeCycles as aspects too. There are two attributes in this, "name" and "class". "name" attribute contains the name of the lifeCycle and the name has to be a unique one. Note that G-Reg does not allow creating two lifeCycles with the same name. The "class" attribute defines the class that is associated with the lifeCycle. 
The "org.wso2.carbon.governance.registry.extensions.aspects.DefaultLifeCycle" is the default class that handles the new lifeCycle configuration and its specified operations. A user has the ability to define his/her own class(more information about this can be found using [2]) but the default class provided with the G-Reg distribution have the capability to handle any configuration that follows the above given template. 

<configuration type="">
This element defines whether the type of this configuration is "literal" or "resource". This is same as in previous G-Reg versions where, if you give the configuration through the registry.xml, then the value should be "resource" and if it is given through the management console, the value should be "literal".

<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0"
initialstate="">
This is the element that contains the SCXML based new configuration. The important fact about this element is that it defines the initial state of the lifeCycle. With SCXML the users have the ability to define an initial state and the initial state does not have to be the first state of the configuration. Also by changing the value of this attribute, a user can quickly modify the initial state and the flow of the lifeCycle. This is a huge leap forward from the previous configuration models. 
Up to this point of the configuration, there can be only one element of each of the above described elements. The above mentioned elements are used to provide meta data about the lifeCycle(such as its name,class and other things) and the elements that are described below contains the actual configuration.

<state id="">
"State" elements defines the states of the lifeCycle. A lifeCycle can have multiple states and in the configuration, more than one state element can be given. The "id" attribute of the "state" element defines the name of that state. Note that G-Reg does not support multiple states with the same name and therefore all the state names of a lifeCycle should be unique.
<datamodel>
This element contains all the custom elements that we have defined in G-Reg's new lifeCycles model. The SCXML specification allows users to define a data model to a state and we have used that extension to define our custom elements. We have defined few custom "data" elements(according to the SCXML specification) to define check items, transition permission, transition validations and transition scripts. 
<data name="checkItems/transitionValidations/transitoinPermission/transitionScripts">
This element defines about the data of its child elements. Note that a user can only define one such element of each kind since the underline implementation will ignore multiple elements and take only one into consideration. The attribute "name" defines about the data that this element contains. The "name" attribute should be set to "checkItems" if the user is defining check items as its child elements. Likewise the name should be set to "transitionValidations" if the data element defines transition validations and "transitionPermission" if the data element defines transition permissions and "transitionScripts" if the data element defines about the transition scripts. So I recommend not to modify this element.
<item name="" forEvent="">
These elements contains the check items for each state. There can be more than one such element and the attribute "name" defines the name of the check item. G-Reg 4.0.0 allows you to define check items that are required for each transition. The "forEvent" attribute defines whether this check item is required for an specific transition. A check item can be required for more than one event and in such a scenario a user can give a comma(",") separated list for the "forEvent"attribute. Keeping the "forEvent" attribute empty means, that specific check item is not required for any transition event.
<permissions>
The "permissions" element defines permissions for that specified action. A permission element can hold more than one child element which defines permissions. Under check items, the "permissions" element defines the users that have the capability of checking(check/uncheck) that check item. If a user does not have permissions to check an check item, then the management console will display that specific item in disabled mode. The idea behind that was to let the user know that there are some more check items in that state but he does not have permission to check them and to avoid user confusion.
<permission roles=""/>
This element comes as a child element of the "permissions" element and will define the roles that have permission to do the specified action. Here the attribute "roles" accepts a comma(",") separated list and these roles should be present in G-Reg.
<validations>
The "validations" element defines the validations that needs to be done for each action. This element can contain one or more "validation" elements(which is described next).
<validation forEvent="" class="">
Validations are an important part of lifeCycles. The "validation" element defines the event and the validation class that has to be invoked at runtime. The attribute "forEvent" defines the event that this validation should be performed. This gives user the flexibility to define validations for each event. The user has the ability to define validations for check items, which makes it easy to validate different things at different levels.
The attribute "class" defines the class that needs to be executed at runtime to perform the validation. A user must give the full qualified name of a class that implements the "customValidations" interface, as the value of the attribute "class".
<parameter name="" value=""/>
The parameter elements are used to give parameters to the validations classes. It is up to the user to define the name value pairs and the parameter element has attributes to define these values. A validations element can have more than one parameter element and it is up to the user code to handle them. The underline implementation of the "DefaultLifeCycle" class will pass all the parameters in a map object. 
<js forEvent="">
G-Reg lifeCycle configuration has the ability to give JavaScript functions to execute at both the server side and the client side. The "js" element defines the scripts that needs to be executed to different events. The "forEvent" attribute defines the transition action where this JavaScript function needs to be executed. 
<console function="">
The "console" element is there to define the JavaScript function that needs to be executed at the client side. The "function" attribute defines the name of the function and this function will be executed at a transition of one state to another. 
<script type="text/javascript">
This element contains the actual JavaScript code segment. A user has the ability to define any code segment here. The "type" attribute is set to "text/javascript" because at this moment G-Reg only support JavaScript as a scripting language.
<server function="">
This is as same as the "console" function and the only difference is that this element defines the scripts that needs to be executed at the server side. This element also has a "function" attribute that defines the function name. 
Now I have explained all of the custom elements that we have defined in the new lifeCycle configuration of G-Reg. There is one element that I need to focus your attention on. 

<transition event="" target=""/>
This element defines the transitions of a state. One improvement that we have done with this new lifeCycle configuration model is of allowing the user to define the transitions(the name and the target state) instead of using static transitions.
For all of you that have experience in lifeCycle configurations of previous G-Reg releases, you may recall that the configuration did not have a direct method of defining the transition event names and most importantly the target of the transition. Also you may recall that there were only two transitions that we supported by default. With the new SCXML based configuration model, we support any number of transitions from one state. Also this model has the capability of defining the target state of the transition and the name of the event as well. The attribute "event" is used to define the transition event name(eg: "Promote" or "Demote" or any name that the user specifies) and the attribute "target" is used to define the target state of the transition. 
That concludes the explanation of the new lifeCycle configuration model of G-Reg 4.0.0 and as you all can see, the new lifeCycle configuration model support many things by default. I hope that this guide was helpful to all of you to understand about the lifeCycle configuration and to write one of your own. If you have any inputs, questions, feel free to drop a comment because I will gladly accept them all.


Folks, Note that I'm planning to write another post explaining the default service lifeCycle of G-Reg 4.0.0 and how we are managing service resources using it. 


References




Sunday, July 31, 2011

Blogger, I'M BACK

It has been some time since I last wrote a blog due to various reasons. Now I'm thinking of start testing my blogging abilities. There are lots of things that I have to share with my blog. I had a great time in the last 7 months and I intend to share most of my experience with you guys as well.

So stay tuned to my blog because you will see lots of posts coming out in the next few weeks. :)

University Life. Am I really missing it?

It has been more than 3 months since I graduated from the university. I thought of writing this blog to sum up some of the events that happened in the University from the day that I first went there and to the day I left. This is a blog that should have been written some time back ( not sure when exactly ) but I'm glad that I came up with the idea of writing this even now.

University of Colombo School of Computing ( most know it as UCSC ) is where I did my higher studies with the hopes of becoming a software engineer someday. After 4 (very short) years at the university, I thought of sharing my experiences with others.

I can still remember the day that we all came to the university for the first time. It was a rainy day and had lots of trouble because of that. That day all the newcomers were requested come with their parents because of the introduction that had been scheduled. Our academic year started after about a week from that day. In the first month we had an training about basics in computing. It was like the best days of university life. Every morning and evening our seniors grouped us together and gave us guidance and time to get to know each others. We were also engaged in fun activities and various kinds of sports as well. All of us were very sad when that period was over.

During the next 4 years at the university we engaged in various activities ranging from organizing preaches to organizing island wide competitions and also various trips. One of the most memorable thing about the university life was the organizing of the annual "pirith preach" which was organized by our batch. We all did a considerable amount of hard work to get it done. These pictures are some of the decorations we did for that ceromony.







The most memorable incident that affected all of us was the funeral of the founder of UCSC, professor V.K.Samaranayake. We were there at his funeral and it was the most memorable one.

I hope not to talk about all the 4 years in my university life. But when I come to think of those times, I still feel that was the best years of my life. We did many activities there, we had many challenges, how we faced those challenges and how we finished 4 years of university life is an experience that words can not explain.