Monday, September 15, 2008

Change my Partnerlink Property Dynamically

What forced me into it?

This was in production. And there were 2 releases planned into production.
This was a property that was defined in bpel.xml file in the partnerLinkBinding.
As part of the second release the property had to be changed.

How did I do it?

Well I used java embedding to get this done.

Created a java embedding to change the property value in the partnerLinkBinding

Sample bpel.xml file
<?xml version = '1.0' encoding = 'UTF-8'?>
<bpelsuitcase>
<bpelprocess id="UpdateThis" src="UpdateThis.bpel">
<partnerlinkbindings>
<partnerlinkbinding name="client">
<property name="wsdlLocation">UpdateThis.wsdl</property>
<property name="myPartnerlinkProperty">myValueOfPartnerlinkProperty</property>
</partnerlinkbinding>
</partnerlinkbindings>
<configurations>
<property name="configProperty" encryption="plaintext">myBPMSystemAdmin</property>
</configurations>
</bpelprocess>
</bpelsuitcase>


Sample java embedding code to change these

try {
getLocator().lookupProcess ("UpdateThis").getDescriptor ().
getConfigurations().

setPropertyValue ("configProperty",
"BPMSystemAdmin");
getLocator().lookupProcess ("UpdateThis").getDescriptor ().

getPartnerLinkBindings().
getPartnerLinkBinding ("client").
setPropertyValue ("myPartnerlinkProperty",
"myChangedValueOfPartnerlinkProperty");
}
catch(Throwable ex) { .... }


Whatz the issue with restarting AS?

The first time I saw this it looked stupid. I changed the property from using another dummy bpel process. Used that happily till I restarted the AS.
And when I did the values in the partnerlink went back to those present earlier.

What I tried but failed?

And then I realized that the AS will reload all the BPEL process from the SUITCASE_BIN
The changed functionality with 10.1.3.X

A option that I tried but failed was to change the DESCRIPTOR column value in the PROCESS_DESCRIPTOR table.

But that did not help with restart. It always went back to the values that were present as part of the original deployment.
If you are thinking where can I find these tables, they are in the ORABPEL schema.

No comments: