JavaScript is required to for searching.
Skip Navigation Links
Exit Print View
Oracle Java CAPS Adapter for Batch Tutorial     Java CAPS Documentation
search filter icon
search icon

Document Information

Oracle Java CAPS Adapter for Batch Tutorial

Importing Non-JBI Based Sample Projects

To Import a Non-JBI Based Sample Project

About the Oracle Java CAPS Business Process Manager Sample Project

Associating BPM Operators

Considerations for BPM Projects

Creating the bpBatch_Inbound_LocalFileIn_FTPOut Project

To Create a Project

Creating the bpBatch_Inbound_LocalFileIn_FTPOut Business Process

To Create the Business Process

Adding Business Rules to the Design Elements

To Create a Connectivity Map

To Generate the Connectivity Map

Creating an Environment

To Create an Environment

Configuring the Adapters' Properties

To Configure the BatchInbound Adapter Properties

To Configure the BatchLocalFile Adapter Properties

Configuring the BatchFTP Adapter Properties

Creating the Deployment Profile

To Create the Deployment Profile

Building and Deploying the Project

To Build the Project

To Deploy the Project

To Run the Sample

About the JCD Sample Projects

prjBatch_Inbound_FTPIn_LocalFileOut

prjBatch_Streaming

prjBatch_Record

prjBatch_Secure

JCD Components

Considerations for JCD Projects

The Adapter for Batch JCD Sample Projects

The prjBatch_Inbound_FTPIn_LocalFileOut Sample Project

To Create a Project

Creating the Java Collaboration Definitions

Creating the jcdBatch_Inbound_FTPIn_LocalFileOut Collaboration

To Create the jcdBatch_Inbound_FTPIn_LocalFileOut Collaboration

Using the Java Collaboration Editor

To Create the jcdBatch_Inbound_FTPIn_LocalFileOut Collaboration Business Rules

Creating a Connectivity Map

To Create a Connectivity Map

To Generate the Connectivity Map

Creating an Environment

To Create an Environment

Configuring the Adapters Properties

To Configure the BatchInbound Adapter Properties

Configuring the BatchFTP Adapter Properties

Building and Deploying the Project

To Build the Project

To Deploy the Project

To Run the Sample

The prjBatch_Streaming Sample Project

To Create a Project

Creating a Java Collaboration Definition

To Create the jcdBatch_Streaming Collaboration

Using the Java Collaboration Editor

To Create the jcdBatch_Streaming Collaboration Business Rules

To Create a Connectivity Map

To Generate the Connectivity Map

To Create an Environment

Configuring the Adapter Properties

To Configure the BatchInbound Adapter Properties

Configuring the BatchFTP Adapter Properties

Configuring the File Adapter Properties

Building and Deploying the Project

To Build the Project

To Deploy the Project

To Run the Sample

The prjBatch_Record Sample Project

To Create a Project

Creating a Java Collaboration Definition

To Create the jcdBatch_Record Collaboration

Using the Java Collaboration Editor

To Create the jcdBatch_Record Collaboration Business Rules

To Create a Connectivity Map

To Generate the Connectivity Map

To Create an Environment

Configuring the Adapter Properties

To Configure File Adapter Connectivity Map Properties

To Modify the File Adapter Environment properties

To Configure the BatchRecord Adapter Properties

To Modify the BatchRecordParse Adapter Connectivity Map properties

To Modify the BatchRecord Adapter Environment properties

To Create the Deployment Profile

Building and Deploying the Project

To Build the Project

To Deploy the Project

To Run the Sample

The prjBatch_Secure Project

The prjBatch_Secure Project Components

The prjBatch_Secure Project Collaboration Definitions

To Create the jcdBatchFTPOverSSL Java Collaboration

To Create the jcdBatchSCP Java Collaboration

To Create the jcdBatchSFTP Java Collaboration

Collaboration Business Rules

jcdBatchFTPOverSSL Business Rules

