Out of the Box Search Capabilities
BPEL Console provides several out of the box features for searching the process instances using multiple search criteria. Following are the main search criteria that can be used within BPEL console
All the above are very powerful features for process administration.
Enterprise Integrations and Support
Enterprise integrations deal with business data and transactions. These integrations often have interactions between multiple layers. In case of a failed transaction at any layer, the support function personals can spend a great deal of time and energy on finding the issue and troubleshooting it. I wrote about this in one of my previous post "Service Oriented approach for ERP integration".
Now imagine a use case where thousands of messages are being processed every minute. Searching by some of the default criteria’s can result in multiple search results.
Lets take an example.
Custom Search Requirement Example
Lets assume that there is a BPEL process that processes orders in Oracle E-Business Suite. The order details are coming from an external application that is used by end users which in turn publishes to a JMS queue. The BPEL process picks up from the JMS queue and creates an Order in the EBS with the Order Number that comes from the message.
In the above example, if the end application does not receive an order confirmation, you can imagine there can be many reasons for that. One of them could be that the bpel process instance failed for some reason.
When it comes to tracking that order, the end application support will most likely call the support and mention that for this particular order (along with some sort of business key like the order number) there was no confirmation received.
In a production environment, there may be thousands of process instances. For our bpel support person to browse through the instances just by time can also take some time. But for him to be able to search the process instance by using a business key can prove to be extremely useful.
So the question from business user and administrator becomes
Can I search by Order Number?
The answer is YES.
Is there a simple way to do it?
Any one who has worked with application integration can relate to it and would agree with it. Now the question is “Is there a simple way to do it?”
The answer is YES.
Let’s Do It
Let's build one simple bpel process from scratch and find out how can we achieve this highly desirable functionality
Step 1
Right Click on your application and select “New Project” option
Select BPEL Process Project
Step 2
Name the process “SearchableUsingCustomKeyProcessStep 3
For simplicity we will proceed with the default option
Step 4
So now we have a skeleton asynchronous BPEL process
Step 5
Click on SearchableUsingCustomKeyProcess.xsd
Change the name of the input to orderNumber
Step 6
Drag and drop a Java Embedding activity from the Process Activities drop down on right hand side
Name it “JavaEmbeddingToSetProcessTitle”
Step 7
Double click Java Embedding you just added
Add the following code
Step 7
Deploy the process on server
Step 8
Initiate the process from BPEL console with “1001” as input to the orderNumber field
Notice the instance title is different than the process name. This is because of the setTitle statement in our Java Embedding.
Click on Audit Flow and then on the Java activity to make sure that the instance ran without any errors
Step 10
Let’s see if we can search by our custom field (order number) that we want to search for out of many bpel process intances in the console
Click on Instances
Now put the following into the Title field under Locate Instances and click “Go”
“OrderEntryBPELProcess - OrderNumber:1001”
Notice how we are able to search for our particular order number (1001).
You can search for other order numbers easily by just replacing the end of the string with the order number. For example searching for the following string within the title field will search for order number “2001”
“OrderEntryBPELProcess - OrderNumber:2001”
Summary
Requirements related to searching for a process instance in BPEL console by using a custom field could be addressed by the approach demonstrated in this post.
This example demonstrates that it can be done and it can be done easily.
Comments (8)
hi, is there a way we can search for instance titles using wild card search ? say, i want to list all the orders starting with 1.
It would be great if console supports searching using %.
Posted by satish uppada | February 6, 2009 11:26 AM
Posted on February 6, 2009 11:26
You can build it using the APIs. One option can be to use the flex fields in BPEL PM and have a custom search page.
Posted by Peeyush Tugnawat | February 6, 2009 2:01 PM
Posted on February 6, 2009 14:01
Can you do a wildcard search?
Posted by Charlie | February 9, 2009 12:57 AM
Posted on February 9, 2009 00:57
This post just takes advantage of the out of the box feature using a simple trick that lets you search by the process title.
You can always build more desirable search capabilities using the APIs. As I mentioned in my previous comment, one option can be to use the flex fields in BPEL PM and have a custom search page.
Posted by Peeyush Tugnawat | February 11, 2009 8:39 PM
Posted on February 11, 2009 20:39
Thanks! It's very useful.
How would it be, if i put these Java classes under ${ORACLE_HOME}/bpel/system/classes and invoke through WSIF binding? People are suggesting to use as a last resort. Correct me if i am wrong and also mention the pros/cons of using both ways in this situation.
Posted by Balaji Natarajan | February 20, 2009 11:07 AM
Posted on February 20, 2009 11:07
Please also tell us any references to building custom search using APIs.
Thanks
Balaji
Posted by Balaji Natarajan | February 20, 2009 11:09 AM
Posted on February 20, 2009 11:09
Good question.
I would suggest using bpelx:exec when you are only planning to use small segment of java code. When it gets more than few lines, consider using WSIF binding or wrapping it as a SOAP service. Re-usability can also be enhanced when used across multiple bpel processes.
Posted by Peeyush Tugnawat | February 20, 2009 12:30 PM
Posted on February 20, 2009 12:30
I can't remember any reference to a particular example or tutorial related to that . One good reference is the following section on bpel tutorial
http://download-west.oracle.com/docs/cd/B31017_01/integrate.1013/b28981/reports.htm
Also refer to the api documentation
Oracle BPEL Process Manager Client Java API Reference
http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28986/toc.htm
Oracle BPEL Process Manager Workflow Services API Reference
http://download.oracle.com/docs/cd/B31017_01/integrate.1013/b28985/toc.htm
Posted by Peeyush Tugnawat | February 20, 2009 1:09 PM
Posted on February 20, 2009 13:09