9 Managing File Transfers

This chapter describes Oracle Managed File Transfer (MFT) usage and provides an overview of how Company X integrates its SOA composite applications with Oracle MFT.

This chapter includes the following sections:

9.1 Business Challenge

Company X has a requirement for its composites to interact with different endpoint types, amongst them file- and FTP-based endpoint types. For example, Company X must be able to use an FTP server to write files to a file system.

9.2 Business Solution

To address these business challenges, Company X designs a business solution that uses the components described in Table 9-1.

Table 9-1 Components That Provide the Business Solution

Component How This Component Addresses The Business Challenge Component Description

Oracle MFT transfer

  • An Oracle MFT transfer receives files and writes them to the file system using the MFT embedded FTP server.

  • Oracle MFT invokes an MFT service in a SOA composite application and dynamically decides based on file size whether to pass the content inline or by reference.

Oracle MFT is a high performance, standards-based, end-to-end managed file gateway. Oracle MFT provides design, deployment, and monitoring of file transfers using a lightweight web-based, design-time console that includes file encryption, scheduling, and embedded FTP and sFTP servers.

Subsequent sections of this chapter provide more specific details about how the components in Table 9-1 are used to address the file transfer business challenge.

9.2.1 Creating Transfers, Sources, and Targets

The file delivery structure of Oracle MFT consists of the following types of artifacts:

  • Sources define the origin of files.

  • Targets define the destination of files.

  • Transfers associate a source with one or more targets.

You create these artifacts on the designer page of the Oracle Managed File Transfer Console.

Company X creates a transfer named OrdersTransfer, as shown in Figure 9-1. The page includes options for creating sources and targets.

Company X creates the following source and target artifacts:

  • A source named CreateSource in which files are placed in the /orders directory. The FTP embedded server is selected for transferring the file. Figure 9-2 provides details. The source location is further defined to process files that adhere to the pattern of Order*.xml.

  • A target named OrdersFileTarget in which transferred files are placed in the /tmp/orders directory. File targets can be reused by overriding the location with a subdirectory such as /tmp/orders/output. The target is further defined to select a compression level. Figure 9-3 provides details.

After deployment, files that adhere to the pattern of Orders*.xml in /orders are written to /tmp/orders in compressed format. The Oracle Managed File Transfer Console in Figure 9-4 shows the transfer results.

9.2.2 Creating a SOA Composite Application with an MFT Service

Company X creates a SOA composite named MFTProcessor and an empty BPEL process by selecting Define Service Later in the Create BPEL Process dialog. In the SOA Composite Editor, Company X creates an Oracle MFT service by dragging an MFT icon from the Technology section of the Components window into the Exposed Services swimlane of the composite. The Oracle MFT service is designed to dynamically decide based on file size whether to pass file content inline or by reference. After configuration is complete, the service is wired to the composite, as shown in Figure 9-5.

Figure 9-5 Oracle MFT Service Connected to a BPEL Process

Description of Figure 9-5 follows
Description of "Figure 9-5 Oracle MFT Service Connected to a BPEL Process"

To complete configuration, Company X adds and configures the necessary activities in the MFTBPELProcess BPEL process:

  • A receive activity is invoked by the Oracle MFT service and is configured with an input variable.

  • An assign activity sends the payload type as a response.

  • A reply activity returns an output variable to the Oracle MFT service.

When complete, BPEL process design looks as shown in Figure 9-6.

Figure 9-6 BPEL Process with MFT Service

Description of Figure 9-6 follows
Description of "Figure 9-6 BPEL Process with MFT Service"

The composite is deployed and verified in Oracle Enterprise Manager Fusion Middleware Control.

9.2.3 Sending the Order File to a SOA Composite

Company X creates an additional Oracle MFT target to invoke the deployed MFTProcessor composite. Company X copies the endpoint URL of the MFTProcessor composite from the Test Web Service page in Oracle Enterprise Manager Fusion Middleware Control. Figure 9-7 provides details.

Figure 9-7 Copy of Endpoint URL of the Deployed Composite