jcdBatchFTPOverSSL Java Source File

jcdBatchSCP Business Rules

jcdBatchSCP Java Source File

jcdBatchSFTP Business Rules

jcdBatchSFTP Java Source File

Completing the prjBatch_Secure Project

To Create an Environment

Configuring the Adapter Properties

To Configure the File Adapter Connectivity Map properties

To Modify the File Adapter Environment properties

To Modify the Batch/FTP Adapter Connectivity Map Properties

To Modify the BatchFTPoverSSL Adapter Environment Properties

To Create the Sample Directories

To Create the Deployment Profile

Building and Deploying the Project

To Build the Project

To Deploy the Project

To Run the Sample

Creating the bpBatch_Inbound_LocalFileIn_FTPOut Project

These following topics provide step-by-step instructions for manually creating the bpBatch_Inbound_LocalFileIn_FTPOut Project.

This topic describes how manually create the bpBatch_Inbound_LocalFileIn_FTPOut Project.

To Create a Project

The first step is to create a new Project in the NetBeans IDE

  1. Start the NetBeans IDE.
  2. Click the New Project icon, or select File ⇒ New Project to initiate the New Project wizard.
  3. In Step 1 of the Wizard, select CAPS ⇒ ESB from the Categories column and then select CAPS Repository-Based Project from the Projects column. Click Next.
  4. In Step 2 of the Wizard, change the Project Name to prjBatch_Inbound_LocalFileIn_FTPOut, and click Finish.

Creating the bpBatch_Inbound_LocalFileIn_FTPOut Business Process

Do the following to create the Business Process:

To Create the Business Process

The first step in the sample process is to add a Business Process to the Project.

  1. From the Projects window, right-click brjBatch_Inbound_LocalFileIn_FTPOut.
  2. Select New⇒Business Process from the context menu.
  3. Rename the Business Process to bpBatch_Inbound_LocalFileIn_FTPOut, and click Save.
  4. In the Projects window, expand the CAPS Components Library, expand Adapters, and then expand Batch eWay.
  5. Expand the BatchInbound, and BatchLocalFileBatchFTP nodes to expose the Business Process elements.
  6. Populate the design canvas with the following elements from the Project tree.
    • Under BatchInbound, add receive

    • Under BatchLocalFile, add read

    • Under BatchFTP, addput

  7. To link the modeling elements, click the element’s connector and drag it to the next element’s connector, as follows:
    • StartBatchInbound.receive

    • BatchInbound.receiveBatchLocalFile.read

    • BatchLocalFile.readBatchFTP.put

    • BatchFTP.putEnd


    image:Image shows the connected BPEL elements as described in context

Adding Business Rules to the Design Elements

Business Rules define the relationship between the input and output Attributes of the elements.

To Add Business Rules

  1. Right-click the link between BatchInbound.receive and BatchLocalFile.read Activities and select Add Business Rule from the context menu.
    image:Image shows the Add Business Rule option in the link between the BPEL elements
  2. From the Business Process Designer toolbar, click the Display Business Rules Designer icon.

    The Business Rule Designer opens in the lower half of the Business Process Designer window.

  3. Click the Business Rule icon between the BatchInbound.receive and BatchLocalFile.read Activities.

    The Business Rule Attributes appear in the Business Rule Designer.

  4. To create the BatchInbound.receive⇒BatchLocalFile.read Business Rule, in the Business Rules Designer, click GUIDFileName and drag it to targetFileName.

    A link appears between the two nodes.


    image:Image shows the BatchInbound.receive to BatchLocalFile.read business rule
  5. Right-click the link between the BatchLocalFile.read and BatchFTP.put Activities, and select Add Business Rule from the context menu.
  6. Double-click the new Business Rule.
  7. From the Business Rule Designer, under BatchLocalFile.read.Output, map payload in the Output pane to payload under BatchFTP.put.Input in the Input pane.
    image:Image shows the BatchLocalFile.read to BatchFTP.put business rule
  8. From the Business Process Designer toolbar, click the Synchronize Graphical Model and Business Process Code icon.

    This synchronizes the graphical interface to the Business Process code.

  9. Click Save All.

