Friday, November 15, 2019

12c SOA BPEL - Set and Get Preference Property

By adding Preference property in composite.xml, we could get the value as variable into our BPEL process and later we can change the value from the EM console.

<component name="Helloworld">
    <implementation.bpel src="Helloworld.bpel"/>
    <property name="bpel.preference.MyPreference">Value</property>
</component>

Now we can use this MyPreference value in our BPEL process by using the following function
ora:getPreference(MyPreference)

Implementation steps:
Create a SOA Project



 Choose Synchronous BPEL Process

Open Composite.xml file in source mode and add Preference property in inside Component section.
Here I am using it for Email so my property name is "bpel.preference.Email", you can give it any name as per your requirement.

                 bpel.preference.{CustomName}

<component name="PreferenceBPELProcess" version="2.0">
    <implementation.bpel src="BPEL/PreferenceBPELProcess.bpel"/>
    <componentType>
<service name="preferencebpelprocess_client" ui:wsdlLocation="WSDLs/PreferenceBPELProcess.wsdl">
<interface.wsdl interface="http://xmlns.oracle.com/SOAApplication/PreferenceProject/PreferenceBPELProcess#wsdl.interface(PreferenceBPELProcess)"/>
      </service>
    </componentType>
    <property name="bpel.config.transaction" type="xs:string" many="false">required</property>
    <property name="bpel.preference.Email">test1@test.com</property>
  </component>
Use this preference property inside BPEL.
To use this property inside BPEL you need to use ora:getPrefernce("CustomName") function.
ora:getPreference('Email')



 Deploy and Test from EM console

Update preference property value in EM console.
We can update this property from System MBean Browser inside EM console.
 Go to EM console (http://host:7001/em)⇾Navigate to "Farm_base_domain"⇾"Weblogic Domain" folder⇾ Right click on your domain⇾"System MBean Browser"
Go to Application defined MBean Browser⇾"oracle.soa.config"⇾"soaserver"⇾"SCAComposite"⇾Choose your composite
 Then navigate to "SCAComposite.SCAComponent"⇾your component name⇾Click on "properties"
 Now you can see all the preference properties that you defined in your composite. You can change preference property value here.


Notes:

  • If you restart the servers or re-deploy the composite then it will take the default preference value set to the composite.xml.

No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...