Wednesday, December 3, 2008

BPEL calling itself - in design time ...

If your process implements multiple operations, in other words the starting block of your process is a pick activity rather than a receive, you may come across the need to call itself occasionally. This is how it can be achieved.

  • Create a new partner link, give it a name "server", and select current project's WSDL as the WSDL file for this partner.

  • Select partner roles to be just opposite of what is in "client".(My role and partner role settings should switch with respect to client configuration)

  • Define "wsdlRuntimeLocation" property for "server" partner as something like this. This is very very important. http://localhost:8888/orabpel/default/MyProcess/?wsdl(Note that there is no version info in the endpoint and it ends with a slash to point to the default version. This will not work if "wsdlRuntimeLocation" property is not defined or not set appropriately.)

  • Now you can select all operations supported by this process to be invoked by itself from an "invoke" activity. Note that invocations lead to a new process instance to be created, not in the current instance.

Modifying BPEL partner link endpoints after deployment

BPEL dev guide advises one to use "wsdlRuntimeLocation" property of a partner link definition to override endpoints in the WSDL files. But the console does not allow this value to be edited if it ever need to be modified.

This is how one can do it OC4J - 10.1.3.3.0 deployment.
  • Shut OC4J down

  • cd to $OC4J_HOME/bpel/domains/$YOUR_DOMAIN/tmp/

  • Locate the directory that starts with ".bpel_***" and corresponds to your process and version. This directory has some hexa-decimal value in it and also ends with ".tmp".

  • cd to the above identified directory.

  • Modify "wsdlRuntimeLocation" property in bpel.xml found in this directory.(If you never used "wsdlRuntimeLocation" property, modify endpoint in the partner link WSDL directly)

  • Bring up OC4J.