To Create a Connectivity Map

The Connectivity Map provides a canvas for assembling and configuring a Project’s components.

  1. In the Projects window, right-click the prjBatch_Inbound_LocalFileIn_FTPOut Project and select New⇒Connectivity Map from the context menu.

    The New Connectivity Map appears and a node for the Connectivity Map is added to the Project tree labeled CMap1.

  2. Rename the CMap1 Connectivity Map to cmBatch_Inbound_LocalFileIn_FTPOut.

To Generate the Connectivity Map

Once your BPEL process is completed you can use it to generate your Connectivity Map.

  1. Drag and drop the bpBatch_Inbound_LocalFileIn_FTPOut bpel process from the Project window to the Connectivity Map canvas.

    The cmBatch_Inbound_FTPIn_LocalFileOut_bpBatch_Inbound_LocalFileIn_FTPOut1 service is added to the canvas.

  2. Click the Connectivity Map Generator icon. The Connectivity Map Generator dialog box appears listing the necessary components and bindings to generate the Connectivity Map. Click OK.
    image:Image shows the Connectivity Map Generator icon and dialog box

    The External applications are added to the Connectivity Map and the Bindings are created. The red squares in the bindings represent the Batch Adapters. The red color indicates that the adapter properties have not been configured.


    image:Image shows the generated Connectivity Map
  3. Save your current work.

Creating an Environment

Environments include the External Systems, Logical Hosts, Application Servers, and Message Servers used by the Project and contain the configuration information for these components.

To Create an Environment

  1. Click the Services tab.
  2. In the Services tree, right-click CAPS Environments, and click New Environment.

    A new Environment is added to the Services tree.

  3. Rename the new Environment to envBatch_Inbound_LocalFileIn_FTPOut.
  4. Right-click envBatch_Inbound_LocalFileIn_FTPOut and select New ⇒ BatchInbound External System.
  5. Name the External System esBatchInbound and click OK.

    The esBatchInbound box is added to the Environment Editor.

  6. Right-click envBatch_Inbound_FTPIn_LocalFileOut and select New ⇒ BatchFTP External System.
  7. Name the External System esBatchFTP and click OK.

    The esBatchFTP box is added to the Environment Editor.

  8. Right-click envBatch_Inbound_FTPIn_LocalFileOut and select New ⇒ BatchLocalFile External System.
  9. Name the External System esBatchLocalFile and click OK.

    The esBatchLocalFile box is added to the Environment Editor.

  10. Right-click envBatch_Inbound_FTPIn_LocalFileOut and select New ⇒ Logical Host.

    The LogicalHost icon is added to the Environment and LogicalHost1 is added to the tree.

  11. Right-click LogicalHost1 and select New ⇒ Sun Java System Application Server.

    A new Application Service is added to the tree under LogicalHost1.


    image:Image shows the new Environment as described in context.
  12. Save the Project.

Configuring the Adapters' Properties

The prjBatch_Inbound_LocalFileIn_FTPOut sample project contains three Adapters, each represented in the Connectivity Map as a node between an External Application and a Collaboration. The Adapters facilitate communication and movement of data between the external applications and the Oracle Java CAPS Enterprise Service Bus.

The Adapter properties must be set from both the Connectivity Map and the Java CAPS Environment.

To Configure the BatchInbound Adapter Properties

  1. From the Connectivity Map, double-click the BatchInbound Adapter.

    The Adapter Properties Editor appears.

  2. Modify the properties for your system, including the settings for the BatchInbound Adapter in the following table, and click OK.
    BatchInbound Adapter Connectivity Map Properties
    Settings - Set as directed, otherwise use the default settings
    Directory Name
    Your input directory (full address)
    File Name
    BatchInbound.txt

    The BatchInbound Adapter Environment properties can keep the default settings for this sample.

