Saturday, October 22, 2011

Oracle SOA Dynamically set JCA properties for File Move/Delete/Copy service.

Oracle SOA Dynamically set JCA properties for File Move/Delete/Copy service.

This thread discusses how to dynamically set JCA properties for File Move/Delete/Copy service. The service can then be used to MOVE, DELETE or COPY a file.

  • Create a BPEL process.
  • In the right Swim Lane (External  References Swim Lane) configure a File Services Adapter.
  • Select Define from operation and schema (specified later), and click Next. The Operation page is displayed.
  • Select Synchronous Read File, enter FileMove in the Operation Name field, and then click Next. The File Directories page is displayed.
  • Alter the properties in the JCA file as follows

    <property name="SourcePhysicalDirectory" value="foo1"/>
     <property name="SourceFileName" value="bar1"/>
     <property name="TargetPhysicalDirectory" value="foo2"/>
     <property name="TargetFileName" value="bar2"/>
     <property name="Type" value="MOVE"/>

  • In the BPEL processa add the following variables.
<variable name="InvokeMoveOperation_FileMove_InputVariable" 
    <variable name="InvokeMoveOperation_FileMove_OutputVariable"
    <variable name="sourceDirectory" type="xsd:string"/>
    <variable name="sourceFileName" type="xsd:string"/>
    <variable name="targetDirectory" type="xsd:string"/>
    <variable name="targetFileName" type="xsd:string"/>

  • Create an Invoke activity for the JCA adapter.
<bpelx:inputProperty name="jca.file.SourceDirectory" 
      <bpelx:inputProperty name="jca.file.SourceFileName" 
      <bpelx:inputProperty name="jca.file.TargetDirectory" 
      <bpelx:inputProperty name="jca.file.TargetFileName" 

  • Create an Assign activity and copy the variables. 
        <from expression="'/tmp/src'"/>
        <to variable="sourceDirectory"/>
        <from expression="'input1.txt'"/>
        <to variable="sourceFileName"/>
        <from expression="'/tmp/output'"/>
        <to variable="targetDirectory"/>
        <from expression="'output.txt'"/>
        <to variable="targetFileName"/>

  • Deploy the service to test it. 
For questions, comments and feedback  please contact:
 Harvinder Singh Saluja


    1. In case of Sync file read I want to set dynamic file archive location for File adapter. There is not such property in invoke to set dynamic value. I can see filename and directory can be set dynamically but not the archive location. any idea about this.


    2. Did you try the property PhysicalArchiveDirectory and LogicalPhysicalDirectory


    SOA Cloud 12c GIT Repository

    When a project is created, you can choose to initialize the project with one project Git repository for the project. A Maven repository is a...