« June 2008 | Main | November 2008 »

October 2008 Archives

October 14, 2008

SOA Wishlist

Here are a few items in my wishlist. I will be adding my interests to this list as and when I catch something interesting.

a) A native BAM active viewer for iPhone. [Not on Safari].
b) A Microsoft Outlook plugin for our workflow
c) REST Services for BPEL/Other Consoles.
d) MS Outlook integration for Worklist tasks.

October 20, 2008

Using Schematron within BPEL

I have developed a simple utility that validates an input document against a schematron file and returns a validation report that returns the status of validation, together with the list of assertions that failed.

The utlity is registered as an XPath function and can be invoked from within the XSL Mapper.

Here are the steps for using the utlity.

a) Download the jar file from http://blogs.oracle.com/rammenon/SchematronValidator.jar

b) Copy the file into $JDEV_HOME/jdev/lib/ext

c) Create a new file named “SchematronExtensionFunctions.xml” and  copy the following content within it.

<?xml version="1.0" encoding="UTF-8"?>
<extension-functions>
  <functions xmlns:sch="http://www.oracle.com/XSL/Transform/java/com.oracle.xsl.xpath.sch.SchematronValidator">

    <function name="sch:validateDocument" as="node-set">
       <param name="schFileName" as="string"/>
       <param name="inputDoc" as="node-set"/>
     </function> 
  </functions>
</extension-functions>.

Save the file onto the local file system.

d) Open JDev and navigate to Tools –> Preferences –> XSL Map.

e) Select the above file for the “User defined Extension Functions config file” and restart JDeveloper.

f) Create a new empty project/BPEL Project.

g) Add the following XSD into the project - http://blogs.oracle.com/rammenon/ValidationReport.xsd. This XSD will define the report of errors if any during the schematron validation.

h)    Also add the XSD for the document you wish to validate [if you havent added it yet]

i) Create a new XSL Map and choose the source as the input XSD in (h) and the target as the validationReport.xsd.

j) Choose “validateDocument” from the  “User defined Extension functions” palette page of the component palette and drag it into the center pane.

k) Edit the parameters of the xpath function – the first argument is the absolute URL to the “.sch” file. The second argument should be the root element of the source document.

   for instance, the generated XSLT for the mapping would look like’

<xsl:copy-of select="sch:validateDocument('file:///localhost:7777/validations/po-validations.sch',/tns:po)"/>

Note the “copy-of” instead of “value-of” in the above expresion. When you drag and drop nodes into the center pane, the mapper will generate “value-of” statements. Manually change it to “copy-of”.

l) Test the map [note that the graphical view of the mapper might complain stating that ""copy-of" is not supported. You can safely ignore this message, since this warning is only for limitations to graphical rendering of the construct.

October 22, 2008

Re-submit BPEL instances from BAM

Here is what I did for re-initiating BPEL instances from BAM.

a) While defining the BAM sensor action, passed in the conversation Id of the instance [obtained using the xpath function ora:getConversationId()]
b) Developed a Servlet that takes in a conversationId as a request parameter and initiates a new BPEL instance with the same input message.
c) Created a table with an Action button that invokes the Servlet [using Open URL action] and passes in the conversationId.. The table contains columns that contain key identifiers for the transaction. [e.g. POId etc]
d) At runtime, users select the rows in the table based on the identifiers and click on the action button - this will re-initiate the BPEL instance.

Here is a snippet of code that does the trick.

        IBPELDomainHandle domain = null;
        Locator locator = null;
        String convId = request.getParameter("convId");

        Properties p = new Properties();
        java.net.URL url = ClassLoader.getSystemResource("context.properties");
        p.load(url.openStream());

        locator = new Locator("default","weblogic",p);
        domain = locator.lookupDomain();
        WhereCondition wc = new WhereCondition("conv_id=?");
        wc.setString(1,convId);
        IInvokeMetaData[] invMetadataArr = locator.listInvokeMessages(wc);
        IInvokeMetaData invMetadata = invMetadataArr[0];
        String messageGuid = invMetadata.getMessageGUID();
        domain.recoverInvokeMessages(new String[]{messageGuid});

October 28, 2008

BPEL Correlation within FlowN

I was struggling a bit today while testing a simple process that does a flowN and does simple BPEL correlation..

Failed to evaluate correlation query.
Failed to evaluate the correlationAlias query "/client:FlowNCorrelationDemoEvent/client:id" on the element "oracle.xml.parser.v2.XMLElement@283a35b"
Please check your BPEL/WSDL source to make sure that property alias is defined correctly.

    at com.collaxa.cube.engine.delivery.CorrelationProperty.setMessagePart(CorrelationProperty.java:85)
    at com.collaxa.cube.engine.delivery.DeliveryHelper.createCorrelationSet(DeliveryHelper.java:140)
    at com.collaxa.cube.engine.delivery.SOAPProtocolHandler.calculateCorrelations(SOAPProtocolHandler.java:751)
    at com.collaxa.cube.engine.delivery.SOAPProtocolHandler.receiveCallback(SOAPProtocolHandler.java:167)
    at com.collaxa.cube.engine.delivery.DeliveryService.receiveCallback(DeliveryService.java:462)
    at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.receiveCallback(CubeDeliveryBean.java:108)
    at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean_yt19iq_ELOImpl.receiveCallback(CubeDeliveryBean_yt19iq_ELOImpl.java:307)
    at com.collaxa.cube.engine.delivery.DeliveryHandler.continuePostAnyType(DeliveryHandler.java:429)
    at com.collaxa.cube.engine.delivery.DeliveryHandler.continuePost(DeliveryHandler.java:380)
    at com.collaxa.cube.engine.delivery.DeliveryHandler.post(DeliveryHandler.java:93)
    at com.collaxa.cube.ejb.impl.DeliveryBean.post(DeliveryBean.java:203)
    at com.collaxa.cube.ejb.impl.DeliveryBean.post(DeliveryBean.java:158)
    at com.collaxa.cube.ejb.impl.DeliveryBean_uhics8_EOImpl.post(DeliveryBean_uhics8_EOImpl.java:279)

It seems that the issue was occuring when I was initiating the process that contains a midprocess receive that is based off an operation in the same portType that contains the initiating operation for the service, through the BPEL console.

<portType name="FlowNCorrelationDemo">
    <operation name="initiate">
        <input message="client:FlowNCorrelationDemoRequestMessage"/>
    </operation>
    <operation name="callback">
        <input message="client:FlowNCorrelationDemoEventMessage"/>
    </operation>
</portType>

Things worked just fine when I created another BPEL process and invoked this main BPEL process from the former.

You can find the set of BPEL processes, together with a readme file at http://blogs.oracle.com/rammenon/FlowNCorrelationDemo.zip.

You can find all the information about the services that I have used in the sample at the above URL.

1. Initiate the client service. The client service invokes the main service with the given payload.

initiate_client

2. Review the flow of main service. It should be waiting for the callbacks from within the flowN.

main_service_waiting_for_callback

3. Invoke the ReaderService [the service that calls back the main service] with one callback message.

reader_service_invoke

4. Review the flow of the main service. It should have received one callback.

 

main_service_recvd_one_callback

 

5. Submit the remaining messages from the ReaderService to complete the entire flow. The main process should complete execution following this.

 

main_service_recvd_all_callbacks

About October 2008

This page contains all entries posted to Ramkumar Menon's Blog in October 2008. They are listed from oldest to newest.

June 2008 is the previous archive.

November 2008 is the next archive.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type and Oracle