Apr 16, 2009

Play with Java API's for BPEL

There is a set of Java API's provided for accessing the BPEL console.




It’s easy to use them if you have a little bit of java knowledge and all the library file are properly placed in your project path.



The following is a sample Java code for connecting to the BPEL domain


Properties props = new Properties();

props.put("orabpel.platform", "ias_10g");

props.put("java.naming.factory.initial", "com.evermind.server.rmi.RMIInitialContextFactory");

props.put("java.naming.provider.url", "opmn:ormi://localhost:6003:home/orabpel"); 

props.put("java.naming.security.principal", "oc4jadmin");

props.put("java.naming.security.credentials", "welcome1");

props.setProperty("dedicated.rmicontext", "true");


//Get a locator in default domain

Locator locator = new Locator("default","welcome1",props); 


java naming provider url format is opmn:ormi://yourhost:opmn port:oc4j //instance/orabpel. Note that 6003 is opmn port and in the console the port //may be different

Caution: Purge All Instance

Purge All Instance is an option in the BPEL console( which can be used to delete all the instances till date. But we have to be 
too careful in using that.Since it can delete all the instances within 2 clicks even in production enviornment!!! ... Sadly its difficult to control that option even using role based security. Today I got the sililar requirement from the client to remove/disable the purge All Instance option from the console such that that mistakes never happens. 

So I was searching in blogs / forums to that. Finally I found out a simple solution.  I have edited the file ngDomainActions.jsp under       $ORACLE_HOME/j2ee/OC4J_SOA/applications/orabpel/console such that the Purge All Instance option will not appear in the console.So follow the below steps to complete it

1. Take the back up of ngDomainActions.jsp from th
e location $ORACLE_HOME/j2ee/OC4J_SOA/applications/orabpel/console.
2. Place the attached file on the above mentioned path
3. Restart the server... The option will be gone !!!
4. To activate again , just place the backup file again and restart the server

So it will look like below after removing that option 

For periodic purging of the instances you can write the procedures on the database. The option in the console will be more tempting to purge the instances !!! (specially for newbies )