Showing posts with label Adapters. Show all posts
Showing posts with label Adapters. Show all posts

Monday, June 13, 2011

File sorting while processing using File/FTP adapter

File Adapter can process files in parallel if there are multiple threads. In case you want a particular order in which the files need to be processes then you must follow guidelines here

For writing custom file sorting algorithms follow the below blog.

Tuesday, June 1, 2010

Configuration and preference properties in BPEL and Adapters @ Composite

Configuration and preference properties are always used extensively in most of the projects. So a developer needs to be aware about the changes that have happened from 10g to 11g.

BPEL

In 10g the property values which had to be updated at runtime from BPEL Console were defined as preference property. Process level configuration settings were defined using the configuration properties in bpel.xml.

Coming to 11g, to define configuration properties and values for a BPEL process, add the properties under the service component section of the composite.xml file.

Code Snippet composite.xml

 <component name="BPELPropertiesTest">
    <implementation.bpel src=” BPELPropertiesTest.bpel"/>
        <property name="bpel.config.completionPersistPolicy">true</property>
  </component>
</component>

How to use preference properties in BPEL is well explained in the Eric Elzinga blog


Define properties in composite.xml under the component tag.

Code Snippet of composite.xml

<component name="PreferencesTest">

<implementation.bpel src="PreferencesTest.bpel"/>

<property name="bpel.preference.id">4402</property>

<property name="bpel.preference.name">Geo Tho</property>

</component>

Access these preferences in Assign activity using the ora:getPreference() XPath function

Code Snippet of .bpel

<assign name="AssignManagerDetails">

……………

<copy>

<from expression="ora:getPreference('id') "/>

<to variable="Manager" part="payload"

query="/client:processResponse/client:id"/>

</copy>

……

</assign>

The difference here is that instead of going to BPEL Console in 10g you will need to explore the System MBean browser to update these preference properties.

You can right click on soa_infra >Administration > System Mean Browser

Navigate to Application Defined MBeans > oracle.soa.config > Server : soa_server1 > SCAComposite > ProjectName > SCAComposite.SCAComponent > BPELProcessName.

Click Properties. It will list you all the properties that you can update.

Adapters

In case of Adapters the properties will be present in both Composite.xml and Adapter JCA file.

In case of File/FTP adapter, most of the properties are present in the jca file that gets generated as part of the File adapter. In case you select the logical directory, then value of the directory should be entered in composite.xml.

Code Snippet of composite.xml

<reference name="FileWrite" ui:wsdlLocation="FileWrite.wsdl">

<interface.wsdl interface="http://xmlns.oracle.com/pcbpel/adapter/file/GenericApp/PropertiesTest/FileWrite#wsdl.interface(Write_ptt)"/>

<binding.jca config="FileWrite_file.jca"/>

<property name="folder" type="xs:string" many="false" override="may">C:\temp</property>

</reference>

Code Snippet of File Adapter jca file

<adapter-config name="FileWrite" adapter="File Adapter" wsdlLocation="FileWrite.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">

<connection-factory location="eis/FileAdapter" adapterRef=""/>

<endpoint-interaction portType="Write_ptt" operation="Write">

<interaction-spec className="oracle.tip.adapter.file.outbound.FileInteractionSpec">

<property name="LogicalDirectory" value="folder"/>

<property name="FileNamingConvention" value="bpel_%yyMMddHHmmss%.txt"/>

<property name="Append" value="false"/>

<property name="NumberMessages" value="1"/>

</interaction-spec>

</endpoint-interaction>

</adapter-config>

All these end point properties can be updated at runtime from the Enterprose manager. Navigate to

Soa-infra > Composite process > Service/References Properties > AdapterName



In case of DB adapter, most of the operation related properties are present in the jca file that gets generated as part of the DB adapter. The connection related properties like retry count, retry interval are specified in composite.xml.

Code Snippet of composite.xml

<reference name="DBWrite" ui:wsdlLocation="DBWrite.wsdl">

<interface.wsdl interface="http://xmlns.oracle.com/pcbpel/adapter/db/GenericApp/PropertiesTest/DBWrite#wsdl.interface(DBWrite_ptt)"/>

<binding.jca config="DBWrite_db.jca"/>

<property name="jca.retry.count" type="xs:int" many="false" override="may">4</property>

<property name="jca.retry.interval" type="xs:int" many="false"

override="may">1</property>

<property name="jca.retry.backoff" type="xs:int" many="false"

override="may">2</property>

<property name="jca.retry.maxInterval" type="xs:string" many="false"

override="may">120</property>

</reference>

Code Snippet of DB Adapter jca file

<adapter-config name="DBWrite" adapter="Database Adapter" wsdlLocation="DBWrite.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">

<connection-factory location="eis/DB/p2icoeSOADEMO" UIConnectionName="p2icoeSOADEMO" adapterRef=""/>

<endpoint-interaction portType="DBWrite_ptt" operation="insert">

<interaction-spec className="oracle.tip.adapter.db.DBWriteInteractionSpec">

<property name="DescriptorName" value="DBWrite.Employees"/>

<property name="DmlType" value="insert"/>

<property name="MappingsMetaDataURL" value="DBWrite-or-mappings.xml"/>

<property name="DetectOmissions" value="true"/>

<property name="GetActiveUnitOfWork" value="false"/>

</interaction-spec>

</endpoint-interaction>

</adapter-config>

All these end point properties can be updated at runtime from the Enterprise manager. Navigate to

Soa-infra > Composite process > Service/References Properties > AdapterName