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

The prjBatch_Inbound_FTPIn_LocalFileOut Sample Project

This topic describes how to create the Batch_FTPIn_LFOut_Sample Project.

To Create a Project

  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, CAPS Repository-Based Project from the Projects column, and click Next.
  4. In Step 2 of the Wizard, specify your Project Name (for this Project, use prjBatch_Inbound_FTPIn_LocalFileOut), and click Finish.

Creating the Java Collaboration Definitions

Next, you create the jcdBatch_Inbound_FTPIn_LocalFileOut Collaboration Definition. A Java Collaboration Definition contains Business Rules that define the processing and transport of data between the Enterprise Service Bus components. The Java Collaboration Definition Wizard is used to create the Java Collaboration Definitions. Once a Collaboration is created, the Collaboration Editor is used to create the Business Rules of the Collaboration.

Creating the jcdBatch_Inbound_FTPIn_LocalFileOut Collaboration

The jcdBatch_Inbound_FTPIn_LocalFileOut Collaboration defines how data is transferred between the BatchInbound application, the BatchFTP application, and Outbound BatchLocalFile.

To Create the jcdBatch_Inbound_FTPIn_LocalFileOut Collaboration

  1. From the Projects window, right-click prjBatch_Inbound_FTPIn_LocalFileOut and Select New⇒Collaboration Definition (Java) from the context menu.

    The Collaboration Definition Wizard (Java) appears.

  2. Enter a Collaboration Definition name (for this Project, use jcdBatch_Inbound_FTPIn_LocalFileOut) .
  3. Under Web Service Type, select Existing: Implement an existing Web Service operation.
  4. Click Next.
  5. For Step 2 of the Wizard, select the Web Service operation to implement. From the select Web Service operation selection window, double-click CAPS Components Library⇒Adapters⇒BatcheWay⇒BatchLocalFile⇒receive.
  6. Click Next.
  7. For Step 3 of the Wizard, from the Select OTDs selection window, double-click CAPS Components Library⇒Adapters⇒BatcheWay⇒BatchFTP.

    The BatchFTP OTD is added to the Selected OTDs field.

  8. From the Select OTDs selection window, double-click CAPS Components Library⇒Adapters⇒BatcheWay⇒BatchLocalFile.

    The BatchLocalFile OTD is added to the Selected OTDs field.


    image:Image shows the Collaboration Definition Wizard (Java) as described in context
  9. Click Finish.

    The new jcdBatch_Inbound_FTPIn_LocalFileOut Collaboration appears in the Project tree.

Using the Java Collaboration Editor

The prjBatch_Inbound_FTPIn_LocalFileOut Project uses the jcdBatch_Inbound_FTPIn_LocalFileOut Collaboration you created in the previous topic. To complete the Collaboration, use the Java Collaboration Editor to create the Business Rules.

To Create the jcdBatch_Inbound_FTPIn_LocalFileOut Collaboration Business Rules

Be careful to open all nodes specified in the directions to connect the correct items.

  1. From the Projects window, double-click jcdBatch_Inbound_FTPIn_LocalFileOut.

    The Java Collaboration Editor opens to the jcdBatch_Inbound_FTPIn_LocalFileOut Collaboration.

  2. To create comments for the Business Rules, from the Business Rules toolbar, click the Comment icon.

    The Enter a Comment dialog box appears. The comment is placed on the Business Rules tree under the last selected item.

  3. Enter the comment and click OK.

    Once the comment is created, you can move it by clicking the comment and dragging it up or down the Business Rules tree to a new location.

  4. Create the BatchFTP_1.Client.get rule:

    The BatchFTP_1.Client.get rule gets the file from the FTP Client.

    1. Right-click Client under the BatchFTP_1 node in the left pane of the Business Rules Designer, and choose Select Method to Call from the context menu.

      The method selection window appears.

    2. Select get from the method selection window.

      The get method box appears in the Business Rules Designer canvas.

  5. Create the Copy BatchFTP_1.Client.Payload to BatchLocalFile_1.Client.Payload rule:

    The Copy BatchFTP_1.Client.Payload to BatchLocalFile_1.Client.Payload rule writes the contents of the retrieved file to the payload of the BatchLocalFile.

    1. Click rule on the Business Rules toolbar to add a new rule in the Business Rules pane.
    2. Right-click Client under BatchLocalFile_1 in the left pane of the Business Rules Designer and choose Select Method to Call from the popup menu, and select setPayload(byte[] arg0)from the select method box.

      The setPaylod method box appears.

    3. Map Payload under BatchFTP_1 ⇒ Client in the left pane of the Business Rules Designer, to the arg0 (byte[]) input node of the setPayload method box. To do this, click Payload under BatchFTP_1 ⇒ Client in the left pane of the Business Rules Designer, and drag your cursor to the arg0 (byte[]) input node of the setPayload method box.

    image:Image shows the Copy BatchFTP_1.Client.Payload to BatchLocalFile_1.Client.Payload rule in the Business Rules Designer
  6. Create the Copy input.GUIDFileName to BatchFTP_1.Configuration.TargetFileName rule:

    The Copy input.GUIDFileName to BatchLocalFile_1.Configuration.TargetFileName rule gives a GUID to the target file, BatchLocalFile Adapter.

    1. Click rule on the Business Rules toolbar to add a new rule in the Business Rules pane.
    2. Right-click Configuration under BatchLocalFile_1 in the left pane of the Business Rules Designer and choose Select Method to Call from the popup menu.
    3. Double-click setTargetFileName(String arg0)from the select method box.

      The setTargetFileName method box appears.

    4. Map GUIDFileName under input in the left pane of the Business Rules Designer, to the String arg0 input node of the setTargetFileName method box.

    image:Image shows the Copy input.GUIDFileName to BatchFTP_1.Configuration.TargetFileName rule in the Business Rules Designer
  7. Create the BatchLocalFile_1.Client.put rule:

    The BatchLocalFile_1.Client.put rule publishes the file to a local directory.

    1. Click rule on the Business Rules toolbar to add a new rule in the Business Rules pane.
    2. Under the BatchLocalFile_1 node in the left pane of the Business Rules Designer, right-click Client, and choose Select method to call from the context menu.

      The method selection window appears.

    3. Select put() from the method selection window.

      The put method box appears in the Business Rules Designer canvas.

  8. From the editor’s toolbar, click Validate to check the Collaboration for errors.
  9. Save the Project.

