<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>Antony Reynolds&apos; Blog</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/" />
   <link rel="self" type="application/atom+xml" href="http://blogs.oracle.com/reynolds/xml/rss.xml" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87</id>
   <updated>2008-07-22T14:18:43Z</updated>
   
   <generator uri="http://www.sixapart.com/movabletype/">Movable Type Enterprise 1.52-en-voltron-r47459-20070213</generator>

<entry>
   <title>Student SOA Survey</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/07/student_soa_survey.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.5502</id>
   
   <published>2008-07-22T13:43:42Z</published>
   <updated>2008-07-22T14:18:43Z</updated>
   
   <summary>Support for SOA Survey I just received an EMail from a student, Galin Monev, at Cork ... I am currently a student of MBS “Information Systems for Business Performance” at University College Cork, Ireland. As a final part of the...</summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
   
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h1>Support for SOA Survey</h1>
I just received an EMail from a student, Galin Monev, at Cork ...<br>

<p><i>I am currently a student of MBS “Information Systems for Business<br />
Performance” at University College Cork, Ireland. As a final part of the<br />
programme I have to carry out an industry-based project. Therefore, I am<br />
writing on the behalf of my group regarding our thesis project. We are<br />
investigating how SOA can influence the IT capability of a firm and to what<br />
extend this strategy can become a major initiative for changing the<br />
underlined business approach of an organization. <br />
We came across your blog and we are wondering if you could help us by<br />
filling out a survey. We would really appreciate if you could forward our<br />
survey to friends (through your blog) and colleges who you think can<br />
contribute positively to this survey.<br><br />
The survey is in two parts and will take no longer than 5-10 minutes. It is<br />
located at:<br><br />
<a href="http://www.surveymonkey.com/s.aspx?sm=fmiRVCG0gBSazAo2TD5y1w_3d_3d">Part 1</a><br><br />
<a href="http://www.surveymonkey.com/s.aspx?sm=nhGoidn75v816XG39Tdkpg_3d_3d">Part 2<br />
</a><br></p>

<p>We would also appreciate any additional comments you may have or additional<br />
assistance you would like to provide.</p>

<p>If you have any questions or comments, please contact me at <a href="mailto:galin.monev@gmail.com">galin.monev@gmail.com</a>. I am hoping for your kind consideration and<br />
participation.</i><br></p>

<p>So if you get chance why not support him, I will ask him to share his findings later.</p>]]>
      
   </content>
</entry>
<entry>
   <title>Fusion Middleware Roadmap</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/07/fusion_middleware_roadmap.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.5143</id>
   
   <published>2008-07-01T17:53:53Z</published>
   <updated>2008-07-01T22:19:44Z</updated>
   
   <summary>I spent last week in Redwood Shores listening to product development outline their plans and directions for Fusion Middleware in the light of the BEA acquisition.&amp;#160; Today we made those plans public through a webcast hosted by Charles Phillips and...</summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="fmw" label="FMW" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fusionmiddleware" label="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<p>I spent last week in Redwood Shores listening to product development outline their plans and directions for Fusion Middleware in the light of the BEA acquisition.&#160; Today we made those plans public through a <a href="http://www.oracle.com/features/hp/middleware-strategy.html">webcast</a> hosted by Charles Phillips and Thomas Kurian.</p>  <p>I think some of the former BEA folks were a little surprised to see <a href="http://www.oracle.com/appserver/index.html">WebLogic Server</a> chosen as the Oracle JEE platform over OC4J, but it makes a lot of sense – which product has the larger deployed base, which has the greater developer mindshare, which did we just spend billions of dollars acquiring.&#160; I was delighted that Thomas and Steve Harris (our VP for Java products) were able to make such a clear decision so early on, as it gives the market a great deal of clarity.</p>  <p>Similarly I think the decision to promote the <a href="http://www.oracle.com/technologies/soa/service-bus.html">AquaLogic Server Bus</a> into the Oracle SOA Suite as the preferred ESB is again the right decision.&#160; Personally this is causing me a lot of problems because I am in the midst of writing a book about the SOA Suite and now I have to revise it to use the Oracle Service Bus (nee ALSB) rather than the old Oracle ESB :-(&#160; But otherwise it is a good thing.</p>  <p>Over the last few months as I have looked into the BEA product set I have been surprised how complementary much of the technology actually is.&#160; For example one area where Oracle has been weak in product is around the <a href="http://www.oracle.com/technologies/soa/soa-governance.html">governance</a> space.&#160; This area will receive a big boost from the <a href="http://www.oracle.com/technologies/soa/enterprise-repository.html">Oracle Enterprise Repository</a>.</p>  <p></p>  <p></p>  <p>The area of <a href="http://www.oracle.com/technologies/bpm/index.html">Business Process Management</a> is an interesting one, because in the past we have pushed BPEL – which is really a service orchestration engine – as a BPM tool.&#160; The addition of BPEL to ALBPM in the BPM Suite will strengthen the ALBPM story and at the same time continue to allow BPEL to be used as a service orchestration engine in the SOA Suite.&#160; In the longer term the plan to converge the two products into a single run time will be worth watching.</p>  <p>I think the most surprising area to me was in the area of transaction processing.&#160; Certainly there are strong synergies between <a href="http://www.oracle.com/technology/products/jrockit/jrrt/index.html">JRockit Real Time</a> and <a href="http://www.oracle.com/technology/products/coherence/index.html">Coherence</a> – boosted by the <a href="http://www.oracle.com/technology/products/wag/index.html">WebLogic Application Grid</a> offering.&#160; But the surprising bit was the emphasis that Thomas Kurian made on <a href="http://www.oracle.com/technology/products/tuxedo/index.html">Tuxedo</a>.&#160; It seems as though the Tuxedo guys are being rehabilitated after years in the wilderness at BEA since the WebLogic acquisition.&#160; I was amazed at the increase in connectivity and functionality that has occurred in Tux since I last came into contact with it some ten years ago.</p>  <p>So all told, I am happy about the stated product directions.&#160; They all seem to drive towards Thomas’ goal of a single, complete and integrated middleware suite.&#160; The next couple of years may be a bit bumpy as we smooth out the differences between the two product sets, but even today I think we have a cracking offering that is a world beater – not that I am biased of course!</p>]]>
      
   </content>
