<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dimuthu's Blog &#187; carbon</title>
	<atom:link href="http://www.dimuthu.org/catagory/wso2/carbon-wso2/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dimuthu.org</link>
	<description>Waiting for your comments</description>
	<lastBuildDate>Wed, 03 Feb 2010 02:03:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
  <link>http://www.dimuthu.org</link>
  <url>http://www.dimuthu.org/favicon.ico</url>
  <title>Dimuthu's Blog</title>
</image>
		<item>
		<title>Writing Business Rules in WSO2 Carbon Platform</title>
		<link>http://www.dimuthu.org/blog/2010/01/07/writing-business-rules-in-wso2-carbon-platform/</link>
		<comments>http://www.dimuthu.org/blog/2010/01/07/writing-business-rules-in-wso2-carbon-platform/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 03:52:49 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[SOA]]></category>
		<category><![CDATA[Tutorial/Guide]]></category>
		<category><![CDATA[carbon]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[business rules]]></category>
		<category><![CDATA[esb]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=1055</guid>
		<description><![CDATA[If you want to write rules in a Java program you have lot of choices. You can use a third party library like Drools or use the JAVA built-in JSR-94 reference implementation. In WSO2 Carbon, there is a component that abstract the behaviour of different rule engine and give you a unified API. Currently it [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to write rules in a Java program you have lot of choices. You can use a <a href="http://java-source.net/open-source/rule-engines">third party library</a> like Drools or use the JAVA built-in JSR-94 reference implementation. In <a href="http://wso2.org">WSO2</a> Carbon, there is a component that abstract the behaviour of different rule engine and give you a unified API. Currently it has plugged into Drools and JAVA built-in JSR-94 implementation.</p>
<p>The rule component in WSO2 Carbon platform mainly used by <a href="http://wso2.org/projects/esb/java">WSO2 ESB</a> product to mediate messages according to the given business rules. But the component is written to facilitate any requirement of using business rules in WSO2 Carbon platform. I had such a requirement in past few days and manage to use the rule component easily with the help of the component author, indika@wso2.com. So I thought it is worth sharing my experience in here.</p>
<p>Here You will be preparing the following stuff.</p>
<p>1. Rule configuration -</p>
<p>We can use this to provide the information about the rule implementation we are going to use, the rules (You can write rules inline or provide a reference to an external file) and the input and output adapter information.</p>
<pre><span style="font-weight: bold; color: black;">&lt;configuration</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">"http://www.wso2.org/products/rule/drools"</span><span style="font-weight: bold; color: black;">&gt;</span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;executionSet</span> <span style="color: #000066;">uri</span>=<span style="color: #ff0000;">"simpleItemRuleXML"</span><span style="font-weight: bold; color: black;">&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;source</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">"file:src/test/resources/rules/simple-rules.drl"</span><span style="font-weight: bold; color: black;">/&gt;</span></span>

<span style="color: #009900;"><span style="color: #808080; font-style: italic;">&lt;!-- &lt;source&gt;</span>
</span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;x<span style="font-weight: bold; color: black;">&gt;</span></span></span><span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;"> rule InvokeABC</span>
<span style="color: #339933;"> // rules inbuilt to the rule conf</span>
<span style="color: #339933;"> end</span>

<span style="color: #339933;"> ]]&gt;</span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/x<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/source<span style="font-weight: bold; color: black;">&gt;</span></span></span> --&gt;
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;creation<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"source"</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">"drl"</span><span style="font-weight: bold; color: black;">/&gt;</span></span>

<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/creation<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/executionSet<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;session</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"stateless"</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;input</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"facts"</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"itemData"</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">"dataContext"</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/input<span style="font-weight: bold; color: black;">&gt;</span></span></span>

<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;output</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">"results"</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">"itemData"</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">"dataContext"</span><span style="font-weight: bold; color: black;">&gt;</span></span><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/output<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/configuration<span style="font-weight: bold; color: black;">&gt;</span></span></span>

<span style="color: #009900;"><span style="font-weight: bold; color: black;"><span style="font-weight: bold; color: black;">
</span></span></span></pre>
<p>2. The Rules  -</p>
<p>You can write rules inline in the above configuration or put it in a file and refer it from a key which can be refered from the ResourceHelper (described below).</p>
<pre><span style="color: #a1a100;">import java.util.Calendar;</span>

rule YearEndDiscount
when
$item : org.<span style="color: #006600;">test</span>.<span style="color: #006600;">pojo</span>.<span style="color: #006600;">SimpleItem</span><span style="color: #66cc66;">(</span>price &gt; <span style="color: #cc66cc;">100</span> <span style="color: #66cc66;">)</span>

then

<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ACalendar+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Calendar</span></a> calendar = <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ACalendar+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Calendar</span></a>.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span>calendar.<span style="color: #006600;">get</span><span style="color: #66cc66;">(</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ACalendar+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Calendar</span></a>.<span style="color: #006600;">MONTH</span><span style="color: #66cc66;">)</span> == <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ACalendar+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Calendar</span></a>.<span style="color: #006600;">JANUARY</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

$item.<span style="color: #006600;">setPrice</span><span style="color: #66cc66;">(</span>$item.<span style="color: #006600;">getPrice</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span> * <span style="color: #cc66cc;">80</span>/<span style="color: #cc66cc;">100</span><span style="color: #66cc66;">)</span>;
<span style="color: #66cc66;">}</span>

end
</pre>
<p>3. Data Context -</p>
<p>The context object that can be used to feed and retrieve data from and to rule engine. Here is the data context for my application.</p>
<pre><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SimpleDataContext <span style="color: #66cc66;">{</span>

    <span style="color: #000000; font-weight: bold;">public</span> List&lt;NameValuePair&gt; getInput<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

        <span style="color: #808080; font-style: italic;">// in reality the data will be retrieve from a database or some datasource </span>
        List&lt;NameValuePair&gt; itemPairList = <span style="color: #000000; font-weight: bold;">new</span> ArrayList&lt;NameValuePair&gt;<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
        SimpleItem item1 = <span style="color: #000000; font-weight: bold;">new</span> SimpleItem<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
        item1.<span style="color: #006600;">setName</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"item1"</span><span style="color: #66cc66;">)</span>;
        item1.<span style="color: #006600;">setPrice</span><span style="color: #66cc66;">(</span><span style="color: #cc66cc;">50</span><span style="color: #66cc66;">)</span>;
        itemPairList.<span style="color: #006600;">add</span><span style="color: #66cc66;">(</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ANameValuePair+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">NameValuePair</span></a><span style="color: #66cc66;">(</span>item1.<span style="color: #006600;">getName</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>, item1<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;

        SimpleItem item2 = <span style="color: #000000; font-weight: bold;">new</span> SimpleItem<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
        item2.<span style="color: #006600;">setName</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"item2"</span><span style="color: #66cc66;">)</span>;
        item2.<span style="color: #006600;">setPrice</span><span style="color: #66cc66;">(</span><span style="color: #cc66cc;">120</span><span style="color: #66cc66;">)</span>;
        itemPairList.<span style="color: #006600;">add</span><span style="color: #66cc66;">(</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ANameValuePair+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">NameValuePair</span></a><span style="color: #66cc66;">(</span>item2.<span style="color: #006600;">getName</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>, item2<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;

        SimpleItem item3 = <span style="color: #000000; font-weight: bold;">new</span> SimpleItem<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
        item3.<span style="color: #006600;">setName</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"item3"</span><span style="color: #66cc66;">)</span>;
        item3.<span style="color: #006600;">setPrice</span><span style="color: #66cc66;">(</span><span style="color: #cc66cc;">130</span><span style="color: #66cc66;">)</span>;
        itemPairList.<span style="color: #006600;">add</span><span style="color: #66cc66;">(</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ANameValuePair+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">NameValuePair</span></a><span style="color: #66cc66;">(</span>item3.<span style="color: #006600;">getName</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>, item3<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;

        <span style="color: #000000; font-weight: bold;">return</span> itemPairList;
    <span style="color: #66cc66;">}</span>

    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setResult<span style="color: #66cc66;">(</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Object</span></a> result<span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span>!<span style="color: #66cc66;">(</span>result <span style="color: #000000; font-weight: bold;">instanceof</span> SimpleItem<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"it is not a SimpleItem"</span><span style="color: #66cc66;">)</span>;
        <span style="color: #66cc66;">}</span>

        SimpleItem item = <span style="color: #66cc66;">(</span>SimpleItem<span style="color: #66cc66;">)</span>result;
        <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ASystem+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">System</span></a>.<span style="color: #006600;">out</span>.<span style="color: #006600;">println</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"Item: "</span> + item.<span style="color: #006600;">getName</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span> + <span style="color: #ff0000;">", Price: "</span> + item.<span style="color: #006600;">getPrice</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;
    <span style="color: #66cc66;">}</span>