Creating a Connectivity Map

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

To Create a Connectivity Map

  1. In the Projects window, right-click prjBatch_Inbound_FTPIn_LocalFileOut and select New ⇒ Connectivity Mapfrom the context menu.

    The new Connectivity Map appears and adds a node on the Project tree labeled CMap1.

  2. Rename the CMap1 Connectivity Map to cmBatch_Inbound_FTPIn_LocalFileOut.

To Generate the Connectivity Map

Once your Java Collaboration Definition is completed you can use it to generate your Connectivity Map. Generating the Connectivity Map will automatically populate the canvas with the correct components and bind the components according to the information provided by the Java Collaboration Definition.

  1. Drag and drop the jcdBatch_Inbound_FTPIn_LocalFileOut Java Collaboration Definition from the Project window to the Connectivity Map canvas.

    The cmBatch_Inbound_FTPIn_LocalFileOut_jcdBatch_Inbound_FTPIn_LocalFileOut1 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 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. In the Projects window, click the Services tab.
  2. In the Services tree, right-click CAPS Environments and select New Environment.

    A new Environment is added to the Services tree.

  3. Rename the new Environment to envBatch_Inbound_FTPIn_LocalFileOut.
  4. Right-click envBatch_Inbound_FTPIn_LocalFileOut 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 LogicalHost1 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 envBatch_Inbound_FTPIn_LocalFileOut Environment in the Services window
  12. Save the Project.

Configuring the Adapters Properties

The prjBatch_Inbound_FTPIn_LocalFileOut 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 Enterprise Service Bus system.

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 Project.

Configuring the BatchFTP Adapter Properties

Perform the following steps to configure the Batch Adapters and create the deployment profile:

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.
    BatchFTP Adapter Connectivity Map Properties
    Target Location - Set as directed, otherwise use the default settings
    Target Directory Name
    Batch51
    Target File Name
    BatchFTPIn.txt

To Modify the BatchFTP Adapter Properties

  1. From the Services tree, right-click the BatchFTP External System (In this Project, esBatchFTP ), 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 Properties
    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

To Configure the BatchLocalFile Adapter Properties

  1. 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
    Target File Name
    dummy (this name is overwritten with the GUID file name in the Java Collaboration)
    Target Directory Name
    X:/Batch51 (where X is your target drive)

To Create the Deployment Profile

A Deployment Profile is used to assign Collaborations and message destinations to the Application Server and message server. Deployment Profiles are created using the Deployment Editor.

  1. From the Projects window, right-click the Project (prjBatch_Inbound_FTPIn_LocalFileOut) and select New⇒Deployment Profile.
  2. Enter a name for the Deployment Profile (for this Project, use dpBatch_Inbound_FTPIn_LocalFileOut).

    Make sure that the selected Environment is envBatch_Inbound_FTPIn_LocalFileOut.

  3. Click OK.
  4. Click Automap.
    image:Image shows the Environment Editor prior to using the Automap function

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


    Note - If any of your Project components do 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.

  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

To run your deployed sample Project do the following

  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.

    Note - For UNIX, be sure to upload the appropriate LogicalHost.