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

    Oracle SOA 12c: How To Create READ-ONLY Access To The JMS Messages For Monitor User

    Create a user who only can view the JMS Messages and can not create,  delete,  move or import JMS Messages, and can not monitor other resour...