Description of Figure 9-7 follows
Description of "Figure 9-7 Copy of Endpoint URL of the Deployed Composite"

In the Oracle Managed File Transfer Console, Company X creates an OrdersSOATarget target with the URL of the composite copied from the Test Web Service page and selects inline attachment as the file delivery method. Figure 9-8 provides details.

After redeployment, files that adhere to the pattern of Orders*.xml in the /orders directory are transferred to the /tmp/orders directory. The Oracle Managed File Transfer Console shows the transfer results in Figure 9-9. The OrdersSOATarget target is displayed along with the previously created source OrdersFileTarget.

The View Payload link in the audit trail of the business flow instance of the composite in Oracle Enterprise Manager Fusion Middleware Control shows that the file was sent as an FTP reference pointing back to the Oracle MFT embedded FTP server. Figure 9-10 provides details.

9.2.4 Processing Payload Types

Company X adds an if activity to the BPEL process of the MFTProcessor composite. Each if activity branch defines an XPath expression for processing a different type of payload that Oracle MFT sends to a SOA composite and implements inline processing to call the ProcessOrder service created in Creating an Order Processing System. Figure 9-11 provides details.

Figure 9-11 If Activity Branches

Description of Figure 9-11 follows
Description of "Figure 9-11 If Activity Branches"

The branches are defined as follows:

  • FtpRefFile: Passes a file by reference. The file is transferred using FTP. This branch uses an XPath expression of xp20:compare($PayloadType,'FtpRefFile') = 0.

  • FtpRefDir: Passes a directory of files by reference. The directory of files is transferred using FTP. This branch uses an XPath expression of xp20:compare($PayloadType,'FtpRefDir') = 0.

  • FileRefFile: Passes a file by reference. The file is passed requiring special handling using a file adapter. This branch uses an XPath expression of xp20:compare($PayloadType,'FileRefFile') = 0.

  • FileRefDir: Passes a directory of files by reference. A directory of files is passed requiring special handling using a file adapter. This branch uses an XPath expression of xp20:compare($PayloadType,'FileRefDir') = 0.

  • InlineBinary: Passes a binary file inline. This branch uses an XPath expression of xp20:compare($PayloadType,'InlineBinary') = 0.

  • InlineXML: Passes an XML file inline. Because this is the else branch, no expression is required.

After redeployment, the audit trail of the business flow instance shows two order files (OrderSample.xml and OrderSampleLarge.xml). Each file takes a different path in the SOA BPEL process based on the XPath expression in the if branch. Figure 9-12 provides details.

In the Trace table of the Flow Trace page, there is a link next to the Managed File Transfer name that takes you to the Oracle Managed File Transfer Console. Figure 9-13 provides details.

Figure 9-13 Link to Oracle Managed File Transfer Console

Description of Figure 9-13 follows
Description of "Figure 9-13 Link to Oracle Managed File Transfer Console"

9.2.5 Invoking the ProcessOrder Composite with an Inline Payload

Company X drags a SOAP icon from the Technology section of the Components window into the External References swimlane of the MFTProcessor composite. The SOAP service reference is configured to invoke the ProcessOrder endpoint. Figure 9-14 provides details.

After SOAP configuration is complete, Company X adds and configures the necessary activities in the BPEL process:

  • An invoke activity is added to the else part of the if activity to invoke the web service. Input and output variables are created.

  • An assign activity maps the MFT service input payload to the ProcessOrder input variable.

After redeployment, the OrdersSample.xml file is placed in /orders and transferred to /tmp/orders. The Oracle Managed File Transfer Console shows the transfer results in Figure 9-15.

The audit trail shows the ProcessOrder composite was invoked and the order was processed. Figure 9-16 provides details.

9.3 Related Documentation

Table 9-2 provides references to documentation that more specifically describes the features described in this chapter.

Table 9-2 Related Documentation

For Information About... See...

Key Oracle MFT concepts

"Understanding Oracle Managed File Transfer" of Using Oracle Managed File Transfer

Oracle MFT transfers, targets, and sources

"Designing Artifacts: Transfers, Sources, and Targets" of Using Oracle Managed File Transfer