Sun Adapter for Batch Tutorial

ProcedureTo 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 Project Explorer tree, 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 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 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.