<span style="color: #66cc66;">}</span>
</pre>
<p>And the Item I&#8217;m going to manipulate using rule is a simple bean like this,</p>
<pre><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SimpleItem <span style="color: #66cc66;">{</span>
    <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> name;
    <span style="color: #993333;">int</span> price;
    <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> getName<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

        <span style="color: #000000; font-weight: bold;">return</span> name;
    <span style="color: #66cc66;">}</span>

    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setName<span style="color: #66cc66;">(</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> name<span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">name</span> = name;
    <span style="color: #66cc66;">}</span>

    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">int</span> getPrice<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

        <span style="color: #000000; font-weight: bold;">return</span> price;
    <span style="color: #66cc66;">}</span>

    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">void</span> setPrice<span style="color: #66cc66;">(</span><span style="color: #993333;">int</span> price<span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

        <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006600;">price</span> = price;
    <span style="color: #66cc66;">}</span>
<span style="color: #66cc66;">}</span>
</pre>
<p>4. Data Adapter</p>
<p>You have to adapt the input and output with the rule engine. Mostly here you only have to wrap the data context. The advantage of having the data adapter is, a data adapter always associated with a input/output type. So in the rule configuration I can provide the type for the input and output. If you see my rule configuration above, you see the input/output type is marked as &#8220;ItemData&#8221;.  Here is my custom data adapter that is associated with the &#8220;itemData&#8221; type.</p>
<pre><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SimpleDataAdapter <span style="color: #000000; font-weight: bold;">implements</span>
        ResourceAdapter, InputAdaptable, OutputAdaptable <span style="color: #66cc66;">{</span>

    <span style="color: #808080; font-style: italic;">// the type associated with the adapter</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">final</span> <span style="color: #000000; font-weight: bold;">static</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> TYPE = <span style="color: #ff0000;">"itemData"</span>;
    <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> getType<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

        <span style="color: #000000; font-weight: bold;">return</span> TYPE;
    <span style="color: #66cc66;">}</span>

    <span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Object</span></a> adaptInput<span style="color: #66cc66;">(</span>ResourceDescription resourceDescription, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Object</span></a> tobeadapted<span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span>!<span style="color: #66cc66;">(</span>tobeadapted <span style="color: #000000; font-weight: bold;">instanceof</span> SimpleDataContext<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">null</span>;
        <span style="color: #66cc66;">}</span>

        SimpleDataContext dataContext = <span style="color: #66cc66;">(</span>SimpleDataContext<span style="color: #66cc66;">)</span>tobeadapted;
        <span style="color: #000000; font-weight: bold;">return</span> dataContext.<span style="color: #006600;">getInput</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
    <span style="color: #66cc66;">}</span>

    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">boolean</span> adaptOutput<span style="color: #66cc66;">(</span>ResourceDescription description,
                               <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Object</span></a> value,
                               <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Object</span></a> context,
                               ResourceHelper resourceHelper<span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span>!<span style="color: #66cc66;">(</span>context <span style="color: #000000; font-weight: bold;">instanceof</span> SimpleDataContext<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;
        <span style="color: #66cc66;">}</span>

        <span style="color: #66cc66;">(</span><span style="color: #66cc66;">(</span>SimpleDataContext<span style="color: #66cc66;">)</span>context<span style="color: #66cc66;">)</span>.<span style="color: #006600;">setResult</span><span style="color: #66cc66;">(</span>value<span style="color: #66cc66;">)</span>;
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">true</span>;
    <span style="color: #66cc66;">}</span>

    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #993333;">boolean</span> canAdapt<span style="color: #66cc66;">(</span>ResourceDescription description, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Object</span></a> ouptput<span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
        <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> key = description.<span style="color: #006600;">getKey</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
        <span style="color: #000000; font-weight: bold;">return</span> key != <span style="color: #000000; font-weight: bold;">null</span> &amp;&amp; !<span style="color: #ff0000;">""</span>.<span style="color: #006600;">equals</span><span style="color: #66cc66;">(</span>key<span style="color: #66cc66;">)</span>;
    <span style="color: #66cc66;">}</span>