</entry>
<entry>
   <title>Throttling Files</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/06/throttling_files.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4145</id>
   
   <published>2008-06-14T05:06:45Z</published>
   <updated>2008-07-01T22:21:13Z</updated>
   
   <summary><![CDATA[Throttling FilesI'm sure everyone has been tempted to grab a file by the throat and squeeze it until it departs for that great filing cabinet in the sky, but that is something to discuss quietly with your psychiatrist.&nbsp; In this...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="SOA Suite" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="adapters" label="Adapters" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="bpel" label="BPEL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fmw" label="FMW" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fileadapter" label="File Adapter" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fusionmiddleware" label="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="soasuite" label="SOA Suite" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="threading" label="Threading" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h1>Throttling Files</h1><p>I'm sure everyone has been tempted to grab a file by the throat and squeeze it until it departs for that great filing cabinet in the sky, but that is something to discuss quietly with your psychiatrist.&nbsp; In this entry I would like to investigate how to limit the concurrency of file handling procedures.</p><h2>A Concurrency Problem</h2>By default the interaction with the file adapter is a one way interaction.&nbsp; The file adapter posts a message into the queue for a process and then carries on about its business.&nbsp; This is good because it allows multiple files, or multiple batches from a single file to be processed concurrently.&nbsp; However if there are a large number of concurrent processes started then this can cause performance problems as the process manager starts to worry about which process to execute when.&nbsp; One sympton of this is undelivered messages visible on the BPEL console.<br><img src="http://blogs.oracle.com/reynolds/images/UNdeliveredMessages.jpg" width="100%"><br>This is bad because it means we are feeding BPEL process manager faster than it can consume, and so it gags a little and throughput is reduced as it gags.<br><h2>Stopping Force Feeding</h2>So how do we tell the file adapter that BPELs mouth is full and please wait until I have eaten this bit.&nbsp; Well the answer is in the observation that interactions with the file adapter are usually one way.&nbsp; They do not need to be!&nbsp; It is possible to modify the WSDL generated by the file adapter wizard to support a two way interaction.&nbsp; This causes the file adapter thread to wait until the reply before sending another message.&nbsp; For the reasons why changing from a one-way to a two-way interaction causes this behaviour look at my earlier entry on <a href="http://blogs.oracle.com/reynolds/2008/02/threading_it_all_together.html">BPEL threading</a>.&nbsp; The answer is left as an exercise to the reader.<br><h3>Changing the File Adapter WSDL</h3>To change the one-way interaction to a two-way interaction we do the following in the generated WSDL file:<br><ul><li>Make sure that the definitions root element has a namespace reference to XML schema by adding the following</li><ul><li>xmlns:xsd="http://www.w3.org/2001/XMLSchema"</li></ul><li>Add a dummy message that will be used in a reply.</li><ul><li>&lt;message name="Dummy_msg"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;part name="PhoneRecords" type="xsd:string"/&gt;<br>&lt;/message&gt;</li></ul><li>Add a reply to the read operation</li><ul><li>&lt;output message="tns:Dummy_msg"/&gt;</li></ul><li>Add a reply to the binding</li><ul><li>&lt;output/&gt;</li></ul></ul>This gives a file like the one below<br><div style="margin-left: 40px;">&lt;definitions<br>&nbsp;&nbsp;&nbsp;&nbsp; name="ReadPhoneBookFileSvc"<br>&nbsp;&nbsp;&nbsp;&nbsp; targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/file/ReadPhoneBookFileSvc/"<br>&nbsp;&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">xmlns:xsd="http://www.w3.org/2001/XMLSchema"</span><br>&nbsp;&nbsp;&nbsp; &gt;<br>&nbsp; &nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp; &lt;message name="PhoneRecords_msg"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;part name="PhoneRecords" element="imp1:PhoneRecords"/&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/message&gt;<br>&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">&lt;message name="Dummy_msg"&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;part name="PhoneRecords" type="xsd:string"/&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp; &lt;/message&gt;</span><br style="font-weight: bold;">&nbsp;&nbsp;&nbsp; &lt;portType name="Read_ptt"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;operation name="Read"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input message="tns:PhoneRecords_msg"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">&lt;output message="tns:Dummy_msg"/&gt;</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/operation&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/portType&gt;<br>&nbsp;&nbsp;&nbsp; &lt;binding name="Read_binding" type="tns:Read_ptt"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;pc:inbound_binding&nbsp; /&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;operation name="Read"&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;jca:operation<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OpaqueSchema="false" &gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/jca:operation&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;input&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;jca:header message="hdr:InboundHeader_msg" part="inboundHeader"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/input&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-weight: bold;">&lt;output/&gt;</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/operation&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/binding&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp; ...<br>&lt;/definitions&gt;<br></div><h3>Modifying the BPEL Process</h3>Having modified the WSDL we must modify the BPEL to now do a reply.&nbsp; The reply will release the file handling thread in the adapter to do further work.&nbsp; The modified process is available as project BigBatchProcess1.2 in the <a href="http://blogs.oracle.com/reynolds/gems/FileManipulation.zip">FileManipulation.zip</a> file.&nbsp; Details of using this process can be found in an earlier entry on batch processing of files.&nbsp; Note that there is an additional test file included in the src directory - phonebook2.csv - that has 5000 records in it to give a larger test case.<br><h2>Other Scenarios</h2>The above scenario is not the only one where we may wish to use a two-way interaction with the file adapter.&nbsp; The following additional scenarios may also occur.<br><h3>Reading a File Sequentially</h3>We may need to process a file in strict record order yet still want to have it batched because it is a large file.&nbsp; In this case the problem is that we may have multiple batches submitted concurrently and there is no guarantee of the order that they will be processed in.&nbsp; In this case just making the interaction two-way is not enough because there may be more than one file processing thread.<br><h3>Controlling the Number of File Processing Threads</h3>The number of threads used to process files in the file adapter is controlled by a setting in the file $ORACLE_HOME/bpel/system/services/config/pc.properties.&nbsp; To alter the number of threads change the following property:<br><ul><li>oracle.tip.adapter.file.numProcessorThreads=1</li></ul>Note that this is a global setting and so may impact other file activation agents that have been configured in the system.&nbsp; The net result of this is to limit file processing to a single thread.&nbsp; Hence by using a single thread and a two-way interaction we can single thread the file processing and so guarantee processing of records in order in a file.<br><h3>Processing Files in Date Order</h3>Another scenario where these techniques are applied is when there is a requirement to process files in order of last modification date, for example when later files may contain reversing transactions for earlier files.&nbsp; This can currently only be achieved in 10.1.3.1 via a patch but it should also be available at some point in 10.1.3.3 and later releases.<br><h2>Final Thoughts</h2>The use of two-way interactions and limiting threads processing files is very powerful but it needs to be considered in the context of other file interactions in the system.&nbsp; One way to limit the impact is to use singleton processes to receive the processing requests, enabling messages to be queued in order, releasing the file processing threads for other processes to use whilst still ensuring correct ordering in the required processes.<br>Hope this helped.<br><br>]]>
      
   </content>
</entry>
<entry>
   <title>More on Batch Processing in BPEL</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/06/more_on_batch_processing_in_bp.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4146</id>
   
   <published>2008-06-11T22:23:32Z</published>
   <updated>2008-07-01T22:23:40Z</updated>
   
   <summary><![CDATA[More on Batch Processing in BPELI was asked a follow up question recently on my entry about batch processing in BPEL.&nbsp; The individual had implemented a BPEL process similar to the one shown below.A Use CaseThe process needs to refresh...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="SOA Suite" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="adapters" label="Adapters" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="bpel" label="BPEL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fmw" label="FMW" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fileadapter" label="File Adapter" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fusionmiddleware" label="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="soasuite" label="SOA Suite" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h1>More on Batch Processing in BPEL</h1>I was asked a follow up question recently on my entry about <a href="http://blogs.oracle.com/reynolds/2007/06/batch_processing_with_bpel.html">batch processing in BPEL</a>.&nbsp; The individual had implemented a BPEL process similar to the one shown below.<br><img src="http://blogs.oracle.com/reynolds/images/BigBatchProcess1.0.jpg"><br><h2>A Use Case</h2>The process needs to refresh the corporate phone book.&nbsp; It does this by reading a file with the new phone details, deleting the old phone details from a database and then inserting the new phone details into the database.<br>A file is read into the process via ReceivePhoneBook activity.&nbsp; The ClearPhoneBook activity uses custom SQL to truncate the phonebook table.&nbsp; Finally after transforming the file format to database format the new phone details are inserted into the table using the InsertIntoPhoneBookActivity to insert multiple records into the table in a single call.<br><h2>A Fly in the Ointment</h2>This process works fine as long as all the records are received in a single message.&nbsp; If they are received in multiple messages then not all the records will be written as multiple processes will receive part of the input file, but all the processes will truncate the table, resulting in the possibility of some records being inserted by one process and deleted by another process that starts a little later.&nbsp; This is illustrated in the diagram below which shows three processes each processing a portion of the file.<br><img src="http://blogs.oracle.com/reynolds/images/RecordOrder.jpg"><br>Note that records 1-10 are written to the database at the same time as the table is truncated by the process receiving records 11-20, leaving the possibility that the write will complete only to be overridden by the truncate.&nbsp; If records 1-10 are not overwritten by the second process they will definitely be overwritten by the third process which only starts truncating the table after records 1-10 have been inserted into the table.<br><h2>A Solution</h2>What we need to do is to separate the deletion of the existing data from the insertion of the new data.&nbsp; We can do this by moving the truncation of the table (deleting the existing data) into a separate BPEL process.&nbsp; Such a process is shown below.<br><img src="http://blogs.oracle.com/reynolds/images/FileNotification.jpg"><br>For this to work we need to know when a new file starts to be loaded so that this process can be invoked before any record processing is performed.&nbsp; Now there are lots of complicated ways that we could do this with singleton processes to maintain state and complex logic to make sure it all works.&nbsp; Or we could use a newish feature of the BPEL process manager (introduced in 10.1.3.3 I believe) to get it to invoke our process.<br><h3>Batch Manager<br></h3>In the previous discussion I ignored the partner link that initiates the record deletion process.&nbsp; This partner link implements the Batch Manager interface as specified in $ORACLE_HOME/bpel/system/xmllib/jca/BatchManager.wsdl.&nbsp; To create the above process first create a new empty BPEL process and then in the services stream right click and select new partner link.&nbsp; Click on the <img src="http://blogs.oracle.com/reynolds/images/ImportWSDLIcon.JPG"> icon to browse for files from the local file system and select the BatchManager.wsdl file and choose to implement the BatchManagerInterfaceRole (i.e. choose this as "My Role" ).&nbsp; This is the interface used by BPEL Process Manager to notify a process that a file has started to be read.&nbsp; There are several methods available to receive different notifications<br><ul><li>onBatchReadStart - tells when a file is started to be read</li><li>onBatchReadComplete - tells when a file has finished being read</li><li>onBatchReadFailure - tells when a record or records cannot be processed by the adapter framework<br></li></ul>For this scenario we are interested in onBatchReadStart.&nbsp; Receiving this notification we know to truncate the table ready to receive the records.<br><h3>Who to Tell?</h3>How does the BPEL Process Manager know to call the notification process?&nbsp; The answer is that it is configured as an activation agent property in the bpel.xml file of the process receiving the records from the file adapter.&nbsp; To set up the notification it is necessary to add the following property tag to the bpel.xml at XPath location BPELSuitcase/BPELProcess/activationAgents/activationAgent :<br><ul><li>&lt;property name="batchNotificationHandler"&gt;bpel://default|FileNotificationProcess&lt;/property&gt;<br></li></ul>Note that default is the name of your domain and FileNotificationProcess is the name of your process.&nbsp; Adding this property will cause the BatchManager interface on the given process to be invoked when a file is read.<br><h2>Final Steps</h2>With notification configured we now need to modify our BPEL process to not truncate the table because this is being done via a separate process.&nbsp; We also need to add a delay to the process to avoid race conditions that could cause records to be inserted into the database before the database has been truncated.&nbsp; The modified process is shown below, complete with a 30 second delay to avoid problems with multiple processes being invoked at the same time.<br><img src="http://blogs.oracle.com/reynolds/images/BigBatchProcess1.1.jpg"><br><h2>A Worked Example</h2>I have created a sample to let you explore how all this works.&nbsp; To set it up do the following.<br><ol><li>Download the project files in <a href="http://blogs.oracle.com/reynolds/gems/FileManipulation.zip">FileManipulation.zip</a>.</li><li>Unzip FileManipulation.zip - this will create a FileManipulation directory with 3 sub-directories and a JDev 10.1.3.3 workspace</li><li>Open the workspace FileManipulation.jws in JDev 10.1.3.3<br></li><li>Create the following directories or modify the file adapter partner links in BigBatchProcess1.0 and BigBatchProcess1.1<br></li><ul><li>C:FilesInbound</li><li>C:FilesOutbound</li></ul><li>Create a test user in the database by running the script in FileManpulation/BigBatchProcess1.0/src/CreateUser.sql as a system user</li><li>Create a database connection in JDev called TestDS to connect to user Test (password test) in the database.&nbsp; You may need to rerun the adapter wizard if you are not running XE database on port 1521</li><li>As user test run the script in FileManpulation/BigBatchProcess1.0/database/CreateTable.sql to create the phonebook table.</li><li>Deploy the BigBatchProcess1.0 to the BPEL process manager.</li><li>Test it by copying file FileManpulation/BigBatchProcess1.0/src/PhoneBook1.csv to C:FilesInbound.</li><li>Verify the number of records stored by executing command in database "select count(*) from phonebook.&nbsp; There are 1000 records in the source file, you will probably receive a count less than 1000 due to race conditions around truncating the table and inserting records into it.&nbsp; This is the problem we are trying to avoid.<br></li><li>Deploy the BigBatchProcess1.1 to the BPEL process manager as version 1.1.</li><li>Deploy the FileNotificationProcess1.0 to the BPEL process manager.</li><li>Test it by copying file FileManpulation/BigBatchProcess1.0/src/PhoneBook1.csv to C:FilesInbound.</li><li>Verify the number of records stored by executing command in
database "select count(*) from phonebook.&nbsp; There are 1000 records in
the source file, you should now receive a count of 1000 in the database table, indicating thqat we have solved the problem.<br>
</li><li>Pat yourself on the back and have a nice drink.</li></ol>Hope that some of you find the above useful.<br>]]>
      
   </content>
</entry>
<entry>
   <title>Register of Interest</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/05/register_of_interest.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4147</id>
   
   <published>2008-05-17T06:06:06Z</published>
   <updated>2008-07-01T22:26:01Z</updated>
   
   <summary><![CDATA[Registering InterestI have been involved in some interesting discussions recently on the use of a service registry.&nbsp; Oracle SOA Suite ships with a limited use license for a service registry and there is the option to upgrade it to a...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="SOA Suite" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="bpel" label="BPEL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="esb" label="ESB" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fmw" label="FMW" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fusionmiddleware" label="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="soa" label="SOA" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="soasuite" label="SOA Suite" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h1>Registering Interest</h1>I have been involved in some interesting discussions recently on the use of a service registry.&nbsp; Oracle SOA Suite ships with a limited use license for a service registry and there is the option to upgrade it to a full use license and so the question comes up, Antony why would we want to use a registry and can we use it for all our service lookups.<br>Lets start by looking at what a registry is.<br><h2>Glorified Yellow Pages</h2>Uncharitably a registry may be described as a glorified yellow pages.&nbsp; It allows artifacts such as XML schema and service WSDLs to be stored in a searchable, categorized archive.&nbsp; Artifacts are stored under different categories and may have keywords associated with them to assist in searching.&nbsp; So at the end of the day the registry is just a repository of meta-data about artifacts.&nbsp; In the same way a car is just a large amount of beaten metal with a power unit that drives wheels.&nbsp; Calling it a repository of meta-data does not actually explain what it does or how it may be used.<br><h2>Registry use Cases</h2>Let me suggest a few registry use cases<br><ul><li>Design Time Service Discovery<br>A registry can be used to catalogue existing services and associated artifacts.&nbsp; This encourages re-use by making it easier to discover existing services.&nbsp; The ability to promote items between registries also makes it possible to put in place a service approval process that vets new services before making them available to developers.&nbsp; This again promotes re-use and generalisation of existing services.<br></li><li>Run Time Service Discovery<br>A registry can also be used at runtime to provide the physical endpoint for a service.&nbsp; This makes it easy to change the physical provider of a particular service.&nbsp; This also simplifies migration of services between development test and production environments as outlined in the next use case.<br></li><li>Service Migration Mechanism<br>The use of multiple registries provided a managed path for services to be promoted between environments, either from a development perspective or from a runtime perspective.</li></ul><h2>Design Time Considerations</h2>Use of a registry at design time is generally a good idea but it does a require a certain amount of discipline in its use otherwise it becomes yet another dumping ground for all design decisions, good and bad!&nbsp; However individual develpoment team can maintain their own local registry that has a well defined promotion process to a central registry, allowing teams to work on their development services which may later be migrated to a corporate registry.&nbsp; In my experience most customers are not making use of a registry even in their design time environments and this is probably the best place to start using a registry.<br><h2>Run Time Considerations</h2>Using a registry in a runtime environment promises a greater degree of de-coupling.&nbsp; However a similar amount of decoupling may be achieved through the use of an ESB alone.&nbsp; If a registry is used to look up an ESB endpoint then there is a potential cost to be paid in terms of an additional lookup.&nbsp; If an ESB endpoint is not looked up then there is the risk of coupling the data formats of unrelated services together, losing the use of an ESB to provide message transformation to/from canonical form.&nbsp; Some informal tests I ran indicated that the additional overhead of a registry lookup does not add much to the service invocation, but in high volume environments it may be the straw that breaks the camels back.<br>A good policy may be to begin using a service registry in design time, later trying it out in non-high volume environments.&nbsp; Using an ESB can make this migration to registry use easier, if less pure by having the ESB perform the registry lookup.<br><h2>Using a Registry with Oracle BPEL PM</h2>The current production release of Oracle BPEL PM has built in support for use of a registry.&nbsp; Al that is required to make a service lookup occur through a registry is to perform the following.<br><ol><li>In the BPEL Console, go to the "Manage BPEL Domain" and set the following properties</li><ul><li>uddiLocation - the inquiry address of the registry</li><li>uddiUsername - if it is a secured registry set it to a username for performing lookups, if not set it to urn:unknown</li><li>uddiPassword - if it is a secured registry set it to a password for performing lookups, if not set it to urn:unknown</li></ul><li>In a BPEL process for each service endpoint (partner link) that you want to go through a UDDI lookup</li><ul><li>Add a property "registryServiceKey" to the partner link with the "Entity Key" value assigned in the UDDI repository</li></ul></ol>For more on potential performance impacts of registry lookup see <a href="http://chintanblog.blogspot.com/2008/04/performance-with-esb-and-bpel-run-time.html">Chintan Shahs blog entry</a>. Note that I haven't seen such a bad degradation as he reports, but I could believe it for a complex WSDL and high system load, meaning unresponsive threading, particularly in a Windows environment.<br><h1>An Example of Dynamic Lookup</h1>To give a feel for dynamic lookup I have uploaded 3 JDeveloper Projects in the <a href="http://blogs.oracle.com/reynolds/gems/DynamicLookup.zip">this file</a>.<br><ul><li>JavaWS includes a simple Java web service (GreetingWS) that can be registered in a service registry.&nbsp; When registering it in the registry you will need to note the service key and copy it into the partner link property in Dynamic BPEL.<br></li><li>DynamicBPEL is a BPEL process that looks up the web service (GreetingWS) and invokes it in three different ways</li><ol><li>Static, it uses the endpoint defined in a WSDL file</li><li>Dynamic, it sets the endpoint explicitly (passed in as a parameter to the process), showing how you can be very dynamic in the endpoint you invoke.</li><li>UDDI, it uses the UDDI repository to lookup the endpoint, showing how unintrusive it is on the rest of the process.</li></ol><li>TestDynamic is a BPEL process that you invoke to test the DynamicBPEL process.&nbsp; It iterates over all three methods and calculates how long each method takes to complete the given number of iterations.&nbsp; The first invocation is not counted to allow the system to "warm up" for each call.<br></li></ul>]]>
      
   </content>
</entry>
<entry>
   <title>More on Time!</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/05/more_on_time.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4148</id>
   
   <published>2008-05-13T00:51:41Z</published>
   <updated>2008-07-01T22:27:32Z</updated>
   
   <summary><![CDATA[More on Time!Seems that dateTime is one of the most frustrating types in XML.&nbsp; I just had a colleague ask how to convert a string to an XML dateTime type.&nbsp; There are a rich range of functions to convert dateTimes...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="SOA Suite" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="bpel" label="BPEL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fmw" label="FMW" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fusionmiddleware" label="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="soasuite" label="SOA Suite" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="xml" label="XML" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="xslt" label="XSLT" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h1>More on Time!</h1>Seems that dateTime is one of the most frustrating types in XML.&nbsp; I just had a colleague ask how to convert a string to an XML dateTime type.&nbsp; There are a rich range of functions to convert dateTimes to strings, but a paucity to do the reverse.&nbsp; So I present here one approach to this.&nbsp; I use XSLT variables to help in the parsing.&nbsp; Here is the XSLT fragment that converts a US formatted date <span style="font-style: italic;">(</span><span style="font-weight: bold;"><span style="font-style: italic;">MM</span>/<span style="font-style: italic;">DD</span>/<span style="font-style: italic;">YYYY</span></span>) to an XML dateTime format (<span style="font-weight: bold;"><span style="font-style: italic;">CCYY</span>:<span style="font-style: italic;">MM</span>:<span style="font-style: italic;">DD</span>T<span style="font-style: italic;">HH</span>:<span style="font-style: italic;">MM</span>:<span style="font-style: italic;">SS</span></span>).&nbsp; Note that in an XML dateTime all fields are mandatory, the only optional pieces are the decimal part of the seconds (<span style="font-weight: bold;"><span style="font-style: italic;">CCYY</span>:<span style="font-style: italic;">MM</span>:<span style="font-style: italic;">DD</span>T<span style="font-style: italic;">HH</span>:<span style="font-style: italic;">MM</span>:<span style="font-style: italic;">SS.SS</span></span>) and the timezone portion (<span style="font-weight: bold;"><span style="font-style: italic;">CCYY</span>:<span style="font-style: italic;">MM</span>:<span style="font-style: italic;">DD</span>T<span style="font-style: italic;">HH</span>:<span style="font-style: italic;">MM</span>:<span style="font-style: italic;">SS</span></span><span style="font-style: italic; font-weight: bold;"></span><span style="font-weight: bold;">Z<span style="font-style: italic;"> or </span></span><span style="font-weight: bold;"><span style="font-style: italic;">CCYY</span>:<span style="font-style: italic;">MM</span>:<span style="font-style: italic;">DD</span>T<span style="font-style: italic;">HH</span>:<span style="font-style: italic;">MM</span>:<span style="font-style: italic;">SS</span></span><span style="font-style: italic;">+</span><span style="font-weight: bold;"><span style="font-style: italic;">02:00</span></span>).<br>In the fragment below I take the input data from XPath expression /DateList/SingleDate/DateField.&nbsp; This has the date in format MM/DD/YYYY.&nbsp; I use this input to populate an element dateitem which is of dateTime type.<br>Lets go throught the XSLT a little at a time.<br><br><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;dateitem&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;!-- Parse Date of format MM/DD/YYYY --&gt;</span><br style="font-weight: bold;"><span style="font-style: italic;">&lt;!-- I declare a variable TempInput to hold everything after the first '/' in the date (DD/YYYY). --&gt;</span><br style="font-style: italic;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:variable name="TempInput"&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:value-of select='substring-after(/DateList/SingleDate/DateField,"/")'/&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xsl:variable&gt;</span><br style="font-weight: bold;"><span style="font-style: italic;">&lt;!--I set a variable Month to hold the month, generated by picking up everything before the first '/' in the date (MM). --&gt;</span><br style="font-style: italic;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:variable name="Month"&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:value-of select='substring-before(/imp1:DateList/imp1:SingleDate/imp1:DateField, "/")'/&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xsl:variable&gt;</span><br style="font-weight: bold;"><span style="font-style: italic;">&lt;!--I define a variable Day to hold the day portion which I get by picking up everything before the '/' in my Temp variable (DD). --&gt;</span><br style="font-style: italic;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:variable name="Day"&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:value-of select='substring-before($TempInput, "/")'/&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xsl:variable&gt;</span><br style="font-weight: bold;"><span style="font-style: italic;">&lt;!--I then pick up everything after the '/' in Temp variable (YYYY) and put it in a Year variable. --&gt;</span><br style="font-style: italic;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:variable name="Year"&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:value-of select='substring-after($TempInput, "/")'/&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xsl:variable&gt;</span><br style="font-weight: bold;"><span style="font-style: italic;">&lt;!--Finally I construct an XML dateTime format by concating the Year, Month and Day variables in the correct XML format. --&gt;</span><br style="font-style: italic;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;xsl:value-of select='concat($Year,"-",$Month,"-",$Day,"T00:00:00")'/&gt;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/top:dateitem&gt;</span><br style="font-weight: bold;">Obviously the parsing could be made to handle time formats and timezones as well.<br>Hoping that this helps someone struggling with parsing text strings into dates.<br><br>I have created a simple ESB project that takes data from a file in US date format and loads it into two columns in a database table, one formatted as a string the other as a SQL Date.&nbsp; When using the Database adapter the SQL Date format gets converted to an XML dateTime.&nbsp; The project is available for <a href="http://blogs.oracle.com/reynolds/gems/ParseDate.zip">download here</a>.<br>]]>
      
   </content>
</entry>
<entry>
   <title>BEA Completes</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/04/bea_completes.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4149</id>
   
   <published>2008-04-29T22:25:35Z</published>
   <updated>2008-07-01T22:29:58Z</updated>
   
   <summary><![CDATA[Today the EU gave approval for the Oracle acquisition of BEA and so completed the acquisition.Now that the bean counters have had their fun it is the engineers turn.&nbsp; Although individual products will continue to be supported it will be...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="fmw" label="FMW" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fusionmiddleware" label="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<p>Today the <a href="http://www.oracle.com/corporate/press/2008_apr/bea-closes-rls.html">EU gave approval</a> for the Oracle acquisition of BEA and so completed the acquisition.<br>Now that the bean counters have had their fun it is the engineers turn.&nbsp; Although individual products will continue to be supported it will be exciting to see a convergent road map for Fusion Middleware, WebLogic and AquaLogic.&nbsp; Both companies invested heavily in standards based computing and so there are lots of opportunities for convergence and synergies between the product stacks.<br>The acquisition of BEA also gives Oracle access to a whole new set of contacts within their customer base.&nbsp; Although Oracle and BEA have a large overlap in their customer base they tend to talk to very different parts of the business.&nbsp; The combination of both companies will open up new opportunities for existing Oracle product lines as well as for the newly acquired BEA product lines.<br>The next few months will be very interesting times.<br></p>]]>
      
   </content>
</entry>
<entry>
   <title>Finding the End(point)</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/04/finding_the_endpoint.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4150</id>
   
   <published>2008-04-29T01:42:17Z</published>
   <updated>2008-07-01T22:31:27Z</updated>
   
   <summary><![CDATA[Finding the End(point)or The Difference Between Deployed and Undeployed BPEL WSDLsA colleague just complained to me about his inability to create an ADF business object from a BPEL process.&nbsp; He explained that when he pointed the JDeveloper wizard at the...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="SOA Suite" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="bpel" label="BPEL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fmw" label="FMW" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fusionmiddleware" label="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="soa" label="SOA" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="soasuite" label="SOA Suite" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h1>Finding the End(point)</h1><h2>or The Difference Between Deployed and Undeployed BPEL WSDLs</h2>A colleague just complained to me about his inability to create an ADF business object from a BPEL process.&nbsp; He explained that when he pointed the JDeveloper wizard at the BPEL WSDL is gave an unknown endpoint error.&nbsp; When I asked if he had pointed it at the file from the JDeveloper BPEL project rather than the WSDL file on the BPEL server he confirmed that this was indeed the case.&nbsp; Pointing at the WSDL file on the server solved the problem.&nbsp; Why is quite instructive.<br><h2>A Tale of Two WSDLs</h2>When you build a new BPEL process, you generally end up with a new WSDL file that defines the inputs and outputs of the BPEL process.&nbsp; What this WSDL file is lacking however is any endpoint information.&nbsp; Endpoint information details the logical network name and port number of the server on which the process is running, as well as the path to the process.&nbsp; This data cannot be filled in until the process is deployed to a specific domain (part of the path of the request) and server (hostname and port number part of the request).&nbsp; Hence when retrieving the WSDL from the JDeveloper file, you have no location where the process is available and it is this lack of data that the ADF wizard complains about.&nbsp; When you retrieve the WSDL from the BPEL server then it includes the location information of the process and hence the ADF wizard is happier.<br>Obvious when you think about it, but it is a problem that plagued many people in the past so I thought I would share it with you.<br>]]>
      
   </content>
</entry>
<entry>
   <title>Patterns and Methods</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/04/patterns_and_methods.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4151</id>
   
   <published>2008-04-25T05:19:27Z</published>
   <updated>2008-07-01T22:32:51Z</updated>
   
   <summary><![CDATA[Patterns &amp; MethodsThought I would share some thoughts on Oracle SOA Methodologies and SOA patterns.&nbsp; These are by no means complete, I just wanted to put down some ways in which SOA Suite can encourage good practise.Methodologies The Oracle SOA...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="SOA" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="bpasuite" label="BPA Suite" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fmw" label="FMW" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fusionmiddleware" label="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="soa" label="SOA" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="soasuite" label="SOA Suite" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h2>Patterns &amp; Methods</h2>Thought I would share some thoughts on Oracle SOA Methodologies and SOA patterns.&nbsp; These are by no means complete, I just wanted to put down some ways in which SOA Suite can encourage good practise.<br><br><h2>Methodologies</h2>

<p>The Oracle SOA Success Methodology is a methodology with a small 'm'.&nbsp;<br />
It is best viewed as a set of tools of techniques that can be applied<br />
within the context of a more proscriptive methodology.&nbsp; That said it<br />
works best with iterative methodologies.<br></p>

<p>The SOA Success Methodology is currently used with a restricted number<br />
of Oracle customers prior to a full release.<br><br />
Within the context of the SOA Success methodology is extensive<br />
modelling of the business in terms of services.&nbsp; Oracle BPA Suite can<br />
be used to drive this iterative modelling process.<br><br />
BPA encourages a focus on the abstract modelling side of the SOA<br />
success methodology.&nbsp; As the model becomes more reified then composite<br />
services and processes may be made available to JDeveloper through a<br />
shared repository.<br><br />
Oracle is currently using BPA Suite to perform high level modelling in Fusion Applications development.<br><br />
BPA Suite supports roundtripping to allow regeneration of processes<br />
without loss of reifications applied to earlier versions, encouraging<br />
an iterative cycle between business analyst and process developers.<br><br />
<h1>SOA Patterns</h1><br />
Best source for SOA patterns in the Oracle space specifically is the <a href="http://www.oracle.com/technology/pub/articles/bpel_cookbook/index.html">BPEL cookbook</a><br />
which covers a lot of common patterns and techniques.&nbsp; Both the latest<br />
release of Oracle SOA Suite 10g, and 11g currently in beta, encourages<br />
these best practises in a number of ways, including but not limited to<br />
the following.<br><br />
<ul><li>Rules abstraction for</li><ul><li>True Business Rules - tight integration of rules and BPEL<br />
encourage business process developers to abstract business logic into<br />
the rules engine - this is also available in 10g<br><br />
    </li><li>Routing Rules - tight integration of rules and Mediator encourage developers to abstract routing decisions into the rules engine</li></ul><li>Service Abstraction<br><br />
  </li><ul><li>Encourages service level location abstraction by making it easy<br />
to hide physical endpoint of service - in 11g all BPEL processes are<br />
automatically packaged up in the same SCA assembly used to describe<br />
service deployments</li><li>Encourages service level interface abstraction by encouraging<br />
use of mediator to transform between canonical and physical<br />
implementation formats</li></ul><li>Process Abstraction</li><ul><li>Definition of processes allows for lower level processes to be treated as services</li><li>Capturing of process flows in code allows for simulation and modelling based on real world data</li></ul><ul><li>Human workflow captures common best practise human interactions into re-usable templates</li></ul><li>Process Migration</li><ul><li>Champion/challenger processes - two versions of same process<br />
can run in parallel and be compared to see which yields best results<br />
based on concurrent versioning capabilities of BPEL process manager.</li><li>Managed process migration - ability to run multiple versions of<br />
same process allows controlled introduction of new process versions<br />
whilst existing instance continue to execute.<br><br />
    </li></ul><li>Service Discovery</li><ul><li>Service promotion - use of a registry allows services to be<br />
promoted from dev to test to production in a managed way, encouraging<br />
best practise.</li><li>Service catalogue - use of UDDI allows such a catalogue to be<br />
maintained to encourage re-use by simplifying service discovery process<br><br />
    </li></ul></ul><br />
There is lots more but this was a quick brain dump.&nbsp; Let me know which important ones I have missed.<br></p>]]>
      
   </content>
</entry>
<entry>
   <title>Of Laundries and Lego</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/04/of_laundries_and_lego.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4152</id>
   
   <published>2008-04-11T01:05:36Z</published>
   <updated>2008-07-01T22:34:49Z</updated>
   
   <summary><![CDATA[The Laundry Model for SOAA common analogy for SOA is to describe it as lego blocks.&nbsp; At one level that works reasonably well, but the same analogy holds for object orientation or structured programming, so there must be something more.&nbsp;...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="SOA" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="soa" label="SOA" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h1>The Laundry Model for SOA</h1>A common analogy for SOA is to describe it as lego blocks.&nbsp; At one level that works reasonably well, but the same analogy holds for object orientation or structured programming, so there must be something more.&nbsp; The <a href="http://www.cbdiforum.com/cbdi_blog/?filter=full&amp;id=45&amp;display=EXPLAINING%20SOA%20TO%20THE%20BUSINESS%20AUDIENCE">CBDI site suggested the analogy of laundry</a>, and I have to confess I really like this model and have used it with several customers as well as internal people here at Oracle.&nbsp; Let me expand on the laundry model.<br><h2>SOA is about Services</h2>It might seem obvious but service orientation is about changing your thinking (orienting yourself) to think about IT systems as a collection of well defined collaborating components (services).&nbsp; A service has some sort of contract implying that the consumer of the service will provide X and in return will get Y.&nbsp; A laundry is a great example of this.&nbsp; A laundry defines an interface, I prefer to think of it as a basket, that says you give me a basket of dirty laundry and some money and I will give you a basket of clean laundry.<br><h2>The Service Interface</h2><img src="http://blog.spafinder.com/uploaded_images/pic_laundry_basket-729176.gif" align="right">The basket interface, defines that laundry is passed in a basket or a bag, and has various options (lets call them parameters) that allow the client to specify if they want stain removal on particular items, or if they want their laundry starched, or repaired or any of a number of different options.&nbsp; Note that these parameters specify what is to be delivered, not how it is to be done.&nbsp; In SOA we may use WSDL and XSDs to define the interfaces.<br><h2>Composite Services</h2>Our laundry service provider may decide to sub-contract part of the work to other companies, for example sending velvet clothing to a specialist velvet cleaning service that employs gnomes to pick out the dirt from the fabric.&nbsp; This use of other services makes our laundry a composite service, because it is built out of other services.&nbsp; The client of the laundry service is unable to tell that the service provider uses other services, hence there is no difference between composite services and atomic services.&nbsp; Often BPEL will be used to create composite services from existing services.<br><h2>Virtualising the Service Interface</h2>We may want to change our laundry provider, and as long as they provide the same service we don't really care who does it.&nbsp; We may change the provider based on cost, or service level.&nbsp; In any case we don't want to have to change the way we work with the laundry service just because it is a different provider.&nbsp; Many companies provide their employees with a laundry drop off service.&nbsp; The employee (client of the service) does not care who actually provides the service, he just drops off his dirty washing at the drop-off point and picks up the clean washing later.&nbsp; This virtualisation of the location of the service makes it easy for the service provider to be swapped out without changing the clients using the service.<br>In the SOA world we may use an ESB to virtualise the endpoint by providing a fixed address for the service.&nbsp; In addition to providing a fixed address we may also compensate for slight differences in the interface by using a mediator to map between the format the client wants to use and the format the new laundry service uses.<br><h2>Personalising the Service</h2>If we are a regular customer then the laundry may decide to offer us better rates or some other additional service.&nbsp; This type of customisation may need to be accessed from several different places, for example the laundry may automatically iron shirts for premium customers, this impacts both the process of processing the laundry (the process flow) and also the billing engine, which should not charge for certain services based on the value of the customer.&nbsp; Within a service oriented architecture a rules service will enable us to centralise common business rules, such as the free ironing service.&nbsp; Centralising business rules in a rules service allows them to be applied consistently across an organisation, and managed in a single location, making changing them much easier.&nbsp; In the SOA world a rules engine can provide this.<br><h2>Finding a Laundry</h2>Where to find a good laundry.&nbsp; One option is to look in yellow pages for a laundry convenient to yourself.&nbsp; The equivalent in the SOA world is to look it up in a service registry.<br><h2>Protecting Your Smalls</h2>An obvious concern is that you don't want your personal clothing stolen on the way to the laundry or tampered with in any way.&nbsp; You expect the transport mechanisms and the procedures at the laundry to be such that your privacy will be protected and your smalls kept private.&nbsp; You don't view this as part of the service interface but as a more fundamental attribute of the service.<br>In the SOA world we can use declarative security to confirm who is sending the message, and also to encrypt all or part of the message to prevent tampering with it.&nbsp; Within the Oracle stack this functionality can be provided by the Web Services Manager.<br><h2>A Clean Solution</h2>I hope the suggestions above show why I like the laundry model and why I feel it relates better to SOA than does the lego model.&nbsp; If you have other suggestions for extending the model please let me know.&nbsp; Similarly if you have better models then let me know as well.<br>In the meantime may your whites stay clean and starched.<br>]]>
      
   </content>
</entry>
<entry>
   <title>Pairing Off in XSLT</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/04/pairing_off_in_xslt.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4153</id>
   
   <published>2008-04-08T15:38:52Z</published>
   <updated>2008-07-01T22:35:56Z</updated>
   
   <summary><![CDATA[Pairing Off in XSLTMy friend Newton was just fighting to transform some XML that was structured in a awkward way.&nbsp; The machine generated XML he was working with basically paired off successive elements, for example to provide a credential prompt...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="Miscellaneous" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="xml" label="XML" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="xslt" label="XSLT" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h1>Pairing Off in XSLT</h1>My friend Newton was just fighting to transform some XML that was structured in a awkward way.&nbsp; The machine generated XML he was working with basically paired off successive elements, for example to provide a credential prompt and then the following element contained the credential itself.&nbsp; It took a bit of fiddling to get the right XPath expression to perform the transformation.&nbsp; I thought it would be illuminating to share it with you and hopefully someone will find a better solution than the one we came up with.<br><h2>The Source</h2>The source XML looked like this<br><div style="margin-left: 40px;">&lt;?xml version="1.0" encoding="UTF-8" ?&gt;<br>&lt;exampleElement&gt;<br><br>&nbsp;&nbsp;&nbsp; &lt;AttributeElement&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;DisplayElement&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;SelectElement attribute1="A"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/DisplayElement&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/AttributeElement&gt;<br><br>&nbsp;&nbsp;&nbsp; &lt;AttributeElement&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;DisplayElement&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;PasswordElement attribute1="1"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/DisplayElement&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/AttributeElement&gt;<br>...<br>&nbsp;&nbsp;&nbsp; &lt;AttributeElement&gt;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;DisplayElement&gt;<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp;&nbsp; &lt;SelectElement attribute1="E"/&gt;<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; &lt;/DisplayElement&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/AttributeElement&gt;<br><br>&nbsp;&nbsp;&nbsp; &lt;AttributeElement&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;DisplayElement&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;PasswordElement attribute1="5"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/DisplayElement&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/AttributeElement&gt;<br><br>&lt;/exampleElement&gt;<br></div>Note the pairing of the Attribute elements.<br><h2>The Target</h2>The target XML looked like this<br><div style="margin-left: 40px;">&lt;?xml version = '1.0' encoding = 'UTF-8'?&gt;<br>&lt;exampleElement&gt;<br><br>&nbsp;&nbsp; &nbsp; &lt;Attribute&gt;<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &lt;Select attribute1="A"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Password attribute1="1"/&gt;<br>&nbsp; &nbsp;&nbsp; &lt;/Attribute&gt;<br>...<br>&nbsp; &nbsp;&nbsp; &lt;Attribute&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;Select attribute1="E"/&gt;<br>&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &lt;Password attribute1="5"/&gt;<br>&nbsp;&nbsp; &nbsp; &lt;/Attribute&gt;<br>&lt;/exampleElement&gt;<br></div><h2>The Problem</h2>The challenge was after identifying a path with a SelectElement element how to select the following path that had a PasswordElement element.<br><h2>The Answer is Axis</h2>The trouble with XSLT is that I don't do enough of it to remember all the tools available.&nbsp; In this case it was very simple once I had remembered how axis work.&nbsp; Here is my solution<br><div style="margin-left: 40px;">&lt;?xml version="1.0" encoding="UTF-8"?&gt;<br>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;<br>&nbsp;&nbsp;&nbsp; &lt;xsl:template match="/"&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;exampleElement&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;xsl:for-each select="/exampleElement/AttributeElement/DisplayElement/SelectElement"&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Attribute&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Select&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;xsl:attribute name="attribute1"&gt;&lt;xsl:value-of select="@attribute1"/&gt;&lt;/xsl:attribute&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Select&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;Password&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;xsl:attribute name="attribute1"&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;xsl:value-of select="following::AttributeElement[1]/DisplayElement/PasswordElement/@attribute1"/&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/xsl:attribute&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Password&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/Attribute&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/xsl:for-each&gt;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;/exampleElement&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/xsl:template&gt;<br>&lt;/xsl:stylesheet&gt;<br></div>This solution iterates over all the SelectElement elements and then for each of those elements it picks out the following PasswordElement in the document.&nbsp; It does this by using the XPath expression "following::AttributeElement[1]/DisplayElement/PasswordElement/@attribute1".<br>The "following::" axis selects all nodes in the document that come after the given SelectElement element.&nbsp; This flattens the hierarchy enabling us to choose the next AttributeElement element by selecting the AtrributeElement element with index 1 (AttributeElement[1]).&nbsp; We can then traverse that part of the XML using the normal child axis.&nbsp; Simple when its done but when you rarely use axis other than the child axis it takes a while to remember how they work.<br><h2>Reference</h2>I find the two O'Reilly books on XSLT to be very helpful when struggling with XPath and XSLT.&nbsp; These are the <a href="http://www.oreilly.com/catalog/xslt/">Doug Tidwell XSLT book</a> and the <a href="http://www.oreilly.com/catalog/xsltckbk/">Sal Mangano XSLT Cookbook</a>.<br><br>I hope this saves sombody some time.<br>]]>
      
   </content>
</entry>
<entry>
   <title>Stringing Together XML</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/03/stringing_together_xml.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4154</id>
   
   <published>2008-03-07T18:16:48Z</published>
   <updated>2008-07-01T22:37:40Z</updated>
   
   <summary><![CDATA[Stringing Together XMLSomeone just asked how to convert a string into XML.&nbsp; A common use case is to retrieve XML stored as a string in the database.&nbsp; Although you could argue that it would be better to store XML using...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="SOA Suite" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="bpel" label="BPEL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fmw" label="FMW" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fusionmiddleware" label="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="soasuite" label="SOA Suite" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="xml" label="XML" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="xslt" label="XSLT" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h1>Stringing Together XML</h1>Someone just asked how to convert a string into XML.&nbsp; A common use case is to retrieve XML stored as a string in the database.&nbsp; Although you could argue that it would be better to store XML using the XML facilities of the Oracle database the fact is we still see lots of XML stored as VarChar2 or CLobs.&nbsp; So how can we read these into BPEL?&nbsp; Well in addition to explaining this I thought it was also a good excuse to explain the use of the append rule within an assign and also a use for the anyType.<br><h2>Reading XML</h2>Fortunately the developers foresaw the problem of converting strings to XML and have provided a handy function ora:parseEscapedXML which takes a string as a parameter and returns an XML document.&nbsp; The string can be either a full XML document or just a document fragment.&nbsp; Similarly it can have an explicit namespace or no namespace.<br>I have uploaded a <a href="http://blogs.oracle.com/reynolds/gems/DocToXML.zip">simple BPEL process</a> that takes an XML string as input and returns the DOM representation of that string.<br><h2>Using an anyType</h2>For the input I take a string type but for the output I have used an anyType.&nbsp; This allows me to legitimatly assign it any value.&nbsp; Note that although anyType is not supported by the graphical XPath builder in the XPath wizard it is supported by the editor, which will drill you down to the anyType.<br><h2>Using Append instead of Copy</h2>The other thing I have done in the assign is to use an append rule to add the parsed XML underneath the base output element.&nbsp; This allows us to see the entire result.&nbsp; If I had used a copy rule then the top level element of the parsed XML would have been thrown away and only its contents copied.&nbsp; Using the append rule causes the entire subtree selected by the XPath expression to be placed underneath the target element.&nbsp; Because the target is an anyType I don't have to worry about the XML conforming to any particular schema, I can dump any well formed XML in there.<br><h2>Testing it Out</h2>You may want to try it on the following input data to see how it works.&nbsp; Note that there is no difference in the way documents and document fragments are handled.&nbsp; the only requirement is that the XML be well formed.<br><h4>Fragment Without a namespace</h4>&lt;NAME&gt;&lt;FIRST&gt;Antony&lt;/FIRST&gt;&lt;LAST&gt;Reynolds&lt;/LAST&gt;&lt;/NAME&gt;<br><h4>Fragment With a namespace</h4>&lt;NAME xmlns="http://blog.oracle.com/reynolds"&gt;&lt;FIRST&gt;Antony&lt;/FIRST&gt;&lt;LAST&gt;Reynolds&lt;/LAST&gt;&lt;/NAME&gt;<br><h4>Document Without a namespace</h4>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;NAME&gt;&lt;FIRST&gt;Antony&lt;/FIRST&gt;&lt;LAST&gt;Reynolds&lt;/LAST&gt;&lt;/NAME&gt;<br><h4>Document With a namespace</h4>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;NAME xmlns="http://blog.oracle.com/reynolds"&gt;&lt;FIRST&gt;Antony&lt;/FIRST&gt;&lt;LAST&gt;Reynolds&lt;/LAST&gt;&lt;/NAME&gt;<br><br>]]>
      
   </content>
</entry>
<entry>
   <title>Threading It All Together</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/02/threading_it_all_together.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4155</id>
   
   <published>2008-02-20T17:26:17Z</published>
   <updated>2008-07-01T22:38:47Z</updated>
   
   <summary><![CDATA[Threading It All Togetheror Thread Usage by BPEL ProcessesBased on comments I have received and questions I have been asked it seems that when it comes to thread usage by BPEL processes there are lot of confused people around.&nbsp; So...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="SOA Suite" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="bpel" label="BPEL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fmw" label="FMW" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fusionmiddleware" label="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="soasuite" label="SOA Suite" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="threading" label="Threading" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h1>Threading It All Together</h1><h2>or Thread Usage by BPEL Processes</h2>Based on comments I have received and questions I have been asked it seems that when it comes to thread usage by BPEL processes there are lot of confused people around.&nbsp; So I thought I would unravel a few mysteries about threading in BPEL.&nbsp; Understanding the threading model is important for BPEL because the thread model can affect scalability of processes and the BPEL engine itself.<br>How threads are allocated depends on the interaction pattern of the link activating the receive activity.<br><h2>Interaction Patterns</h2>The interaction pattern can be thought of as how the BPEL process is called.&nbsp; There are two types of interaction pattern, one-way and two-way or request-response as it is sometimes known.<h3>One-Way Interaction</h3>A one-way interaction pattern means that the process is invoked and is then left to run, possibly returning the results via another interaction, possibly not.&nbsp; We often think of this as asynchronous because the caller does not wait for the process to complete.&nbsp; Don't confuse the actual interaction pattern with the way the process works.&nbsp; For example many processes have a request reply process model that is implemented through two one-way interactions.&nbsp; The client calls the process and continues working.&nbsp; The process does its job and then calls the client to pass back the results.&nbsp; The process has a request-reply model but it works through two one-way interactions.&nbsp; A one-way interaction pattern is characterised by a process that has a receive activity but no corresponding reply activity.&nbsp; A request-reply process using one-way interaction patterns would be characterized by a receive activity with no corresponding reply but it would have a corresponding invoke.<br><h3>Two-Way or Request-Response Interaction</h3>A request-response interaction pattern means that the process is invoked and the caller then waits for the process to return a result before the caller continues its own processing.&nbsp; We often think of this as synchronous because the caller appears to get the result immediately.&nbsp; A request-response interaction pattern is characterised by a process that has a receive activity with a corresponding reply activity.&nbsp;&nbsp; Note that it is possible to have a process that combines an initial request-response interaction to return an initial result, such as a correlation token, with a later one-way interaction that returns the final result to the caller.<br>More information on what this looks like is available in the <a href="http://download.oracle.com/docs/cd/B31017_01/core.1013/b28942/tuning_bpel.htm#BCGBFIFC">BPEL docs</a>.<br><h2>Instrumentation</h2>To investigate thread usage in BPEL processes I wrote a small amount of Java code that is embedded into the process inside an exec activity.&nbsp; The code is shown below and stores the currently executing thread group and thread name into a variable called "CurrentThread".<br><span style="font-family: Courier;">&nbsp; &lt;bpelx:exec name="Java_Embedding_1" language="java" version="1.3"&gt;</span><br style="font-family: Courier;"><span style="font-family: Courier;">&nbsp;&nbsp;&nbsp; &lt;![CDATA[</span><span style="font-family: Courier;"> </span><br style="font-family: Courier;"><span style="font-family: Courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Thread t = Thread.currentThread(); </span><br style="font-family: Courier;"><span style="font-family: Courier;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setVariableData("CurrentThread",<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t.getThreadGroup().getName()+":"+t.getName());<br>&nbsp;&nbsp;&nbsp; ]]&gt;</span><br style="font-family: Courier;"><span style="font-family: Courier;">&nbsp; &lt;/bpelx:exec&gt;</span><br style="font-family: Courier;">This variable is then surfaced in the output of the process.<br><h2>Simple Request-Response Thread Usage</h2>My first test was to run a simple request-reply interaction pattern in a process.&nbsp; In this case the&nbsp; thread is taken from the inbound HTTP listener thread pool and a single thread is used to receive the request and process it.&nbsp; The thread group is "HTTPThreadGroup" and the actual thread I got was "AJPRequestHandler-RMICallHandler-56".&nbsp; The last digits vary.&nbsp; So in this case the BPEL server receives the request on the same thread that is used for all processing within the process.&nbsp; This process is available as <a href="http://blogs.oracle.com/reynolds/gems/ThreadExplorer1.zip">ThreadExplorer1.zip</a>.<br><h2>Simple One-Way Thread Usage</h2>My next test was to run a simple one-way interaction pattern, with another one-way onteraction to return the result.&nbsp; in this case the message is received on one thread and then passed onto a pool of worker threads to execute the BPEL process.&nbsp; The thread group is "main" and the actual thread I got was "WorkExecutorWorkerThread-120".&nbsp; The last digits vary.&nbsp; So in this case the BPEL server received the request and then queued it for subsequent execution.&nbsp; This allows for greater scalability by limiting thread usage within the BPEL server.&nbsp; This process is available as <a href="http://blogs.oracle.com/reynolds/gems/ThreadExplorer2.zip">ThreadExplorer2.zip</a>.<br><h2>Combination of Request-Reply and One-Way Thread Usage</h2>The obvious next question is what happens when I have both interaction patterns in the same process.&nbsp; Well that is what I did in my next test.&nbsp; I created a process that returns an immediate result (request-response interaction) and then later posts a further response as a one-way interaction.&nbsp; In this case the message is received on the listener thread and processed on that thread up to the reply.&nbsp; At that point the remainder of the work is passed off to a worker thread.&nbsp; This is exactly as one would expect from combining the two previous usages.&nbsp; This process is available as <a href="http://blogs.oracle.com/reynolds/gems/ThreadExplorer3.zip">ThreadExplorer3.zip</a>.<br><h2>Effect of Flow on Threading<br></h2>The next question is what happens in a flow activity.&nbsp; Surely this will cause multiple threads to be spawned.&nbsp; Well by default the answer is no.&nbsp; ThreadExplorer4 process uses a request-reply interaction and within the processing it has a 3-way flow statement.&nbsp; All statements in the flow are executed in the same thread.&nbsp; This is exactly the same as if we had used a request-response interaction with a while activity instead of a flow.&nbsp; This may be counter-intuitive but the reasoning behind this is as follows:<br><ul><li>For scalability we want to limit thread usage</li><li>A flow is really intended to support waiting for multiple events such as responses from services with two one-way interactions and so we don't need to execute them in parallel, pseudo-parallel will do.</li><li>If one branch of a flow is waiting for an event the same thread can start executing the next branch of the flow, avoiding the need for a JVM&nbsp; thread context switch.</li></ul>So there is little real need for a truly parallel flow statement.&nbsp; This process is available as <a href="http://blogs.oracle.com/reynolds/gems/ThreadExplorer4.zip">ThreadExplorer4.zip</a>.<br><h2>More Detail of Effect on Flow on Threading</h2>If we put a wait or receive into our flows then we find that the thread itself is not suspended, but is returned to the thread pool.&nbsp; If there are other legs of the flow capable of execution then the thread will be used to execute those before being returned to the worker pool.&nbsp; This same behaviour applies when a leg of a flow wakes up due to an event such as a timer (wait activity) expiring or a message arrive (receive activity).&nbsp; This is all shown in ThreadExplorer5 process which has a 3 way flow that uses the initial worker thread to put all three legs into a wait activity and then uses a different worker thread when they wake up to carry on their processing.&nbsp; This process is available as <a href="http://blogs.oracle.com/reynolds/gems/ThreadExplorer5.zip">ThreadExplorer5.zip</a>.<br><h2>Creating True Parallelism in an Flow</h2>One common use case for flow is to make multiple request-reply calls in parallel to reduce their latency.&nbsp; But as we saw in the previous section this doesn't work out of the box so how can it be achieved?&nbsp; If we add a property "nonBlockingInvoke" to the partner link we are calling and set it to "true" then BPEL will use a seperate thread to make the call.&nbsp; This is shown in ThreadExplorer6.&nbsp; Note that when you run this the initial request is being processed on the thread that received the message, a listener thread.&nbsp; When we do the invokes on a partner link with nonBlockingInvoke property set to true we see that those invokes are processed in a seperate thread.&nbsp; Because we are calling another BPEL process the server does some optimisation and uses the same thread for all three invokes.&nbsp; If the partner link were on a different server then 3 threads would have been used.&nbsp; Note that these threads are all worker threads, not the thread from the listener.&nbsp; Finally when the three flow legs join together a new worker thread is used to carry on processing.&nbsp; This process is available as <a href="http://blogs.oracle.com/reynolds/gems/ThreadExplorer6.zip">ThreadExplorer6.zip</a>.<br>You can read more about the <a href="http://download.oracle.com/docs/cd/B31017_01/core.1013/b28942/tuning_bpel.htm#BCGEJICF">nonBlockingInvoke in the BPEL documentation</a>.<br><h2>More on Thread Processing in BPEL</h2>You can read more about <a href="http://download.oracle.com/docs/cd/B31017_01/core.1013/b28942/tuning_bpel.htm#BCGDEBCI">thread processing in BPEL in the documentation</a> which gives more reasoning for the way the cases above behave as they do.&nbsp; Hope this was useful to you.<br>]]>
      
   </content>
</entry>
<entry>
   <title>Aggressive Cleanup</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/01/aggressive_cleanup.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4156</id>
   
   <published>2008-01-21T18:20:07Z</published>
   <updated>2008-07-01T22:41:02Z</updated>
   
   <summary><![CDATA[A Problem of Aggressive CleanupJust been working on an internal proof of concept and came across some very irritating behaviour in BPEL Designer in JDeveloper 10.1.3.3.&nbsp; I deleted a Partner Link and accepted the suggestion of JDeveloper BPEL Designer to...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="SOA Suite" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="adapters" label="Adapters" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="bpel" label="BPEL" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="databaseadapter" label="Database Adapter" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fmw" label="FMW" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fusionmiddleware" label="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="soasuite" label="SOA Suite" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h1>A Problem of Aggressive Cleanup</h1>Just been working on an internal proof of concept and came across some very irritating behaviour in BPEL Designer in JDeveloper 10.1.3.3.&nbsp; I deleted a Partner Link and accepted the suggestion of JDeveloper BPEL Designer to delete the associated WSDL file.&nbsp; Unfortunately it turns out that this deletes not only the partner link specific WSDL file but also a shared WSDL file (DBAdapterOutboundHeader.wsdl) that is used by all DB Adapter Partner Links in the project.&nbsp; Net result is that this breaks all the remaining DB Adapter based Partner Links in the project.&nbsp; Fortunately there is a simple solution.&nbsp; Copy the DBAdapterOutboundHeader.wsdl from any other project with a DB Adapter in it into the project/bpel directory and your problems will be solved.<br>For a view of some of the problems this may cause have a look at <a href="http://soastuff.wordpress.com/2007/05/22/orabpel-10903-error-after-deleting-a-partner-link/">this blog</a>.<br><br>]]>
      
   </content>
</entry>
<entry>
   <title>BEA Joins the Team</title>
   <link rel="alternate" type="text/html" href="http://blogs.oracle.com/reynolds/2008/01/bea_joins_the_team.html" />
   <id>tag:blogs.oracle.com,2008:/reynolds//87.4157</id>
   
   <published>2008-01-18T17:21:54Z</published>
   <updated>2008-07-01T22:43:21Z</updated>
   
   <summary><![CDATA[BEA Acquisition ThoughtsYou may not be surprised to me hear me say this but I am really excited by Oracles recent acquisition of BEA, expected to complete in October of this year.&nbsp; If you haven't read about it yet then...]]></summary>
   <author>
      <name>antony.reynolds</name>
      
   </author>
         <category term="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#category" />
   
   <category term="fmw" label="FMW" scheme="http://www.sixapart.com/ns/types#tag" />
   <category term="fusionmiddleware" label="Fusion Middleware" scheme="http://www.sixapart.com/ns/types#tag" />
   
   <content type="html" xml:lang="en" xml:base="http://blogs.oracle.com/reynolds/">
      <![CDATA[<h1>BEA Acquisition Thoughts</h1>You may not be surprised to me hear me say this but I am really excited by Oracles recent acquisition of BEA, expected to complete in October of this year.&nbsp; If you haven't read about it yet then here is the <a href="http://www.oracle.com//bea/index.html">official Oracle announcement</a> and <a href="http://www.oracle.com/corporate/press/2008_jan/bea.html">press release</a>.&nbsp; On Wednesday Larry and Alfred took to the phone to explain the move to analysts (<a href="http://seekingalpha.com/article/60410-oracle-acquisition-of-bea-systems-business-update-call-transcript?source=yahoo&amp;page=1">see transcript</a>).&nbsp; Already the pundits are giving their views which are generally positive.&nbsp; Below are a few views I found on the net.<br><ul><li><a href="http://seekingalpha.com/article/60626-oracle-needs-to-settle-on-a-growth-strategy-following-bea-acquisition">Oracle Needs to Settle on a Growth Strategy Following BEA Acquisition</a></li><li><a href="http://www.echannelline.com/usa/story.cfm?item=22838">What does Oracle's BEA acquisition mean to customers?</a></li><li><a href="http://searchsoa.techtarget.com/originalContent/0,289142,sid26_gci1294494,00.html">The SOA implications of Oracle's BEA purchase</a></li><li><a href="http://www.ovum.com/news/euronews.asp?id=6542">Buy buy BEA - hello Oracle!</a><br></li></ul>I think this is great news for a number of reasons.<br><ul><li>Firstly the combination of BEA and Oracle will really give IBM something to worry about in the middleware space, the combined company and product stack will show superiority over IBM in almost every area of middleware.</li><li>Secondly the combination will provide a Java middleware powerhouse that will increasingly carry the fight to .Net, particularly in the user experience area.</li><li>Thirdly it removes the chance of SAP buying BEA (I know they are chalk and cheese in philosophy and management styles but it was still a worry).<br></li><li>Synergies will be easy to find.&nbsp; Both BEA and Oracle have a strong standards focus.&nbsp; It took Thomas Kurian to get Oracle Middleware firmly onto a standards based view of the world, but it is now there.&nbsp; BEA has always had a strong standards based approach in its WebLogic range.&nbsp; Because of these standards based appproaches key pieces of Fusion Middleware already run on the WebLogic, providing customers with lots of ways to rapidly combine the best of both Oracle and BEA middleware.&nbsp; It will also enable the engineering teams to share a lot of functionality across what will probably become convergent platforms.</li><li>Fusion Middleware has a "hot-pluggable" approach that allows components to be mixed and matched.&nbsp; The acquistion of BEA will give a new impetus to making sure that "hot-pluggable" is easy and provides a mechanism</li><li>From a purely selfish view it will let Oracle focus on its two main midleware competitors - Microsoft and IBM.</li></ul>Of course we will have to wait for October 2008 for the deal to complete so we won't actually see any action on the ground until 2009, but then it will get interesting.<br><br><span style="font-weight: bold;">Disclaimer </span>- these are my own views and not those of Oracle Corporation.<br>]]>
      
   </content>
</entry>

</feed>
