03 May 2010

Adding preference properties in 11g

The main question to ask here is how to get and set the preference properies..?

Well, in SOA 10g versions , this was hardly a question. This was very simple and straightforward in 10g.
In 11g with weblogic server at core,  this is still simple, but not so straightforward.

Getting value of a preference property :

1. Create a composite with BPEL.

2. Go to composite.xml file.
Add a property with name as bpel.preference.myprop1 to the BPEL component definition and set value as 100


Note : The preference properties should always start with prefixes 'bpel' and 'preference' .
So name for a property ABC will actually be  bpel.preference.ABC


3. In the BPEL process, add a Assign activity and use the standard ora:getPreference function as in 10g
Assign activity code looks like this :



Note that even though the preference property name is bpel.preference.myprop1 , it is accessed using
ora:getPreference('myprop1'). Also remember to put single quotes as the funciton ora:getPreference expects a String input.


4. Deploy and run the composite. Instance will show that output variable has value as 100.

Setting value of a preference property :

1. Go to enterprise manager. Navigate to 'System MBean Browser' by right-clicking soa-infra > Administration > System MBean Browser

 
Note that this is for 11.1.1.1 . For R1 PS-1 or R1 PS-2 , this might be different

2. In 'System MBean Browser' page, search for a MBean with name "oracle.soa.config" and select the first search.Alternately, go to 'Configuration MBeans' > 'Application Defined MBeans' > 'oracle.soa.config'
Inside this Managed Bean, go to 'Server:soa_server1' > SCAComposite > Composite Name > 'SCAComposite.SCAComponent' > BPEL process name.
(BPELProcess1 in this example)



3.  MBeans are Java objects which  provide a way of managing resources. Each system MBeans's interface has 3 facades - Attributes for setting properties , Operations for methods that can be invoked on that MBean and  Notifications that can be used to send event alerts. Out of these the attributes  contain the preference properties.
 Click the property attribute to open the properties for this BPEL. On this page, preference property 'myprop1' will be visible.



4. Update the property to new value. Click 'Apply' and then 'Return' to go back to the attributes page.
New properties can also be added but keep in mind the naming standard.

5. After updating the property, go back to composite and test the process to verify the new value.
 
POC for the same can be downloaded from here.

5 comments:

Anonymous said...

hey can you help me out in doing the dynamic partnerlink for an ftpadapter in soa11g

Anonymous said...

Hi,

I tried this method for softcoding few values in my BPEL program. When I change property value as you mentioned (in the MBeans Browser), the changes are lost if the SOA server is restarted. Any idea how we can make the changes to the properties permanent?

Thanks,
Nanda

Anonymous said...

Hi any clue on how to make these changes permanent?
Nanda , Did you find a solution or alternative?

Regards,
Moshe.S

Anonymous said...

can mediator access these properties in the same way?

Anonymous said...

In mediator configuration plan takes care of it.... refer oracle university materail for File Adapter exercise...