« Using Schematron within BPEL | Main | BPEL Correlation within FlowN »

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});

Comments (2)

Amar Misra:

Hi Ram,

Many thanks for your post on the customtasks.jar(Customizing any BPEL Project Artifact using customizeDocument) , this has helped us in resolving code issues, however I need to understand the following

Is this customtasks.jar an Open Source Code?

Does it have any IPR(Intellectual Properiety Rights) issues ?

Can this be submitted as a part of Code Delivery to customer ?

Can you please let me know any other link (preferably Oracle /SUN Link) from where this jar can be downloaded.

In case you need to discuss anything , please give me call my contact details are mentioned below.

Thanks and Regards
Amar
0091-9903396732

rashmi:

Hi Ram ,
Our client also has the similar requirement .
We have two asyncronous bpel processes call.
Bpel 1 Calls Bpel 2 (both are asyncronous process).
now while doing so BPel 2 fails.Now our smart Bpel 2 before termination calls Errorhandle bpel process to tell user about error through mail.
Now once they do action on the xml we want to resubmitt same message through Bpel 2 via code you have provided in Errorhandle bpel .

After seeing your code I realised that we can get Instance mesasge and then resubmitt bpel task once again.
But I guess your code is incomplete Can you assist me doing changes .

Than x,
Rashmi.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About This Entry

This page contains a single entry from the blog posted on October 22, 2008 4:21 PM.

The previous post in this blog was Using Schematron within BPEL.

The next post in this blog is BPEL Correlation within FlowN.

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

Powered by
Movable Type and Oracle