<span style="color: #66cc66;">}</span>
</pre>
<p>5. Resource Helper</p>
<p>Resource Helper will map the keys refered from the configuration to JAVA objects. This is mostly used in mediation rule configurations which can extract the message data using a key or an xpath. In this example, we don&#8217;t have much keys refering from the configuration only the rule file and the data context.</p>
<pre><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SimpleResourceHelper <span style="color: #000000; font-weight: bold;">extends</span> ResourceHelper <span style="color: #66cc66;">{</span>

    <span style="color: #000000; font-weight: bold;">public</span> ReturnValue findByKey<span style="color: #66cc66;">(</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> key, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Object</span></a> source, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AObject+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Object</span></a> defaultValue<span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span>!<span style="color: #66cc66;">(</span>source <span style="color: #000000; font-weight: bold;">instanceof</span> SimpleDataContext<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> ReturnValue<span style="color: #66cc66;">(</span>defaultValue<span style="color: #66cc66;">)</span>;
        <span style="color: #66cc66;">}</span>

        SimpleDataContext dataContext = <span style="color: #66cc66;">(</span>SimpleDataContext<span style="color: #66cc66;">)</span>source;
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span>key.<span style="color: #006600;">startsWith</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"file:"</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

            <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> filename = key.<span style="color: #006600;">substring</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"file:"</span>.<span style="color: #006600;">length</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;
            <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #66cc66;">{</span>

                <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ABufferedInputStream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">BufferedInputStream</span></a> in = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3ABufferedInputStream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">BufferedInputStream</span></a><span style="color: #66cc66;">(</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AFileInputStream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">FileInputStream</span></a><span style="color: #66cc66;">(</span>filename<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;
                <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> ReturnValue<span style="color: #66cc66;">(</span>in<span style="color: #66cc66;">)</span>;
            <span style="color: #66cc66;">}</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #66cc66;">(</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AException+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">Exception</span></a> e<span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

                <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> ReturnValue<span style="color: #66cc66;">(</span>defaultValue<span style="color: #66cc66;">)</span>;
            <span style="color: #66cc66;">}</span>
        <span style="color: #66cc66;">}</span>
        <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span>key.<span style="color: #006600;">startsWith</span><span style="color: #66cc66;">(</span><span style="color: #ff0000;">"dataContext"</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

            <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> ReturnValue<span style="color: #66cc66;">(</span>dataContext<span style="color: #66cc66;">)</span>;
        <span style="color: #66cc66;">}</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> ReturnValue<span style="color: #66cc66;">(</span>defaultValue<span style="color: #66cc66;">)</span>;
    <span style="color: #66cc66;">}</span>

    <span style="color: #808080; font-style: italic;">// there are few more methods to be implemented, which can just leave not implemented for this example</span>
    <span style="color: #66cc66;">}</span>
