Thursday, January 1, 2009
Wednesday, May 28, 2008
BPEL DBAdapter : Using Oracle Native Sequence
Do you know , how to use DBAdapter to insert a record in the database ? Seem's very straight forward . isn't it ?
Yes, in fact it is straight forward. Just configure the database, select the operation (insert,update, merge and delete ) and then map the input's. run the sample and there you go, there is a record in the database. Bang!!!!!!!.
But , the real problem begin, when you have the table which has a primary key. Now either you need to generate a unique ID in the BPEL layer and map it to the DBAdapter message type variables or use a sequence created in the database. Best thing is to use the database sequence . But how to do it ? Is there a documentation or if it exists is it good enough ? For the benefit of this blog readers , here is how I made it to work after spending long hours on the internet and trial and error. I am sure , it will save you a lot of time and if so, just leave your comments.
OK, now the steps to make it work.
1. Create a table with a primary key
2. Create a sequence with start value as 1 and increment by 1
3. Configure the DBAdapter for an insert option.
4. After successful configuration of the DBAdapter, you will find the "offline objects" and toplink mapping created for you.
so far normal. nothing much.. here are the undocumented (not with proper documentation) steps
5. Configure the DBAdapter's oc4j-ra.xml with the following parameters
<connector-factory location="eis/DB/XE" connector-name="Database Adapter">
<config-property name="xADataSourceName" value="jdbc/XEDataSource"/>
<config-property name="dataSourceName" value=""/>
<config-property name="platformClassName" value="oracle.toplink.platform.database.Oracle9Platform"/>
<config-property name="usesNativeSequencing" value="true"/>
<config-property name="sequencePreallocationSize" value="1"/>
<config-property name="defaultNChar" value="false"/>
<config-property name="usesBatchWriting" value="false"/>
<connection-pooling use="none">
</connection-pooling>
<security-config use="none">
</security-config>
</connector-factory>
usesNativeSequencing : Set this to "true" to allow native sequencing
sequencePreallocationSize: This should be the counter that you use for your sequence. (eg : If we created a sequence with increment by 1, so the value of this should be 1). Please note , the default value is 50.
xADataSourceName : datasource name for connecting to the database in the oc4j.
The important steps to come..stay tuned.
How to rename BPEL project in JDeveloper
Although, there is a workaround by using Templates , to rename any of the existing BPEL process with the new name.
Here are the steps
1. Select the project which needs to be renamed and select from the context menu "mark as template"
2. Give a name to the teamplate and click on "OK".
3. Now create a new BPEL project with the desired name and make sure to select the template that you created from the template drop down.
4. Click ok, It will ask you to overwrite build.properties and build.xml files. Click OK
5. Now close the new project and reopen it to see the project with the desired name
Custom Domain User Management in Oracle BPEL PM 10.1.3.3
Here I will share the findings on how user management can be done in a custom domain ( not the "default") for Oracle BPEL Process Manager 10.1.3.3. I will talk about the details steps to create a custom domain and then create roles and assigning the roles with proper permission to access the custom domain. The security provider used is JAZN which is File Based Security provider based on JAAS. It also details the steps when the BPEL is installed with default OC4J instance (home) or different OC4J instance
Steps to create a Custom Domain
1. Login to Oracle BPEL PM as BPEL Administrator
2. Click on BPEL Domains
3. Click on “Create New BPEL Domain”
4. Enter the Domain Id as “custom_domain”
5. Click on Create to complete the Custom Domain Creation
User Management for Custom Domain (custom_domain)
Oracle BPEL PM comes with a domain “default”. It also comes with certain responsibilities which controls the access to this domain. The roles related to this “default” domain includes
BPMDefaultDomainAdmin
This role is to control the access to the “default” domain.
BPMSystemAdmin
This role is to control the access to the entire BPEL PM including the “default” domain and all other custom domains
Steps to implement for allowing access to Custom Domain (custom_domain)
BPEL Installation in Default OC4J instance
1. Navigate to $ORACLE_HOME/j2ee/home ($ORACLE_HOME/j2ee/)
2. Create the Role with name (BPMCustomDomainAdmin)
$ORACLE_HOME\j2ee\home>java -jar jazn.jar -user oc4jadmin -password welcome1 -addrole jazn.com BPMCustomDomainAdmin
3. Grant permissions to the role created in step (2) above
$ORACLE_HOME\j2ee\home>java -bootclasspath/a:$ORACLE_HOME\bpel\lib\orabpel-boot.jar -jar jazn.jar -grantperm jazn.com -role BPMCustomDomainAdmin com.collaxa.security.DomainPermission custom_domain all
4. Now create the users and assign the the above role
5. Restart the BPEL oc4j
5. Login to BPELConsole.
BPEL Installation in different J2EE home (oc4j_soa)
1. Navigate to $ORACLE_HOME/j2ee/home
2. Copy all the jar files and lib folder in this directory to $ORACLE_HOME/j2ee/oc4j_soa
This step is very important , if not the entries created further will get added to home system-jazn-data.xml
3. Navigate to $ORACLE_HOME/j2ee/oc4j_soa
4. Create the Role with name (BPMCustomDomainAdmin)
$ORACLE_HOME\j2ee\home>java -jar jazn.jar -user oc4jadmin -password welcome1 -addrole jazn.com BPMCustomDomainAdmin
5. Grant permissions to the role created in step (2) above
$ORACLE_HOME\j2ee\home>java -bootclasspath/a:$ORACLE_HOME\bpel\lib\orabpel-boot.jar -jar jazn.jar -grantperm jazn.com -role BPMCustomDomainAdmin com.collaxa.security.DomainPermission custom_domain all
6. Now create the users and assign the the above role
7. Restart the BPEL oc4j
8. Login to BPELConsole
grantperm : command option to grant permission
jazn.com : Realm for File Based Security Provider (JAZN)
com.collaxa.security.DomainPermission : Permission name for the Domain
custom_domain : Custom Domain Name
all : access level. The current version of Oracle BPEL PM ( 10.1.3.3) supports either to grant all permissions to a domain / no permission
More.......
1. To grant System Administrator privileges for a custom role created, the permission to be given to com.collaxa.security.ServerPermission
$ORACLE_HOME\j2ee\home>java -bootclasspath/a:$ORACLE_HOME\bpel\lib\orabpel-boot.jar -jar jazn.jar -grantperm jazn.com -role BPMCustomDomainAdmin com.collaxa.security.ServerPermission server all
2. If above commands run successfully, the entries will be added to system-jazn-data.xml
Reference:
Oracle® BPEL Process Manager Administrator's Guide 10g (10.1.3.1.0)
Oracle SOA in Go-Live Projects
The intention of this blog is to share my personal experiences in implementing the Oracle SOA at various customer locations. I will discuss and share the issues that we faced during the implementation and their solutions.
Thanks,
Satish