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)
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
Posted by Amar Misra | October 22, 2008 9:36 PM
Posted on October 22, 2008 21:36
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.
Posted by rashmi | November 5, 2008 7:15 AM
Posted on November 5, 2008 07:15