<?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>redstream &#187; BPEL</title>
	<atom:link href="http://www.redstream.nl/tag/bpel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.redstream.nl</link>
	<description>Pragmatic Integrators</description>
	<lastBuildDate>Fri, 27 Jan 2012 19:31:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Combining Mule with a BPEL Engine</title>
		<link>http://www.redstream.nl/2009/12/18/combining-mule-with-a-bpel-engine/</link>
		<comments>http://www.redstream.nl/2009/12/18/combining-mule-with-a-bpel-engine/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 09:26:38 +0000</pubDate>
		<dc:creator>Pascal Alma</dc:creator>
				<category><![CDATA[BPEL]]></category>
		<category><![CDATA[Maven]]></category>
		<category><![CDATA[Mule]]></category>
		<category><![CDATA[SoapUI]]></category>
		<category><![CDATA[Web Service]]></category>
		<category><![CDATA[Netbeans]]></category>

		<guid isPermaLink="false">http://blog.redstream.nl/?p=1501</guid>
		<description><![CDATA[In my current project we are going to need a BPEL engine besides our Mule CE implementation. Actually, we will use Mule for our stateless communication between systems and use BPEL for the stateful processes. One of the possible frameworks &#8230; <a href="http://www.redstream.nl/2009/12/18/combining-mule-with-a-bpel-engine/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.redstream.nl%2F2009%2F12%2F18%2Fcombining-mule-with-a-bpel-engine%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.redstream.nl%2F2009%2F12%2F18%2Fcombining-mule-with-a-bpel-engine%2F&amp;source=redstreamlive&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In my current project we are going to need a <a href="http://en.wikipedia.org/wiki/Business_Process_Execution_Language">BPEL</a> engine besides our <a href="http://www.mulesoft.org/display/MULE2INTRO/Home">Mule CE</a> implementation. Actually, we will use Mule for our stateless communication between systems and use BPEL for the stateful processes. One of the possible frameworks to use as a BPEL engine is <a href="http://ode.apache.org">Apache ODE</a>. In this post I will show you how you can start a BPEL process in Apache ODE with Mule. As you will see, it is merely a combination of posts I made earlier, but I think it is nice to have the complete thing in one post.<br />
<span id="more-1501"></span><br />
<strong>Step 0: Assumptions</strong>s<br />
Assumed is:</p>
<ul>
<li>an Apache ODE instance (preferably deployed in Tomcat)</li>
<li>Maven 2.2.0</li>
<li>JDK 1.6</li>
<li>Netbeans 6.8,</li>
<li>Mule CE 2.2.2-SNAPSHOT</li>
</ul>
<p>Of course, it might work with other version but these are the versions I used.</p>
<p><strong>Step 1: Create a running BPEL process</strong></p>
<p>The first step is to create a running BPEL example. I use the latest version of Netbeans for that and<br />
<a href="http://technology.amis.nl/blog/3355/running-a-bpel-process-created-with-netbeans-in-apache-ode">this post</a>. To make use of the SOA wizards in the new Netbeans you have to enable this as an extension as described <a href="http://www.redstream.nl/2009/12/15/creating-bpel-modules-using-netbeans-6-8/">here</a>.<br />
To create the BPEL example perform the following steps:</p>
<ol>
<li> Creating a new BPEL module named &#8216;TextModule&#8217;<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/12/bpel-module.jpg" alt="bpel-module" title="bpel-module" width="80%" class="alignnone size-full wp-image-1506" />
</li>
<li>Add a WSDL to the project</li>
<p> Add a WSDL that describes the web service (remark: I wasn&#8217;t able to create a document-literal web service with the wizard in Netbeans so I edited the source by hand afterwards). <a href="http://www.redstream.nl/wp-content/uploads/2009/12/TxtLengthService.wsdl">Here</a> is my WSDL.</p>
<li>Add a BPEL process to the module, name it &#8216;txtLengthProcess&#8217;<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/12/bpel-process1.jpg" alt="bpel-process" title="bpel-process" width="80%"  class="alignnone size-full wp-image-1511" /></p>
<p>This created process is empty so add functionality to it by following the guidelines as in <a href="http://technology.amis.nl/blog/3355/running-a-bpel-process-created-with-netbeans-in-apache-ode">this post</a>. I ended up with the following process diagram:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/12/Screen-shot-2009-12-17-at-09.15.12.jpg"  width="100%" class="alignnone size-full wp-image-1511" /><br />
The mapping in the assignment step looks like this:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/12/Screen-shot-2009-12-17-at-09.15.42.jpg" width="100%"  class="alignnone size-full wp-image-1511"/><br />
I created the necessary variables to assign the values to in the &#8216;receive&#8217; and &#8216;reply&#8217; step.
</li>
<li>Create a file &#8216;deploy.xml&#8217;<br />
My file has the following content:</p>

<div class="wp_codebox"><table><tr id="p15016"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code" id="p1501code6"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;deploy</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.apache.org/ode/schemas/dd/2007/03&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns:pns</span>=<span style="color: #ff0000;">&quot;http://www.redstream.nl/TxtLengthProcess&quot;</span></span>
<span style="color: #009900;">    <span style="color: #000066;">xmlns:wns</span>=<span style="color: #ff0000;">&quot;http://www.redstream.nl/TxtLengthService&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;process</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;pns:TxtLengthProcess&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;active<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/active<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;provide</span> <span style="color: #000066;">partnerLink</span>=<span style="color: #ff0000;">&quot;TxtLengthPartnerLink&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;wns:TxtLengthServiceService&quot;</span> <span style="color: #000066;">port</span>=<span style="color: #ff0000;">&quot;TxtLengthServicePort&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/provide<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/process<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/deploy<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

</li>
<li> Deploy it to the Tomcat instance that is running Apache ODE<br />
To deploy the process create a directory named &#8216;TxtLengthService&#8217; under &#8216;<tomcat-dir>/webapps/ode/WEB-INF/processes&#8217;. Copy the three files (deploy.xml, TxtLengthProcess.bpel and TxtLengthService.wsdl) to this directory. When your deployment was successful you’ll see the &#8216;TxtLengthService.wsdl&#8217; at http://localhost:8080/ode/services/listServices:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/12/servicesList.jpg" alt="servicesList" title="servicesList" width="100%" class="alignnone size-full wp-image-1524" />
</li>
<li> (Optional) you can test the service with SoapUI<br />
With a successful request-response  you will get the following result:<br />
<img src="http://www.redstream.nl/wp-content/uploads/2009/12/soap-ui-call.jpg" alt="soap-ui-call" title="soap-ui-call" width="100%" class="alignnone size-full wp-image-1526" />
</li>
</ul>
<p>If you want more details on how to set up a Apache ODE service have look <a href="http://technology.amis.nl/blog/3355/running-a-bpel-process-created-with-netbeans-in-apache-ode">here</a>. It goes into more detail then I am in this post.</p>
<p><strong>Step 2: Generate Java client for web service to start ODE process</strong></p>
<p>We use Metro for this because we had <a href="http://www.redstream.nl/2009/07/01/mule2-cxf-and-serializable-classes/">some bad experiences</a> when using CXF for this. It is described <a href="http://www.redstream.nl/2009/03/14/make-serializable-jax-ws-clients-with-maven2/">here</a> how to do this in combination with Maven.<br />
I created a new Maven project with this <a href="http://www.redstream.nl/wp-content/uploads/2009/12/pom1.xml">&#8216;pom.xml&#8217;</a>.<br />
When the client is generated you can test it with a test class like this:</p>

<div class="wp_codebox"><table><tr id="p15017"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code" id="p1501code7"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">nl.redstream.ws.test</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">nl.redstream.txtlengthservice.TxtLengthService</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.Test</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 *
 * @author pascal
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> TestService <span style="color: #009900;">&#123;</span>
&nbsp;
    @Test
     <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testIt<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        TxtLengthService service <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TxtLengthService<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <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: #003399;">String</span></a> value <span style="color: #339933;">=</span> service.<span style="color: #006633;">getTxtLengthServiceSOAP11PortHttp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">txtLengthOperation</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;RedStream&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <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: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;result = &quot;</span> <span style="color: #339933;">+</span> value<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p><strong>Step 3: Create the Mule project</strong></p>
<p>To let Mule call the BPEL process I created a new Maven project that is able to test the call with a Mule client. The project is based on this <a href="http://www.redstream.nl/wp-content/uploads/2009/12/pom2.xml">&#8216;pom.xml&#8217;</a>.<br />
The used &#8216;ode-test-config.xml&#8217; looks like:</p>

<div class="wp_codebox"><table><tr id="p15018"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code" id="p1501code8"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mule</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.mulesource.org/schema/mule/core/2.2&quot;</span></span>
<span style="color: #009900;">       <span style="color: #000066;">xmlns:spring</span>=<span style="color: #ff0000;">&quot;http://www.springframework.org/schema/beans&quot;</span></span>
<span style="color: #009900;">       <span style="color: #000066;">xmlns:test</span>=<span style="color: #ff0000;">&quot;http://www.mulesource.org/schema/mule/test/2.2&quot;</span></span>
<span style="color: #009900;">       <span style="color: #000066;">xmlns:vm</span>=<span style="color: #ff0000;">&quot;http://www.mulesource.org/schema/mule/vm/2.2&quot;</span></span>
<span style="color: #009900;">       <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span>
<span style="color: #009900;">       <span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;</span>
<span style="color: #009900;">       http://www.mulesource.org/schema/mule/core/2.2 http://www.mulesource.org/schema/mule/core/2.2/mule.xsd</span>
<span style="color: #009900;">       http://www.mulesource.org/schema/mule/test/2.2 http://www.mulesource.org/schema/mule/test/2.2/mule-test.xsd</span>
<span style="color: #009900;">       http://www.mulesource.org/schema/mule/vm/2.2 http://www.mulesource.org/schema/mule/vm/2.2/mule-vm.xsd</span>
<span style="color: #009900;">       http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;model</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;mule-ode&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;start&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;inbound<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
                <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;vm:inbound-endpoint</span> <span style="color: #000066;">path</span>=<span style="color: #ff0000;">&quot;msg-in&quot;</span> <span style="color: #000066;">synchronous</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/inbound<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;component</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;nl.redstream.mule.BpelProcessClient&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/model<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mule<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>The created component class that handles the call to the SOAP client looks like:</p>

<div class="wp_codebox"><table><tr id="p15019"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code" id="p1501code9"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">nl.redstream.mule</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">nl.redstream.txtlengthservice.TxtLengthService</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #008000; font-style: italic; font-weight: bold;">/**
 *
 * @author pascal
 */</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> BpelProcessClient <span style="color: #009900;">&#123;</span>
&nbsp;
    <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: #003399;">String</span></a> callProcess<span style="color: #009900;">&#40;</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: #003399;">String</span></a> request<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000000; font-weight: bold;">new</span> TxtLengthService<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getTxtLengthServiceSOAP11PortHttp</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">txtLengthOperation</span><span style="color: #009900;">&#40;</span>request<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>And the used test class looks like:</p>

<div class="wp_codebox"><table><tr id="p150110"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
</pre></td><td class="code" id="p1501code10"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">nl.redstream.mule</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.junit.Test</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.mule.api.MuleException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.mule.api.MuleMessage</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.mule.module.client.MuleClient</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.mule.tck.FunctionalTestCase</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> BpelProcessClientTest <span style="color: #000000; font-weight: bold;">extends</span> FunctionalTestCase <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">private</span> MuleClient client <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">protected</span> MuleClient getClient<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>client <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                client <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> MuleClient<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>MuleException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aruntimeexception+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">RuntimeException</span></a><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #000000; font-weight: bold;">return</span> client<span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">final</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: #003399;">String</span></a> getConfigResources<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #0000ff;">&quot;config/ode-test-config.xml &quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    @Test
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> testBpelTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> MuleException
    <span style="color: #009900;">&#123;</span>
        MuleMessage msg <span style="color: #339933;">=</span> getClient<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">send</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;vm://msg-in&quot;</span>, <span style="color: #0000ff;">&quot;123456789012345&quot;</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</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: #003399;">System</span></a>.<span style="color: #006633;">out</span>.<span style="color: #006633;">println</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;payload = &quot;</span> <span style="color: #339933;">+</span> msg.<span style="color: #006633;">getPayload</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>When the test class is executed this results in the following output:</p>
<blockquote><p>
**********************************************************************<br />
* Mule ESB and Integration Platform                                  *<br />
* Version: 2.2.2-SNAPSHOT Build: 15252                               *<br />
* MuleSource, Inc.                                                   *<br />
* For more information go to http://mule.mulesource.org              *<br />
*                                                                    *<br />
* Server started: 12/17/09 8:34 PM                                   *<br />
* Server ID: 3d3eb71b-eb43-11de-bca6-7b92b51f04e0                    *<br />
* JDK: 1.6.0_17 (mixed mode)                                         *<br />
* OS encoding: MacRoman, Mule encoding: UTF-8                        *<br />
* OS: Mac OS X (10.6.2, x86_64)                                      *<br />
* Host: macbook-van-pascal-alma.local (192.168.1.204)                *<br />
*                                                                    *<br />
* Agents Running: None                                               *<br />
**********************************************************************<br />
INFO  2009-12-17 20:34:50,730 [main] org.mule.module.client.MuleClient: Using existing MuleContext: org.mule.DefaultMuleContext@1d6b6c55<br />
INFO  2009-12-17 20:34:50,756 [main] org.mule.transport.vm.VMMessageDispatcher: Connected: endpoint.outbound.vm://msg-in<br />
payload = 15<br />
INFO  2009-12-17 20:34:51,784 [main] org.mule.transport.vm.VMConnector: Removing listener on endpointUri: vm://msg-in<br />
INFO  2009-12-17 20:34:51,784 [main] org.mule.transport.vm.VMMessageReceiver: Disconnected: VMMessageReceiver{this=5a56182f, receiverKey=msg-in, endpoint=vm://msg-in}<br />
INFO  2009-12-17 20:34:51,785 [main] org.mule.component.DefaultJavaComponent: Stopping: org.mule.component.DefaultJavaComponent component for: SedaService{start}<br />
INFO  2009-12-17 20:34:51,785 [main] org.mule.model.seda.SedaService: Mule Service start has been stopped successfully<br />
INFO  2009-12-17 20:34:51,787 [main] org.mule.transport.vm.VMConnector: Stopping: VMConnector{this=75d709a5, started=true, initialised=true, name=&#8217;connector.VM.0&#8242;, disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=true, supportedProtocols=[vm], serviceOverrides=null}<br />
INFO  2009-12-17 20:34:51,787 [main] org.mule.transport.vm.VMConnector: Disconnected: VMConnector{this=75d709a5, started=false, initialised=true, name=&#8217;connector.VM.0&#8242;, disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=false, supportedProtocols=[vm], serviceOverrides=null}<br />
INFO  2009-12-17 20:34:51,787 [main] org.mule.transport.vm.VMConnector: Stopped: VMConnector{this=75d709a5, started=false, initialised=true, name=&#8217;connector.VM.0&#8242;, disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=false, supportedProtocols=[vm], serviceOverrides=null}<br />
INFO  2009-12-17 20:34:51,788 [main] org.mule.util.queue.TransactionalQueueManager: Stopping ResourceManager<br />
INFO  2009-12-17 20:34:51,788 [main] org.mule.util.queue.TransactionalQueueManager: Stopped ResourceManager<br />
INFO  2009-12-17 20:34:51,788 [main] org.mule.transport.vm.VMConnector: Disposing: VMConnector{this=75d709a5, started=false, initialised=true, name=&#8217;connector.VM.0&#8242;, disposed=false, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=false, supportedProtocols=[vm], serviceOverrides=null}<br />
INFO  2009-12-17 20:34:51,788 [main] org.mule.transport.vm.VMMessageDispatcher: Disconnected: VMMessageDispatcher{this=1915470e, endpoint=vm://msg-in, disposed=false}<br />
INFO  2009-12-17 20:34:51,788 [main] org.mule.transport.vm.VMConnector: Disposed: VMConnector{this=75d709a5, started=false, initialised=false, name=&#8217;connector.VM.0&#8242;, disposed=true, numberOfConcurrentTransactedReceivers=4, createMultipleTransactedReceivers=true, connected=false, supportedProtocols=[vm], serviceOverrides=null}<br />
INFO  2009-12-17 20:34:51,789 [main] org.mule.config.spring.MuleApplicationContext: Closing org.mule.config.spring.MuleApplicationContext@356f144c: display name [org.mule.config.spring.MuleApplicationContext@356f144c]; startup date [Thu Dec 17 20:34:49 CET 2009]; root of context hierarchy<br />
INFO  2009-12-17 20:34:51,789 [main] org.springframework.beans.factory.support.DefaultListableBeanFactory: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@29abc69: defining beans [customEditorConfigurer,_muleObjectNameProcessor,_mulePropertyPlaceholderProcessor, _muleSimpleRegistryBootstrap,_muleNotificationManager,_muleConfiguration,._muleNotificationManager: notification.1,._muleNotificationManager:notification.2,._muleNotificationManager:notification.3, ._muleNotificationManager:notification.4,._muleNotificationManager:notification.5,._muleNotificationManager: notification.6,._muleNotificationManager:notification.7,._muleNotificationManager:notification.8, ._muleNotificationManager:notification.9,._muleNotificationManager:notification.10,_muleSystemModel, _muleQueueManager,_muleSecurityManager,_muleProperties,_muleEndpointFactory,_muleStreamCloserService, _defaultThreadingProfile,_defaultMessageDispatcherThreadingProfile,_defaultMessageRequesterThreadingProfile, _defaultMessageReceiverThreadingProfile,_defaultServiceThreadingProfile,_defaultRetryPolicyTemplate, mule-ode,start,.start:inbound.11,.start:inbound.11:inbound-endpoint.12,.start:component.13]; root of factory hierarchy<br />
INFO  2009-12-17 20:34:51,995 [main] org.mule.DefaultMuleContext:<br />
**********************************************************************<br />
* Mule shut down normally on: 12/17/09 8:34 PM                       *<br />
* Server was up for: 0 days, 0 hours, 0 mins, 1.318 sec              *<br />
**********************************************************************<br />
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.103 sec
</p></blockquote>
<p>So by finishing this post you should be able to execute a (simple) BPEL process in Apache ODE by using Mule. However, it is not certain we will use Apache ODE like this. I think we would like <a href="http://www.intalioworks.com/products/bpm/opensource-edition/server/">Intalio|server</a> more because of the handy features/tooling they have added to Apache ODE.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.redstream.nl/2009/12/18/combining-mule-with-a-bpel-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

