Wednesday Dec 17, 2014

Customizing Oracle MFT File Rename Java Callout

Review and Use Case

So now that you have all digested the previous Overview blog in this Customizing MFT series, you fully understand the components of Custom Actions(callouts) and have built the Newline Conversion sample from the Oracle MFT Documentation section Processing Transfers with Custom Callouts you are ready to build another real world scenario that implements a file rename inside of the MFT engine. I say inside because that differentiates it from the use case where a file is written to the file system or remote FTP server and then renamed after it is delivered. This use case is a file comes in from a Source that has extra characters in the name such a time-stamp that you wish to remove using standard Java regular expressions. I.E. order20151011.xml would be renamed to order.xml or customer12345.csv is renamed to customer.csv.


XML Config File

As you know, each of the callout actions needs an xml config file that defines the interface. Below is the config file for this sample that defines things like action name, library name, help text and parameters that are configured in the designer. This sample is used in Target Pre-Processing and takes 2 parameters, SourceExp and ReplaceWith. Details for configuring callout config files were covered in the last blog entry so go reread that if this isn't clear, To proceed, just download the file from the link below or copy the bolded text into your favorite text editor and save the file RenameRegexp.xml it into a new folder named RenameRegexp.


<?xml version="1.0" encoding="UTF-8"?>
  <mft:Callouts xmlns:mft=""
    xsi:schemaLocation=" callout.xsd ">
    <mft:Callout description="Rename Regexp"
      helpText="File Rename with Regular Expressions"
      groupName="Target-pre" timeout="300"
      libraryName="RenameRegexp.jar" name="RenameRegexp">
    <mft:Parameter description="SourceExp" mandatory="true"
      helpText="Source Regular Expression Pattern"
      name="SourceExp" parameterType="string"/>
    <mft:Parameter description="ReplaceWith" mandatory="true"
      helpText="ReplaceWith Regular Expression Pattern"
      name="ReplaceWith" parameterType="string"/>

Java Source Code

