Friday, March 2, 2012

How to Set and Get Preferences in SOA 11G

For your reference visit

http://www.xenta.nl/blog/2009/10/28/oracle-soa-suite-11g-setting-and-getting-preferences/

In SOA 11g we had the functionality to add preferences to our bpel process.

By adding below 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)

=====================================
(Sample for initializing MyPreference value to Temp variable as per BPEL 2.0 Spec)

<Assign>
     <copy>
        <from>ora:getPreference(MyPreference)</from>
        <to>$Temp</to>
     </copy>
</Assign>
======================================

After deployment we can change these preference values in EM console.

Follow below steps to change the preference values .

Step1: Open em console

Step2:

On the left go to :
Farm_soa_domain > Weblogic Domain > soa_domain > right mouseclick and select 'System MBean Browser'.

mbean

Step3:

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

properties

Step4:

Change the value of your preference and click apply.


preference

Monday, February 20, 2012

How To Read a Single File in Chunks in SOA 11g

This is a feature of Oracle File and FTP Adapters that uses an invoke activity within a
while loop to process the target file. This feature enables you to process arbitrarily
large files.

To achieve this follow the steps below.

1)Create File/FTP Adapter and select the operation type as "SynchRead"

2)Select the sample directory name and file name for incoming files

3)Select the message schema as a native

4)Click on Finish.

5)Now edit the .jca file as below

    <interaction-spec className="oracle.tip.adapter.file.outbound.ChunkedInteractionSpec">
      <property name="DeleteFile" value="true"/>
      <property name="PhysicalDirectory" value="/temp"/>
      <property name="FileName" value="dummy.txt"/>
      <property name="ChunkSize" value="10"/>
    </interaction-spec>

6) Now create an invoke activity and create partner link to the created File Adapter.

Now your file Adapter will be ready to read in chunks.

Now we need to put this invoke in while loop and check for end of the file by using following properties.

By setting following properties in invoke activity

From Side
         <bpelx:fromProperties>

                <bpelx:fromProperty name="jca.file.LineNumber" variable="<Variable>"/> (Returns Line Number)
                <bpelx:fromProperty name="jca.file.ColumnNumber" variable="<Variable>"/>(returnColumnNumber)
                <bpelx:fromProperty name="jca.file.IsEOF" variable="<Variable>"/>(returnIs End Of the File)
                <bpelx:fromProperty name="jca.file.IsMessageRejected" variable="<Variable>"/>(returnIs Message Rejected)
                <bpelx:fromProperty name="jca.file.RejectionReason" variable="<Variable>"/>(returnRejectionReason)
                <bpelx:fromProperty name="jca.file.NoDataFound" variable="<variable>"/>(returnNoDataFound)

          </bpelx:fromProperties>