<span style="color: #66cc66;">}</span>
</pre>
<p>That is all the accessories. Now you will be able to write the rule engine execution code.</p>
<pre><span style="color: #aaaadd; font-weight: bold;">File</span> ruleConfigFile = <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AFile+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">File</span></a><span style="color: #66cc66;">(</span>ruleConfigFilename<span style="color: #66cc66;">)</span>;
XMLStreamReader parser = XMLInputFactory.<span style="color: #006600;">newInstance</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>.<span style="color: #006600;">createXMLStreamReader</span><span style="color: #66cc66;">(</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AFileInputStream+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">FileInputStream</span></a><span style="color: #66cc66;">(</span>ruleConfigFile<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;

<span style="color: #808080; font-style: italic;">//create the builder</span>
StAXOMBuilder builder = <span style="color: #000000; font-weight: bold;">new</span> StAXOMBuilder<span style="color: #66cc66;">(</span>parser<span style="color: #66cc66;">)</span>;
<span style="color: #808080; font-style: italic;">//get the root element (in this case the envelope)</span>

OMElement ruleConfig =  builder.<span style="color: #006600;">getDocumentElement</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
EngineConfiguration configuration =
        <span style="color: #000000; font-weight: bold;">new</span> EngineConfigurationFactory<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>.<span style="color: #006600;">create</span><span style="color: #66cc66;">(</span>ruleConfig, <span style="color: #000000; font-weight: bold;">new</span> AXIOMXPathFactory<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;

EngineController
        engineController = <span style="color: #000000; font-weight: bold;">new</span> EngineController<span style="color: #66cc66;">(</span>configuration, <span style="color: #000000; font-weight: bold;">new</span> SimpleResourceHelper<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span>;
        <span style="color: #000000; font-weight: bold;">final</span> ResourceAdapterFactory factory = ResourceAdapterFactory.<span style="color: #006600;">getInstance</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;

ResourceAdapter adapter = <span style="color: #000000; font-weight: bold;">new</span> SimpleDataAdapter<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3AString+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #aaaadd; font-weight: bold;">String</span></a> adapterType = adapter.<span style="color: #006600;">getType</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;
<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span>!factory.<span style="color: #006600;">containsResourceAdapter</span><span style="color: #66cc66;">(</span>adapterType<span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>

    factory.<span style="color: #006600;">addResourceAdapter</span><span style="color: #66cc66;">(</span>adapter<span style="color: #66cc66;">)</span>;
<span style="color: #66cc66;">}</span>

SimpleDataContext simpleContext = <span style="color: #000000; font-weight: bold;">new</span> SimpleDataContext<span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span>;

<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span>!engineController.<span style="color: #006600;">isInitialized</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
    engineController.<span style="color: #006600;">init</span><span style="color: #66cc66;">(</span>simpleContext<span style="color: #66cc66;">)</span>;

<span style="color: #66cc66;">}</span>

<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">(</span>engineController.<span style="color: #006600;">isInitialized</span><span style="color: #66cc66;">(</span><span style="color: #66cc66;">)</span><span style="color: #66cc66;">)</span> <span style="color: #66cc66;">{</span>
    engineController.<span style="color: #006600;">execute</span><span style="color: #66cc66;">(</span>simpleContext, simpleContext<span style="color: #66cc66;">)</span>;

<span style="color: #66cc66;">}</span>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2010/01/07/writing-business-rules-in-wso2-carbon-platform/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WSO2 Bringing Cloud Computing and SOA Together</title>
		<link>http://www.dimuthu.org/blog/2009/12/02/wso2-bringing-cloud-computing-and-soa-together/</link>
		<comments>http://www.dimuthu.org/blog/2009/12/02/wso2-bringing-cloud-computing-and-soa-together/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 02:06:45 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[carbon]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[gaas]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=1032</guid>
		<description><![CDATA[Wso2 Cloud Public 2009 11 16
]]></description>
			<content:encoded><![CDATA[<div id="__ss_2511160" style="width: 425px; text-align: left;"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" title="Wso2 Cloud Public 2009 11 16" href="http://www.slideshare.net/sanjiva/wso2-cloud-public-2009-11-16">Wso2 Cloud Public 2009 11 16</a><object style="margin:0px" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=wso2-cloud-public-2009-11-16-091116095441-phpapp02&amp;rel=0&amp;stripped_title=wso2-cloud-public-2009-11-16" /><param name="allowfullscreen" value="true" /><embed style="margin:0px" type="application/x-shockwave-flash" width="425" height="355" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=wso2-cloud-public-2009-11-16-091116095441-phpapp02&amp;rel=0&amp;stripped_title=wso2-cloud-public-2009-11-16" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2009/12/02/wso2-bringing-cloud-computing-and-soa-together/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSO2 SOA Workshop 2009, Santa Clara, CA</title>
		<link>http://www.dimuthu.org/blog/2009/10/13/wso2-soa-workshop-2009-santa-clara-ca/</link>
		<comments>http://www.dimuthu.org/blog/2009/10/13/wso2-soa-workshop-2009-santa-clara-ca/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 13:17:11 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[Governance]]></category>
		<category><![CDATA[Governance Registry]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[bps]]></category>
		<category><![CDATA[carbon]]></category>
		<category><![CDATA[esb]]></category>
		<category><![CDATA[mashup server]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[SOA Governance]]></category>
		<category><![CDATA[Workshop]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=1025</guid>
		<description><![CDATA[WSO2 is hosting a SOA Workshop in Santa Clara, California in November 3rd 2009. You will be able to attend to the following sessions covered by the industry leading experts in SOA.

ESBS and SOA
SOA Security
Mashups and Business Process Management for SOA
SOA Governance
SOA with C, C++, PHP
SOA Architecture Pattern

Visit here to find more details about the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wso2.com">WSO2</a> is hosting a SOA Workshop in Santa Clara, California in November 3rd 2009. You will be able to attend to the following sessions covered by the industry leading experts in SOA.</p>
<ul>
<li>ESBS and SOA</li>
<li>SOA Security</li>
<li>Mashups and Business Process Management for SOA</li>
<li>SOA Governance</li>
<li>SOA with C, C++, PHP</li>
<li>SOA Architecture Pattern</li>
</ul>
<p>Visit here to find more details about the event, <a href="http://wso2.com/events/2009-us-soa-workshop/?soaotad=10072009">http://wso2.com/events/2009-us-soa-workshop/?soaotad=10072009</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2009/10/13/wso2-soa-workshop-2009-santa-clara-ca/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSO2 Releases Goernance Registry 3.0.1, ESB 2.1.1, WSAS 3.1.1, IS 2.0.1 AND Mashup Server 2.0.0</title>
		<link>http://www.dimuthu.org/blog/2009/10/13/wso2-releases-goernance-registry-3-0-1-esb-2-1-1-wsas-3-1-1-is-2-0-1-and-mashup-server-2-0-0/</link>
		<comments>http://www.dimuthu.org/blog/2009/10/13/wso2-releases-goernance-registry-3-0-1-esb-2-1-1-wsas-3-1-1-is-2-0-1-and-mashup-server-2-0-0/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 02:08:07 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[Governance]]></category>
		<category><![CDATA[Governance Registry]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[carbon]]></category>
		<category><![CDATA[esb]]></category>
		<category><![CDATA[mashup server]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[wsas]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[identity]]></category>
		<category><![CDATA[mashup]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=1022</guid>
		<description><![CDATA[WSO2 announced an another round of release of their famous SOA products.

WSO2 Governance Registry 3.0.1
WSO2 ESB 2.1.1
WOS2 Web Services Application Server (WSAS) 3.1.1
WSO2 Identity Server (IS) 2.0.1
WSO2 Mashup Server 2.0.0

Although the version numbers say this is minor patch release (Other than the Mashup Server which is shipping as a major release), in fact there are [...]]]></description>
			<content:encoded><![CDATA[<p>WSO2 announced an another round of release of their famous SOA products.</p>
<ul>
<li><a href="http://wso2.org/projects/governance-registry">WSO2 Governance Registry 3.0.1</a></li>
<li><a href="http://wso2.org/projects/esb/java">WSO2 ESB 2.1.1</a></li>
<li><a href="http://wso2.org/projects/wsas/java">WOS2 Web Services Application Server (WSAS) 3.1.1</a></li>
<li><a href="http://wso2.org/projects/identity">WSO2 Identity Server (IS) 2.0.1</a></li>
<li><a href="http://wso2.org/projects/mashup">WSO2 Mashup Server 2.0.0</a></li>
</ul>
<p>Although the version numbers say this is minor patch release (Other than the Mashup Server which is shipping as a major release), in fact there are new features and improvements. Some basic new features shares among all of these products are</p>
<ol>
<li>Improved registry level transaction Support.</li>
<li>Improved Support for deploying on top of Application Servers other than tomcat like WebSphere, WebLogic, and<br />
JBoss.</li>
<li>Support for Eclipse P2 based provisioning. (Yes, you can add/remove features from these WSO2 products , see <a href="https://wso2.org/wiki/display/carbon/p2-based-provisioning-support">https://wso2.org/wiki/display/carbon/p2-based-provisioning-support</a> for more details)</li>
<li>Improved Remote Registry model</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2009/10/13/wso2-releases-goernance-registry-3-0-1-esb-2-1-1-wsas-3-1-1-is-2-0-1-and-mashup-server-2-0-0/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>WSO2 Carbon 2 &#8211; WSAS, ESB &amp; Governance Registry Released</title>
		<link>http://www.dimuthu.org/blog/2009/07/11/wso2-carbon-2-wsas-esb-governance-registry-released/</link>
		<comments>http://www.dimuthu.org/blog/2009/07/11/wso2-carbon-2-wsas-esb-governance-registry-released/#comments</comments>
		<pubDate>Sat, 11 Jul 2009 06:29:50 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[DataServices]]></category>
		<category><![CDATA[Governance]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[carbon]]></category>
		<category><![CDATA[data services]]></category>
		<category><![CDATA[esb]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[wsas]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[governance registry]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=995</guid>
		<description><![CDATA[WSO2 -An open source middleware company- announced the release of bunch of their SOA enabling products along with Carbon 2.0.0 which is an OSGI based unified platform that all the WSO2 java products are built on.

 WSAS (Web Service Application Server) &#8211; Provide and consume web services, data services with full WS-*, REST support, GUI [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wso2.org">WSO2</a> -An open source middleware company- announced the release of bunch of their SOA enabling products along with Carbon 2.0.0 which is an OSGI based unified platform that all the WSO2 java products are built on.</p>
<ul>
<li> <a href="http://wso2.org/projects/wsas/java">WSAS (Web Service Application Server)</a> &#8211; Provide and consume web services, data services with full WS-*, REST support, GUI tools, Integration with Eclipse, etc..</li>
<li><a href="http://wso2.org/projects/esb/java">ESB (Enterprise Service Bus)</a> &#8211; Message routing, mediation, transformation, logging, task scheduling, load balancing, failover routing, event brokering, etc. with number of transports support</li>
<li><a href="http://wso2.org/projects/governance-registry">Governance Registry</a> &#8211; Govern you SOA platform, introducing number of new features including Dashboard with Gadgets, lifecycle management with checklists, eventing and notifications, remote/symbolic links, checkin/checkout functionality and new meta data management UI.</li>
</ul>
<p>You will be able to get the advantage of the carbon platform by extending the functionality of any of these products, just by mixing components from other products (Just like <a href="http://www.dimuthu.org/blog/2009/03/01/composable-soa-platform/">running an ESB within WSAS</a>).</p>
<p>Download, Play around with them and Enjoy:)!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2009/07/11/wso2-carbon-2-wsas-esb-governance-registry-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WSO2 Registry &#8211; The Unified Repository for WSO2 SOA Platform</title>
		<link>http://www.dimuthu.org/blog/2009/04/11/wso2-registry-the-unified-repository-for-wso2-soa-platform/</link>
		<comments>http://www.dimuthu.org/blog/2009/04/11/wso2-registry-the-unified-repository-for-wso2-soa-platform/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 10:04:08 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[Governance]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[carbon]]></category>
		<category><![CDATA[esb]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[wsas]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[Repository]]></category>
		<category><![CDATA[SOA Governance]]></category>
		<category><![CDATA[SOA Platform]]></category>
		<category><![CDATA[WSO2 Registry]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=973</guid>
		<description><![CDATA[Early this year, WSO2 released a complete SOA platform, introducing a revolutionary solution to adapt SOA in more flexible and cost-effective manner. It is developed based on the OSGI technology, which allow users to get only the desired components to their requirements and implement their SOA infrastructure. As the requirements grow or change, they can [...]]]></description>
			<content:encoded><![CDATA[<p>Early this year, WSO2 released a <a href="http://www.businesswire.com/portal/site/google/?ndmViewId=news_view&amp;newsId=20090209005445&amp;newsLang=en">complete SOA platform</a>, introducing a revolutionary solution to adapt SOA in more flexible and cost-effective manner. It is developed based on the OSGI technology, which allow users to get only the desired components to their requirements and implement their SOA infrastructure. As the requirements grow or change, they can add/upgrade/drop only the relevant component(s) to adjust to their new requirements.</p>
<p>In fact rather than releasing each components separately, WSO2 released few products, pre-bundling some of these components.Those are,</p>
<ul>
<li><a href="http://wso2.org/projects/wsas/java">WSO2 WSAS</a> &#8211; Allows you to consume create and host web services.</li>
<li><a href="http://wso2.org/projects/wsas/java">WSO2 ESB</a> &#8211; Complete ESB functionality including message routing, mediation</li>
<li><a href="http://wso2.org/projects/bps">WSO2 BPS</a> &#8211; Orchestrate business processes with WS-BPEL</li>
<li><a href="http://wso2.org/projects/registry">WSO2 Registry</a> &#8211; The repository for all.</li>
</ul>
<p>Note that you can always start from one of above and then mix and match among these components until you get the desired features, as explained in my previous blog <a href="http://www.dimuthu.org/blog/2009/03/01/composable-soa-platform/">The Composable SOA Platform</a>.</p>
<p>One of the common component bundled in all of these is the &#8220;Registry Core&#8221;. It acts as a unified repository for all the storage requirement of the SOA platform. It stores,</p>
<ul>
<li>Service descriptions, policies</li>
<li>Configurations of modules (e.g. Security module, Reliable Messaging module, etc..)</li>
<li>Configurations of transports</li>
<li>Configurations of data sources, event sources, connections</li>
<li>Proxy Services, Sequences, Endpoints +  the keys (xslts, schemas) needed in mediator configurations.</li>
</ul>
<p>In order to deal with these requirements Registry provides functionalities to</p>
<ul>
<li>Store/Retrieve resources.</li>
<li>Organize resources in to collections(collections are also considered as resources) in hierarchical manner. (Like directories in a file system)</li>
<li>Search resources. (content based search or using custom queries)</li>
<li>Tagging, commenting and rating resources</li>
<li>Keeps associations, dependencies among resources</li>
<li>Support for resource versioning.</li>
<li>Monitors activities.</li>
</ul>
<p>So how you going to use the registry. In fact you can access a registry in different ways. It has</p>
<ul>
<li>Nice web based GUI to explore/add/remove/update resources</li>
<li>APIs to embed the Registry to your java program.</li>
<li>APIs to access Registry remotely using Atom/pub and web services. Atom clients are also available in C and PHP to access registry.</li>
</ul>
<p>The another very important aspect of the registry is that who has the permission to view/add/delete resources. For that, registry uses &#8216;User Manager&#8217; component which allows you to handles the permission in user based and role based schema.</p>
<p>In addition to all of these functionalities, it provides you two different ways to extend the functionalities of the registry.</p>
<ul>
<li>Handlers</li>
<li>Aspects</li>
</ul>
<p>Please look at this article on <a href="http://wso2.org/library/articles/extending-wso2-registry-handlers">&#8220;Extending WSO2 Registry</a>&#8221; for a comprehensive guide on this subject.</p>
<p>The capabilities of the registry are not just limited to act as a repository, but also it can be used as the base for govern the entire SOA platform. The following aspects of the SOA governance can be solved based on a Registry.</p>
<ul>
<li>Service discovery</li>
<li>Service policy enforcement and validation</li>
<li>Service Life Cycle Management</li>
<li>Promote or Demote services with a proper criteria (e.g using a checklist)</li>
<li>Service association and dependency management</li>
<li>Service Monitoring</li>
<li>Service Access Control</li>
<li>Service Versioning</li>
</ul>
<p>You can read how to implement SOA Governance with the Registry 1.1 (An Older version of Registry) in more detail, from this article &#8220;<a href="http://wso2.org/library/articles/soa-governance-wso2-registry-v1-1">SOA Governance with Registry 1.1</a>&#8220;.</p>
<p>WSO2 is preparing to release the WSO2 Governance Server that provide a solution to all of these SOA Governance requirements. It will extend the registry features and UI by introducing more views towards SOA Governance.</p>
<p>So you can use WSO2 Registry for all your repository requirements + as a tool to help you govern your SOA in your enterprise.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2009/04/11/wso2-registry-the-unified-repository-for-wso2-soa-platform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Five Unification in WSO2 Carbon</title>
		<link>http://www.dimuthu.org/blog/2009/03/02/five-unification-in-wso2-carbon/</link>
		<comments>http://www.dimuthu.org/blog/2009/03/02/five-unification-in-wso2-carbon/#comments</comments>
		<pubDate>Mon, 02 Mar 2009 13:48:24 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[DataServices]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[carbon]]></category>
		<category><![CDATA[esb]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[wsas]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[extensibility]]></category>
		<category><![CDATA[pbs]]></category>
		<category><![CDATA[qos]]></category>
		<category><![CDATA[unified]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=951</guid>
		<description><![CDATA[The release of WSO2 SOA platform &#8211; Carbon has unified the process of development to deployment of SOA in several aspects. Here is a list of 5 aspects unified across all the components of the SOA platform namely WSAS (The App Server), ESB (Enterprise Service Bus) and BPS (Business Process Server)
1. Unified QoS configurations &#8211; [...]]]></description>
			<content:encoded><![CDATA[<p>The release of <a href="wso2.org/projects/carbon">WSO2 SOA platform &#8211; Carbon</a> has unified the process of development to deployment of SOA in several aspects. Here is a list of 5 aspects unified across all the components of the SOA platform namely <a href="http://wso2.org/projects/wsas/java">WSAS</a> (The App Server), <a href="http://wso2.org/projects/esb/java">ESB </a>(Enterprise Service Bus) and <a href="http://wso2.org/projects/bps">BPS </a>(Business Process Server)</p>
<p>1. Unified QoS configurations &#8211; Allows you to add/drop modules for security, reliability, etc of your services + edit their policies in a unified view.<br />
2. Unified Registry Storage &#8211; Provides a unified view over the governance of the SOA platform.<br />
3. Unified Trackers &#8211; Availability of logs, statistics, graphs and  message tracers making it easy to debug and test your system.<br />
4. Unified User Experience &#8211; Well designed unified User interfaces allowing admins/users to get familiar with each of the components very quickly and easily.<br />
5. Unified Extensibility &#8211; The underline OSGI environment and the design of the carbon platform itself make it possible to add new OSGI bundles as extensions to fit equally across all the products.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2009/03/02/five-unification-in-wso2-carbon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Composable SOA Platform</title>
		<link>http://www.dimuthu.org/blog/2009/03/01/composable-soa-platform/</link>
		<comments>http://www.dimuthu.org/blog/2009/03/01/composable-soa-platform/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 16:46:18 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[SOA]]></category>
		<category><![CDATA[carbon]]></category>
		<category><![CDATA[esb]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[wsas]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[bps]]></category>
		<category><![CDATA[platform]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=943</guid>
		<description><![CDATA[The WSO2 SOA platform comprises of

Application Server (WSO2 WSAS) &#8211; Enables you to provide and consume web services
Enterprise Service Bus (WSO2 ESB) &#8211; Enables you to mediate web service interactions
Business Process Service (WSO2 BPS) &#8211; Enables you to orchestrate services for your business process.
Registry (WSO2 Registry) Enables you to store and govern your resources.

The uniqueness [...]]]></description>
			<content:encoded><![CDATA[<p>The WSO2 SOA platform comprises of</p>
<ul>
<li>Application Server (<a href="http://wso2.org/projects/wsas/java">WSO2 WSAS</a>) &#8211; Enables you to provide and consume web services</li>
<li>Enterprise Service Bus (<a href="http://wso2.org/projects/esb/java">WSO2 ESB</a>) &#8211; Enables you to mediate web service interactions</li>
<li>Business Process Service (<a href="http://wso2.org/projects/bps">WSO2 BPS</a>) &#8211; Enables you to orchestrate services for your business process.</li>
<li>Registry (<a href="http://wso2.org/projects/registry">WSO2 Registry</a>) Enables you to store and govern your resources.</li>
</ul>
<p>The uniqueness of WSO2 platform is that it provides you the freedom to mix and match these components according to your requirements. Paul Fremantle, CTO of WSO2 describes this as a <a href="http://pzf.fremantle.org/2009/02/wso2-carbon-part-1.html">Composable SOA platform</a>. You can drop ESB component to BPS instance to add mediation capabilities to your business process server or the other way around.</p>
<p>In the following screencast <a href="http://ruwansblog.blogspot.com/">Ruwan Linton &#8211; Product Manger of WSO2 ESB</a> explains how to get the mediation capabilities inside a web service application server, putting ESB component in to WSO2 WSAS and demonstrating their integrated operations.</p>
<p><object width="425" height="344" data="http://www.youtube.com/v/Ty8bMSMQ66w&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en&amp;feature=player_embedded&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="src" value="http://www.youtube.com/v/Ty8bMSMQ66w&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en&amp;feature=player_embedded&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2009/03/01/composable-soa-platform/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>WSO2 Carbon Products Released</title>
		<link>http://www.dimuthu.org/blog/2009/02/10/wso2-carbon-products-released/</link>
		<comments>http://www.dimuthu.org/blog/2009/02/10/wso2-carbon-products-released/#comments</comments>
		<pubDate>Tue, 10 Feb 2009 01:59:36 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[DataServices]]></category>
		<category><![CDATA[SOA]]></category>
		<category><![CDATA[carbon]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[bps]]></category>
		<category><![CDATA[esb]]></category>
		<category><![CDATA[registry]]></category>
		<category><![CDATA[release]]></category>
		<category><![CDATA[wsas]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=923</guid>
		<description><![CDATA[WSO2 announced the release of the revolutionary series of products introducing a componentized design to implement SOA in cost effective and simple manner.

WSO2 Web Services Application Server (WSAS)  &#8211; WSO2 WSAS is an enterprise ready web services engine based on Apache Axis2. It is incorporated with many features including,

Data services support &#8211; Expose you [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wso2.com/">WSO2</a> <a href="http://www.businesswire.com/portal/site/google/?ndmViewId=news_view&amp;newsId=20090209005445&amp;newsLang=en">announced the release</a> of the revolutionary series of products introducing a componentized design to implement SOA in cost effective and simple manner.</p>
<ol>
<li><a href="http://wso2.org/projects/wsas/java">WSO2 Web Services Application Server (WSAS) </a> &#8211; WSO2 WSAS is an enterprise ready web services engine based on Apache Axis2. It is incorporated with many features including,
<ul>
<li>Data services support &#8211; Expose you enterprise data as a services in a         jiffy</li>
<li>WSAS IDE &#8211; Eclipse IDE integration</li>
<li>Clustering support for High Availability &amp; High Scalability</li>
<li>Full support for WS-Security, WS-Trust, WS-Policy and WS-Secure         Conversation and         XKMS</li>
<li>EJB service provider support &#8211; Expose your EJBs as services</li>
<li>Axis1 backward compatibility &#8211; Deploy Axis1 services on WSAS &amp;         Engage advanced         WS-* protocols in front of legacy         services</li>
<li>JMX &amp; Web interface based monitoring and management</li>
<li>WS-* &amp; REST support</li>
<li>GUI, command line &amp; IDE based tools for Web service development</li>
</ul>
</li>
<li><a href="http://wso2.org/projects/wsas/java">WSO2 Enterprise Service Bus (ESB)</a>- WSO2 ESB is a lightweight and easy-to-use Open Source Enterprise Service Bus based on Apache Synapse. Here is the listing of some of key features,
<ul>
<li>Proxy services &#8211; facilitating transport, interface (WSDL/Schema/Policy),    message format (SOAP 1.1/1.2, POX/REST, Text, Binary), QoS    (WS-Addressing/WS-Security/WS-RM) and optimization switching (MTOM/SwA).</li>
<li>Non-blocking HTTP/S transports based on Apache HttpCore for ultrafast    execution and support for thousands of connections at high concurreny with    constant memory usage.</li>
<li>Built in Registry/Repository, facilitating dynamic updating and reloading    of the configuration and associated resources (e.g. XSLTs, XSD, JS, ..)</li>
<li>Easily extended via custom Java class (mediator and command)/Spring mediators,    or BSF Scripting languages (Javascript, Ruby, Groovy, etc.)</li>
<li>Built in support for scheduling tasks using the Quartz scheduler.</li>
<li>Load-balancing (with or without sticky sessions) /Fail-over, and clustered    Throttling and Caching support</li>
<li>WS-Security, WS-Reliable Messaging, Caching and Throttling configurable via    (message/operation/service level) WS-Policies</li>
<li>Lightweight, XML and Web services centric messaging model</li>
<li>Support for industrial standards (Hessian binary web service protocol/Financial    information exchange protocol)</li>
<li>Enhanced support for the VFS/JMS/Mail transports</li>
<li>Support for message splitting and aggregation using the EIP</li>
<li>Database lookup and store support with DBMediators with reusable database     connection pools</li>
<li>JMX monitoring support</li>
</ul>
</li>
<li><a href="http://wso2.org/projects/registry">WSO2 Registry </a> &#8211; WSO2 Registry is a user-friendly, but comprehensive enterprise resource / metadata management solution. It is capable of
<ul>
<li>Storing and managing arbitrary resources and collections</li>
<li>Tagging, commenting and rating</li>
<li>Managing users and roles</li>
<li>Authentication and authorization on all resources and actions</li>
<li>Resource / collection versioning and rollback</li>
<li>Advanced search capabilities &#8211; tags, users, etc.</li>
<li>Built in media type support for common types (WSDL, XSD)</li>
<li>Dependency management &#8211; maintain relationships between dependent resources</li>
<li>Pluggable media type handlers for handling custom media types</li>
<li>Support for processing custom URL patterns via pluggable URL handlers</li>
<li>Support for custom query languages via pluggable query processors</li>
<li>Activity log and filtering support for the activity logs</li>
<li>Atom Publishing Protocol (APP) support for reading/writing the data store remotely</li>
<li>Subscribe to directories, comments, tags, etc. with any standard feed reader (Bloglines, Google Reader, etc)</li>
<li>Java client for remote access via APP</li>
<li>Embedded and WAR deployments</li>
<li>Web based user interface with Web 2.0 look and feel</li>
</ul>
</li>
<li><a href="http://wso2.org/projects/bps">WSO2 Business Process Server (BPS) </a> &#8211; WSO2 Business Process Server (BPS) is an easy-to-use open source business process server that executes business processes written using the WS-BPEL standard and it&#8217;s powered by Apache ODE (Orchestration Director Engine). It provides you the following features,
<ul>
<li>Deploying Business Processes written in compliance with WS-BPEL 2.0 Standard and BPEL4WS 1.1 standard.</li>
<li>Managing BPEL packages, processes and process instances.</li>
<li>Data Sources support.</li>
<li>External Database support for BPEL engine.</li>
<li>WS-Security support for business processes.</li>
<li>WS-RM support for business processes.</li>
<li>Caching support for business processes.</li>
<li>Throttling support for business processes.</li>
<li>Transport management.</li>
<li>Internationalized web based management console.</li>
<li>System monitoring.</li>
<li>Try-it for business processes.</li>
<li>SOAP Message Tracing.</li>
<li>Web Services tooling support such as WSDL2Java, Java2WSDL and WSDL Converter.</li>
<li>Customizable server &#8211; You can customize the BPS to fit into your                 exact requirements, by removing certain features or by adding new                 optional features.</li>
</ul>
</li>
</ol>
<p>All these products are pre-bundled components built on top of WSO2 Carbon framework which is based on the OSGI technology. In fact you can bundle the components to suite your enterprise architecture as all the major features have been developed as pluggable Carbon components.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2009/02/10/wso2-carbon-products-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Good SOA Great</title>
		<link>http://www.dimuthu.org/blog/2009/01/31/making-good-soa-great/</link>
		<comments>http://www.dimuthu.org/blog/2009/01/31/making-good-soa-great/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 13:36:10 +0000</pubDate>
		<dc:creator>dimuthu</dc:creator>
				<category><![CDATA[DataServices]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Tutorial/Guide]]></category>
		<category><![CDATA[carbon]]></category>
		<category><![CDATA[web services]]></category>
		<category><![CDATA[wso2]]></category>
		<category><![CDATA[component]]></category>
		<category><![CDATA[enterprise]]></category>
		<category><![CDATA[OSGI]]></category>
		<category><![CDATA[SOA]]></category>

		<guid isPermaLink="false">http://www.dimuthu.org/?p=912</guid>
		<description><![CDATA[WSO2 is preparing for the first major release of their enterprise java product series after adapting the OSGI technology. You can already try out the betas from the wso2.org site.

WSO2 Web Services Application Server (WSAS)

WSO2 Enterprise Service Bus (ESB) 
WSO2 Registry 
WSO2 Business Process Server (BPS) 

With the power of OSGI you will be able [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://wso2.com/">WSO2</a> is preparing for the first major release of their enterprise java product series after adapting the OSGI technology. You can already try out the betas from the <a href="http://wso2.org/projects/carbon">wso2.org</a> site.</p>
<ol>
<li><a href="http://wso2.org/projects/wsas/java">WSO2 Web Services Application Server (WSAS)<br />
</a></li>
<li><a href="http://wso2.org/projects/esb/java">WSO2 Enterprise Service Bus (ESB) </a></li>
<li><a href="http://wso2.org/projects/registry">WSO2 Registry </a></li>
<li><a href="http://wso2.org/projects/bps">WSO2 Business Process Server (BPS) </a></li>
</ol>
<p>With the power of OSGI you will be able to customize these products for your need just by mixing and matching the components within these products. If you like to learn more about this, just have a loot at the following ebook released by WSO2.</p>
<div id="attachment_913" class="wp-caption aligncenter" style="width: 310px"><a href="http://wso2.org/project/carbon/making_good_soa_great.pdf"><img class="size-medium wp-image-913" title="Making Good SOA Great" src="http://www.dimuthu.org/wp-content/uploads/2009/01/ebook-300x249.png" alt="Making Good SOA Great" width="300" height="249" /></a><p class="wp-caption-text">Making Good SOA Great</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.dimuthu.org/blog/2009/01/31/making-good-soa-great/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
