Friday 30 August 2013

Dynamically write information with File/FTP Adapter using BPEL

I came across this today on OTN Community Forum:

Basically this user wanted to dynamically create folders by using the File Adapter and was asking if BPEL could do it. After I tried it could not, but the following work around worked for me.


Create the different Year&Month folders on your destination from Jan to Dec:
201301
201302
201303
201304
201305
201306
201307
201308
201309
201310
201311
201312
(You can actually create as many as you want going to 2090 if you want... 

Add the below config to your JCA File:

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

  <connection-factory location="eis/FileAdapter"/>
  <endpoint-interaction portType="Write_ptt" operation="Write">
    <interaction-spec className="oracle.tip.adapter.file.outbound.FileInteractionSpec">
      <property name="PhysicalDirectory" value="C:\Archive"/>
      <property name="Append" value="false"/>
      <property name="FileNamingConvention" value="%yyyy.MM%\filename"/>
      <property name="NumberMessages" value="1"/>
    </interaction-spec>
  </endpoint-interaction>
</adapter-config>

This will allow the files to be dynamically created in the correct directories.


No comments:

Post a Comment