Archiving Audit Diagrams as Images in Oracle SOA Suite BPM Processes
2014-06-04 11:14
543 查看
Archiving Audit
Diagrams as Images in Oracle SOA Suite BPM Processes
Filed under: BPEL, BPM, Java, OracleService Bus, SOA — Tags: Audit
Trail Image, Oracle BPM 11g, Oracle
BPM 11g API, Oracle SOA Suite 11g, PAPI, Process
Audit Image in Oracle BPM 11g — Arun Pareek @ 4:10 pm
In my previous post I had described how we can create a custom Java Class to save
custom business indicators in a formatted PDF file. It might be useful in cases where businesses wants process data be presented in a meaningful way.
Another practical case that i had encountered in the past while designing business processes is to save the Audit diagram of the process once it is complete. The audit instance diagram can be viewed in the EM console by clicking on Flow Trace for any process
instance.
In the good all Oracle BPM 10g days (prior to Oracle SOA/BPM Suite 11g) we had a fully documented API’s for interacting with process instances. PAPI interfaces were available both as web service and java API’s to connect to a in-flight or completed instance
and retrieve all audit data from it.
Getting an audit image from a business process instance using PAPI was a cake walk. The below code sample shows its ease
However if we want to achieve something similar in Oracle SOA Suite 11g it is a lot more challenging.
Oracle BPM Suite 11g doesn’t have any published API’s that developers can refer. This makes it an even bigger nightmare.
The process instance data in Oracle SOA suite 11g is stored in the dehydration store in the SOA_INFRA schema. In all practical scenarios this store will be subjected to purging and maintenance. So many a people/project
might need to archive the flow trace of a process instance as an image. As we all know how significant is historical data for business process improvements and reengineering.
In this blog post I will show how the same functionality of getting an instance image from a process can be achieved using Oracle SOA Suite 11g and explain the code in steps.
Assuming we are using Oracle SOA Suite 11g PS3 that has a running domain and a BPM process deployed with a couple of running/completed instances.
Create a Generic Java project in JDeveloper say ArchiveInstanceImage. Create a Java class of the same name inside it. Right click on the project and add the following JAR’s to the project’s classpath.
Oracle.bpm.bpm-services.client.jar
Oracle.bpm.bpm-services.interface.jar
Oracle.bpm.client.jar
Bpm-infra.jar
Bpm-services.jar
Oracle.bpm.project.model.jar
Oracle.bpm.project.draw.jar
Oracle.bpm.project.catalog.jar
Wlfullclient.jar
Wsclient_extended.jar
Oracle.bpm.core.jar
Oracle.bpm.lib.jar
Oracle.bpm.papi.jar
Oracle.bpm.xml.jar
Oracle.bpm.diagram.draw.jar
Oracle-bpm.jar
Oracle.bpm.bpm-services.implementation.jar
Oracle.bpm.bpm-services.internal.jar
Oracle.bpm.bpmobject.jar
Oracle.bpm.runtime.jar
Oracle.bpm.ui.jar
All these above JAR’s can be found at the following directories
<JDevHome>\soa\modules\oracle.bpm.client_11.1.1
<JDevHome>\soa\modules\oracle.soa.fabric_11.1.1
<JDevHome>\soa\modules\oracle.soa.workflow_11.1.1
<JDevHome>\soa\modules\oracle.bpm.project_11.1.1
<MiddlewareHome>\wlserver_10.3\server\lib
<MiddlewareHome>\oracle_common\webservices
<JDevHome>\soa\modules\oracle.bpm.runtime_11.1.1
<JDevHome>\soa\modules\oracle.bpm.workspace_11.1.1
You can created Wlfullclient.jar as under
Change directories to the
server/libdirectory.
cd <MiddlewareHome>wlserver_10.3/server/lib
Use the following command to create
wlfullclient.jarin the
server/libdirectory:
java -jar wljarbuilder.jar
You can now copy and bundle the
wlfullclient.jarwith client applications.
Add the
wlfullclient.jarto the client application’s
classpath.
See here for more information
http://download.oracle.com/docs/cd/E12840_01/wls/docs103/client/jarbuilder.html
First and foremost like any remote client we need to get an instance of the SOA server runtime to be able to gain access to any running processes inside it. This is pretty simple. The following lines of code demonstrates
how we can use BPMServiceClientFactory class to get an instance of the server runtime.
Next initialize an IBPMContext from BPMServiceClientFactory.
See the code snippet below that shows how we can retrieve the audit diagram for a process instance
53 |
![](http://beatechnologies.files.wordpress.com/2011/07/image_thumb42.png?w=902&h=647)
A quick look at the image and we will realize what it is lacking. Off course we have been quite able to get the image for the process (similar to what we used to get using PAPI in OBPM 10g). However we don’t see the flow trace i.e the sequence of activities
that the instance traversed in its flow.
To get that we have get a List of DiagramEvent and highlight the process image by passing this list to it.
Create another private function to get a list of all Events that the instance encountered in its flow as below.
![](http://beatechnologies.files.wordpress.com/2011/07/image_thumb43.png?w=902&h=594)
This time you can see that the activities and transitions that the instance took are highlighted in the image.
The complete Java Class can be found below
Everything was almost same except for a few things.
There is no class called IProcessModelPackage that I could find in PS2 BPM jar’s
So the process image was obtained using IProcessModelService class like below
Oracle.bpm.project.io.jar <JDevHome>\soa\modules\oracle.bpm.project_11.1.1
Oracle.bpm.project.jar <JDevHome>\soa\modules\oracle.bpm.project_11.1.1
Oracle.bpm.project.compile.jar <JDevHome>\soa\modules\oracle.bpm.project_11.1.1
Oracle.bpm.vfilesystem.jar <JDevHome>\soa\modules\oracle.bpm.runtime_11.1.1
In case you would need the entire class here is what you should use in case you are on Oracle SOA Suite 11g PS2
[align=justify]Use it from any Custom UI/ Workflow UI to access the process image if need be.[/align]
[align=justify]Create a Web service wrapper over the Java Class and use it as a WS API that can be invoked from any BPM process and hence it can be reused across multiple BPM processes.[/align]
[align=justify]In case you would want to limit the use inside a composite then create a Spring SCA component for this custom Java class and then invoke it from inside a BPM process[/align]
In my future blogs I will try to come up with more interesting utilities with these BPM API’s. This will probably be of great use to folks who have worked with the PAPI API’s and find it a great miss in Oracle SOA Suite 11g.
Meanwhile also wondering what is stopping Oracle to publish a well document API for these interfaces. :-)
.
相关文章推荐
- Archiving Audit Diagrams as Images in Oracle SOA Suite BPM Processes2
- oracle jdeveloper+SOA+BPM Suite 11g 安装配置
- SOA_Oracle SOA Suite and BPM Suite 11g官方虚拟机安装指南(案例)
- Setting Web Service and JCA Adapter Endpoints Dynamically in Oracle SOA Suite
- Error using the Generate WSDL Button in Oracle E-Business Suite Integrated Soa Gateway Release 12.1
- Configuring Oracle E-Business Suite Integrated SOA Gateway Release 12.1.2 and Release 12.1.3 in a Multinode Environment (Doc ID 1081100.1)
- Using Intermediate Events and Advanced TaskService Interactions in Oracle BPM Suite 11g
- Deploying Customizations in Oracle E-Business Suite Release 12.2
- Oracle SOA Suite
- Deploying Customizations in Oracle E-Business Suite Release 12.2
- Deploying Customizations in Oracle E-Business Suite Release 12.2
- How to Audit the Top 10 Oracle E-Business Suite Security Risks
- Oracle SOA Suite环境搭建详解(转载)
- Oracle SOA suite介绍
- Using Integrated SOA Gateway in Oracle EBS
- Fault Management Framework in SOA Suite
- Use OpenLDAP as security provider in Oracle UCM 11g
- The Service-Oriented Media Enterprise: SOA, BPM, and Web Services in Professional Media Systems
- Enable Oracle E-Business Suite Integrated SOA Gateway
- Oracle SOA Suite 高级版安装(Windows 32位操作系统)