In Oracle Bpel 10g we had the functionality to add preferences to your bpel process.
By adding the next xml to the bpel.xml file we could get the value as variable into our process and change the value from the console.
<preferences> <property name="myPref">MyCurrentValue</property> </preferences>
In the new Oracle SOA 11g things changed a little but. Like Marc already described in his blog we now need to add the preferences to the composite.xml of our Composite Application.
Add the next xml to the composite.xml :
<component name="BPELProcess1">
<implementation.bpel src="BPELProcess1.bpel"/>
<property name="bpel.preference.myPref">MyCurrentValue</property>
</component>
Now we can use the function ora:getPreference(myPref) in our bpel process to retrieve the value of the preference.
Watch the naming convention. It expects it to start with “bpel.preference”.
Create the composite application and deploy it.
We only added an assign to the flow which will get assign the value of the preference to the outputVariable.
Run the bpel and check if the value of ‘MyCurrentValue’ is in the outputVariable.

In Oracle SOA Suite 10g we could change the value of the preferences from the bpel console.
In Oracle SOA Suite 11g things changed a but, we got a new fancy console to manage all the components.
To change to values from the prefences go to the ‘Enterprise Manager’ (http://localhost:7001/em).
On the left go to :
Farm_soa_domain > Weblogic Domain > soa_domain > right mouseclick and select ‘System MBean Browser’.

Navigate to Application Defined MBeans > oracle.soa.config > Server : soa_server1 > SCAComposite > your_project > SCAComposite.SCAComponent > your bpel_process.
Select the Attribute ‘Properties’.

Change the value of our preference and click apply.

Run the bpel again to see if the new value got used in the process.

Popularity: 5% [?]



15 Responses to “Oracle SOA Suite 11g, Setting and Getting Preferences”
This was very helpful to me. I had an SR open with oracle support for over a month and they never did figure this out. Thanks for the solution!
This didn’t work for me until I used single quotes in the getPreference function:
ora:getPreference(‘myPref’)
Hi Eric,
you can also add these properties to the *.componentType file of the bpel component. and use preference.XXX as name instead of bpel.preference.XXX
<componentType xmlns="http://xmlns.oracle.com/sca/1.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:ui="http://xmlns.oracle.com/soa/designer/">
<property name="preference.ok" type="xs:string"
xmlns:xs="http://www.w3.org/2001/XMLSchema"></property>
</componentType>
and use this ora:getPreference(‘ok’)
And to set the value of preference in the BPEL process?
Something like ora:setPreference?
Hm i don’t think you can from within the bpel itself.
I think it is possible to customize the BPEL Functions within ExpressionBuilder, and so to create a setPreference as the getPreference code.
[...] http://eelzinga.wordpress.com/2009/10/28/oracle-soa-suite-11g-setting-and-getting-preferences/ [...]
[...] Original blog [...]
Parâmetros de processo no Oracle BPEL 11gParâmetros de processo no Oracle BPEL 11g…
Um recurso interessante do BPEL é a declaração de parâmetros “de processo”, que podem ser alterados em runtime, facilitando bastante customizações. Basicamente, criamos uma preference no JDeveloper com um valor default, e se necessário, mudamos esse …
Parâmetros de processo no Oracle BPEL 11g…
Um recurso interessante do BPEL é a declaração de parâmetros “de processo”, que podem ser alterados em runtime, facilitando bastante customizações. Basicamente, criamos uma preference no JDeveloper com um valor default, e se necessário, mudamos esse …
I am trying to use preferences in 10.1.3.5 to store an email address. The address needs to be changed using a deployment plan but it won’t work.
Is there a function similar to ora:getPreference() that will get the “Email_To2″ property from the ??
In the bpel.xml below, I can change the “Email_To2″ value using the deployment plan but can’t get to it from the bpel code.
I can get to the “Email_To” value in the bpel code but can’t change the value in the deployment plan.
developers@xyz.net
Steve_Test.wsdl
developers@xyz.net
What am I missing?
Thanks,
XML disappeared…
<BPELProcess id=”Steve_Test” src=”Steve_Test.bpel”>
<configurations>
<property name=”Email_To2″>developers@xyz.net</property>
</configurations>
<partnerLinkBindings>
<partnerLinkBinding name=”client”>
<property name=”wsdlLocation”>Steve_Test.wsdl</property>
</partnerLinkBinding>
</partnerLinkBindings>
<preferences>
<property name=”Email_To”>developers@xyz.net</property>
</preferences>
</BPELProcess>
</BPELSuitcase>
Are you retrieving the property from within your bpel process the correct way?
The definition of the property looks ok, so the getPreference function should work.
Can you paste the bpel code from which you do the get ?
[...] a mbean in the enterprise manager. Although I cannot see any advantages of that in this case. See this blog if you are intested though. Tags: BPEL, Java, soa suite 11g Share this [...]
This perfectly work in Single node environment.
By any chance do you know where to check these properties on EM for Cluster enviroment?
Thank you.