To Configure the BatchLocalFile Adapter Properties

  1. From the Connectivity Map, double-click the BatchLocalFile Adapter.

    The Adapter Properties Editor appears.

  2. Modify the properties for your system, including the settings in the following table, and click OK.
    BatchLocalFile Adapter Properties
    Target Location - Set as directed, otherwise use the default settings
    Append
    Yes
    Target File Name
    BatchLocalFileOut.txt
    Target File Name is Pattern
    No
    Target Directory Name
    The directory on the system where files are sent.
    Target Directory Name is Pattern
    No
  3. To refresh and save your default BatchLocalFile Adapter properties, double-click the BatchLocalFile External System in the Services tree to open the Properties Editor.
  4. Click OK to save the default settings.

Configuring the BatchFTP Adapter Properties

To Modify the BatchFTP Adapter Connectivity Map Properties

  1. From the Connectivity Map, double-click the BatchFTP Adapter.

    The Adapter Properties Editor appears.

  2. Modify the BatchFTP Adapter Connectivity Map properties for your system, including the settings in the following table, and click OK.
    BatchLocalFile Adapter Properties
    Target location - Set as directed, otherwise use the default settings
    Target Directory Name
    The directory on the external system (absolute path) from which files are retrieved or sent
    Target File Name
    The FTP remote file name which is retrieved or sent

To Modify the BatchFTP Adapter Properties

  1. From the Services tree, right-click the BatchFTP External System (esBatchFTP in this sample), and select Properties.

    The Properties Editor opens to the BatchFTP Adapter Environment properties.

  2. Modify the BatchFTP Adapter Environment properties for your system, including the settings in the following table, and click OK.
    BatchFTP Adapter Environment-Configuration Parameters
    Target location - Set as directed, otherwise use the default settings
    FTP
    Set as directed, otherwise use the default settings.
    Host Name
    The name of the external system to which the Adapter connects.
    Password
    Password required to log into the external system.
    Server Port
    Port number to use to connect to the FTP server.
    User Name
    User ID used to login to the external system.

Creating the Deployment Profile

A Deployment Profile is used to assign Collaborations and message destinations to the Application Server and message server.

To Create the Deployment Profile

  1. Select the Projects tab, right-click the Project (prjBatch_Inbound_LocalFileIn_FTPOut) and select New⇒Deployment Profile.
  2. Enter a name for the Deployment Profile.

    For this Project, use dpBatch_Inbound_LocalFileIn_FTPOut . Make sure that the selected Environment is envBatch_Inbound_LocalFileIn_FTPOut.

  3. Click OK.
  4. Click Automap.

    The Project’s components are automatically mapped to their respective system windows.


    Note - If any of your Project components did not successfully map to an external system, open each of your Adapter’s configuration properties (Connectivity Map and Environment) and click OK to close and save the current configuration, then click Automap again.


  5. Save the Project.

Building and Deploying the Project

The Build process compiles and validates the Project’s Java files and creates the Project EAR file.

To Build the Project

  1. From the Deployment Editor toolbar, click the Build icon.

    If there are any validation errors, a Validation Errors pane will appear at the bottom of the Deployment Editor and displays information regarding the errors.

  2. Make any necessary corrections and click Build again.

To Deploy the Project

Before You Begin

Make sure the GlassFish server is started. To start the server from NetBeans, click the Servers tab, expand Servers, right-click the GlassFish server, and then click Start.

  1. From the Deployment Editor toolbar, click the Deploy icon.

    The Deploy prompt appears.

  2. Click Yes.

    A message appears when the project is successfully deployed.

To Run the Sample

  1. From your configured input directory, paste (or rename) the sample input file to trigger the Adapter.
  2. From your output directory, verify the output data.