As you know, there are different API's for Source, Pre and Post Target callouts. This example illustrates the Pre Target interface that is not modifying the file contents like the Newline Conversion example did. To review this topic visit the MFT Documentation page titled Java Code Requirements and Tips. The java class receives 2 strings at runtime for regular expression substitution that are configured in the Designer Transfer artifact. The  new and interesting code being used here to get and set the new file name are the methods PluginContext.getTransformedInputFileName and PluginOutput.setNewFileName. The regular expression substitution is implemented with an old reliable single line of code using String.replaceAll. Below are a code snippets illustrating this.

   	PluginOutput out = new PluginOutput();
	oldfname = pluginContext.getTransformedInputFileName() ;
 	newfname = getNewname(oldfname, SourceExp, ReplaceWith);
	if (newfname != null && newfname.length() > 0) { 
   public String getNewname(String oldfname, String srcexp, String repexp) {
	return oldfname.replaceAll(srcexp, repexp);


Download the full file and place it in a newly created child directory of your RenameRegexp folder called com/oracle/callout/sample.

Compile, Package and Install

This section assumes the following environment variables have been set.

  $MW_HOME where your MFT WebLogic is installed

  $JAVA_HOME where your JDK 1.7 is installed


From the command prompt, run the following command. The command is split to multiple lines.

  $ $JAVA_HOME/bin/javac

   -classpath $MW_HOME/mft/modules/oracle.mft_12.1.3.0/core-



Now use the JDK "jar" command to build a java jar file as shown below. The cmd is split to multiple lines.

  $ $JAVA_HOME/bin/jar

     cvf RenameRegexp.jar com/oracle/callout/sample/RenameRegexp.class


This involves 2 steps, first copy the jar file to the MFT server callout folder and another to import the config xml file. Use the copy command shown below. Note the domain name below may be different in your environment.

  $ cp RenameRegexp.jar $MW_HOME/user_projects/domains/base_domain/mft/callouts/

NOTE: If you have an MFT export of a file transfer that uses this callout, you can import it and skip this WLST step.

Next, run a WLST command to import the RenameRegexp.xml file

  $ $MW_HOME/mft/common/bin/

Connect to your WebLogic Server using your host, port and admin credentials

  connect("weblogic", "<PASSWORD>, "t3://localhost:7901")

Enter the WLST CreateCallout command substituting the location of your files.


Do a listCallouts() command to verify it worked.


Enter the exit() command to quit WLST.


Deploy a Transfer and Test

This section requires some knowledge of Java Regular Expressions. This implementation uses the java String.replaceAll method. It is recommended to use an external tool test test your expressions in advance. There are many available but has a nice online tool for testing your expressions before entering them into the MFT Designer. For this example, you will use following parameter values to rename a file order20151011.xml to order.xml.

  SourceExpr:  ([A-z])\d+(.*)

  ReplaceWith: $1$2

Design and Deploy

At this point, the RenameRegexp callout action will appear in your Transfers Target Pre-Processing UI and is ready to use in any Transfer. Go to the Designer and build a Transfer "Rename Transfer" with a Source and Target of "Rename FTP Source" and "Rename FTP Target". The FTP Embedded Source  uses a location of "/rename/in" and the FTP Remote Target uses a location of "/rename/out". The Transfer should look like the following screenshot.

You need to configure the Pre-Processing Action in the Transfer with the below parameters as shown in the screens below.

  SourceExpr:  ([A-z])\d+(.*)

  ReplaceWith: $1$2

Now Save and Deploy this Transfer as you would any other Oracle MFT Transfer.


To test use any FTP Client to connect to the MFT embedded FTP server and copying a file named  "order20151011.xml" to the "/rename/in" folder. When completed, go to the MFT Monitoring console and view the transfer report as shown below.

Congratulations, you have implemented a very handy, configurable and reusable rename custom callout that you can use in any Transfer Pre-Target Processor Action and it only took 76 lines of code! A completed export of this Transfer is also  available for download

Monday Nov 24, 2014

Customizing Oracle MFT with Java Overview

This is the first in a series of how to customize Oracle Managed File Transfer (MFT) using java callouts. It is assumed you have a working knowledge of Oracle MFT and can build, deploy and test basic transfers with Oracle MFT. We'll start by reviewing the instructions in the documentation section Processing Transfers with Custom Callouts then discuss terminology, types, invocation order and use cases for Sources, Pre-Targt and Post-Target.
[Read More]

Friday May 03, 2013

Oracle SOA and BPM at JavaOne 2013 India

JavaOne 8-9 May 2013 Hyderabad

Sessions include: 

Hands-On Introduction to Integration and Oracle SOA Suite 11g

Wednesday, May 8, 2:00 PM - 4:00 PM - Flexi 1 HOL Room - Develop

Building Next-Generation Applications with Oracle Business Process Management Suite

Wednesday, May 8, 5:45 PM - 6:45 PM - Hall 2

Oracle SOA Suite: the Most Capable Tool for Every Possible Integration Challenge

Thursday, May 9, 10:15 AM - 11:15 AM - Hall 2

...and more sessions on Oracle Event Processing too. Hope to see you there!

Thursday Apr 04, 2013

Rise of the Mobile Machines - Oracle Reveals Strategy on Internet of Things

With the explosion of connected devices and the ubiquity of high speed wireless connectivity, Internet of Things takes on a new relevance. Machine to Machine (M2M) communication can change your game of operations and create opportunities for new services and revenue streams. Oracle’s platform for M2M called Device to Data Center (D2D) helps support the needs of the enterprise to leverage this new opportunity by gathering actionable insight from devices and respond right at the network edge.  The platform leverages multiple Oracle products to deliver a complete solution, including Oracle Event Processing (OEP)  on Oracle Java Embedded to make intelligent, real-time decisions while managing massive amounts of machine data on the fly.

Fast Data - delivering on real-time responsiveness with business insight, on large volumes of high velocity data from varied sources becomes a reality with Device to Data Center. Oracle's strategy to deliver on  Device to Data Center is revealed in the following webcast by Peter Utzschneider, VP of Product Management of Java. 

Thursday Mar 28, 2013

Push Fast Data to the Edge

Oracle today announced the availability of Oracle Event Processing for Oracle Java Embedded, a smaller footprint version of Oracle Event Processing (OEP) tailored for deployment on gateways. This can change the game plan for your organization’s responsiveness by harnessing Fast Data.

With an increase in the number of mobile devices and the ubiquity of high speed connectivity, we are entering an era where organizations can change their game plan with responsiveness. There is an explosion of data generated by mobile devices – not just cell phones, but large volumes of data coming from implementations such as industrial and building control, e-health, smart grid and home automation that need support for edge devices like wireless modules for Machine to Machine communication (M2M) and environmental sensors. However to be responsive, this large volume of high velocity data from varied sources has to be converted to actionable insight. In addition this data loses relevance with time. Fast Data is taking meaningful action on this large volume of data as it gets generated.

Oracle Event Processing for Oracle Java Embedded allows embedding OEP on gateways. This allows embedding intelligence to filter and correlate the data as it occurs, as close to the devices as possible. Oracle Event Processing for Oracle Java Embedded will provide companies the ability to handle massive volume and growth of data coming from edge devices by processing data closer to the source.

In addition to this capacity to embed a lightweight event processing engine on gateways, OEP provides flexible deployment options: standalone, integrated as part of the Oracle SOA stack as well as on embedded devices. This gives you a versatile, high performing event processing engine that can be deployed just about anywhere to process fast data.

To learn more visit us at Oracle Event Processing and to understand more on Fast Data watch our webcast: Fast Data Solutions

Press Release: Oracle Event Processing (OEP) for Oracle Java Embedded

Thursday Dec 15, 2011

Sun Java CAPS to Oracle SOA Suite Migrations

After the Sun acquisition, largely welcomed by customers and industry alike, Oracle expressed a strong commitment to support Java CAPS customers in both their current investment as well as in delivering options to facilitate their migration to Oracle Fusion Middleware  (and more specifically Oracle SOA Suite).

Oracle is committed to preserve the investment of Java CAPS customers. This commitment has been demonstrated through the extension of most support timelines previously announced by Sun as well as the addition of Indefinite Sustaining Support options - see the
Oracle Lifetime Support Policy for Oracle Fusion Middleware brochure for exact dates.

For customers ready to migrate to SOA Suite, Oracle offers a range of benefits, commercial ones as well as technical ones, with the goal to minimize costs and risks.

First, Oracle offers a license migration program that includes license credits and no extra support cost for legacy software during the migration phase, for an extensive period of time (please contact your Oracle sales representative for the exact details of the license migration program and support benefits). It is also important to note that key Java CAPS libraries and components are now included in the Oracle SOA Suite license. This was done to ensure that you can run migrated artifacts that have a dependency on these libraries without having to keep your full Java CAPS licenses.

Secondly, Oracle offers expertise through Oracle Consulting Services. Our OCS team has expertise in both Java CAPS and SOA Suite and has helped several Java CAPS customers to take advantage of the robust, scalable, feature-rich and cost-effective SOA Suite while retaining their, often large investment, existing code already running in Java CAPS. OCS offers "SOA migration assessment and planning services" that focus on the critical planning and architectural aspects required to ensure a successful migration. Understanding that customers might already have their own preferred system integrator, Oracle has also been working with members of the Oracle Partner Network (over 50 workshops delivered around the world as to date) to help them package their expertise as a commercial offering.

Finally, Oracle has developed migration tools and certified interoperability across Fusion Middleware and Java CAPS.  Tooling has been developed to migrate a host of Java CAPS artifacts (such as JCDs, OTDs and BPEL) to SOA Suite across  various versions of the products such Java CAPS 6.x,  JBI-based projects, Java CAPS 5.1.x , BPEL 1.x/2.0,  ICAN 5.0 JCDs and so on. Oracle has also certified the interoperability of Java CAPS and SOA Suite across JMS and Web Services. This interoperability approach is key to ensure a seamless co-existence of the two generations of products during migration. Please watch this blog for a more detailed post on technical capabilities of the migration tools.

Whilst customers have found that other vendors are on a voyage of discovery or on a mission to sell services under the guise of product, they see Oracle's commitment to customer satisfaction bearing real fruit. They have been turning to Oracle, who is now owner of both Java CAPS and Oracle SOA Suite, as the only company with sufficient depth of knowledge and experience in both the source and target platforms as well as the only one able to offer the licensing and support benefits highlighted above. Earlier this year, during Oracle Open World, customers and partners have come forward and started sharing their
migration success stories.

Please do not hesitate to contact us if you are currently using any Sun/SeeBeyond integration products and looking at modernizing - we can help!

Find Us on facebook Follow us on twitter Oracle SOA Suite forum
SOA PM team
Welcome to the Oracle SOA Suite team blog. We'll use this site for news and information that did not make it into our official documentation for a reason or another.


« October 2015