Home » OpenESB » OPEN ESB 2.3 Working with FTPBC [Part -2]

OPEN ESB 2.3 Working with FTPBC [Part -2]

TABLE OF CONTENTS

INTRODUCTION

Create New Project

Create a new BPEL module project

Create a new Composite Application

Working With BPEL Module

Create a Local File Poll WSDL to trigger BPEL

Create a FTP WSDL file to put the local file in FTP locaiton

Define Your BPEL Process

Working with Composite Application

Add BPEL Module in Composite Application

Build Composite Application

Deploy the Comp App in Glasshfish server

INTRODUCTION

In previous tutorial, we have discussed about the FTPBC, where we send the text message content in FTP files. This document shows you step by step approach to create a FTPBC application where we can send local file directly in FTP location without writing any single line of code with Logicoy OpenESB 2.3 IDE. Tutorial only explains the basics of creating a new project that uses basic FTPBC functionality. We suppose you already have Logicoy OpenESB IDE on your system. If you have not installed Logicoy OpenESB 2.3, please install using following links.

http://jenkins.logicoy.com /job/openesb-installers/

Get the latest binary as per your system requirement. Follow the OpenESB 2.3 Installation Guide for further installation assistant.

Create New Project

To start, open the Logicoy OpenESB IDE from your installed location.

Create a new BPEL module project.

Select New project from File->New Project

Click Next from the above dialogue box after selecting BPEL Module.

Enter Project Name [FTPBCDemoBPEL_Part2] , select appropriate project location, then click on Finish.

Create a new Composite Application

Select File -> New Project Or Right click on Project Explorer and select New Project

Enter Project Name [FTPBCDemoCompApp_Part2], Click on Finish. You can see now two projects created on project explorer.

Working With BPEL Module

Create a Local File Poll WSDL to trigger BPEL

Step-1 : Create new WSDL Document by right click on Process Files under BPEL Module.

Now enter WSDL name as [processLocalFile], as shown below, Select Concrete WSDL type option button and Select Binding as FILE. We want to poll files from local file location, that’s why select POLL type from below list.

Click Next, to configure FileBC, Give File Name as input%D.xml. This means we can poll files where name starts with input<any digit>.xml [ For example input1.xml, input300.xml…etc ]. Give Polling directory from where we want to poll above files. Leave rest of the details as default for this example.

Click finish to complete the WSDL creation.

Create a FTP WSDL file to put the local file in FTP locaiton

Now we will create FTPWSDL as we did in our previous tutorial with one minor difference. Follow the below steps.

Give WSDL name [putFTPFile], Select FTP Binding, and type as [Put Request Message]. Note that in previous tutorial, we selected binding type as Send Request.

Click Next to enter FTP server detail.

Once the above configuration is done, click next. Now the dialogue box which you are going to see will be different from our previous tutorial. Here we will give the message repository. Message repository is the directory in FTP Server which contains some specific folder for specific requirement. These are described as follows

Directory Description
/inbox This is the default location where the consumer puts the request message and the provider polls for a request message.
/instage This is the default location where the consumer stages a request message before it is completely uploaded.
/inprotect This is the default location where consumer moves an existing request message so that it is not overwritten by current request message.
/inarchive This is the default location where provider archives request message after it is processed.
/outbox This is the default location where the provider puts a response message and the consumer polls for the response message.
/outstage This is the default location where the provider stages the response message before it is completely uploaded.
/outprotect This is the default location where provider moves an existing response message to so that it is not overwritten by current response message.
/outarchive This is the default location where consumer archives response message after it is processed.

Enter Repository name as DEMO_REPO, Message Name nothing but the file name you want to give after copying local file to FTP file.

Click Finish to complete this configuration.

Define Your BPEL Process

Now we will start defining our BPEL process. At first drag the FileBC WSDL file [processLocalFile] in left side of your BPEL process file. Give the partner link name as getLoclFileLink. Grab the Receive component from the palette box.

Double click on Receive to link it with Partner link getLocalFileLink.

Select partner link from the option box, and operation as poll. Create Input Variable PollIn then click ok to finish. Now your BPEL will be triggered when ever matching name file be put in local folder.

Now Grab Assign and Invoke component from palette and keep in your BPEL process, as shown in coming screen shot.

Also Grab the FTP WSDL, we created named putFTPFile.wsdl in right side of BPEL process, Give partner link name as putFtpFileLink

Double click on invoke to link with new FTP partner link.

Select partner link and operation as shown above. Create input variable as OutboundOneWayMessagingOperationIn. Press ok to finish

Now we will assign the required input variable for FTP operation. For this double click in Assign1 activity. You will be shown Mapping view in BPEL process. Just map the PollIn part with OutboundOneWayMessagingOperationIn part as shown in following figure.

Now You are done with defining your BPEL Process.

Working with Composite Application

Expand the FTPBCDemoCompApp Project and open the Service Assembly, There is nothing added for now.

Add BPEL Module in Composite Application

To add the BPEL module here, drag the BPEL Project as shown below.

Now BPEL Module is added in your CompApp.

Build Composite Application

Now build the CompApp project, the file will look like follows.

Deploy the Comp App in Glasshfish server.

To deploy the comp app in glassfish server, select composite application right click and select deploy

To Trigger the BPEL, create new file as input1.xml123. We are creating xml123 extenstion so that there will be enough time for us to edit the content of the file. If you don’t do this, the file will be polled as soon as you create it. Edit the content

<?xml version=”1.0″ encoding=”UTF-8″?>

<message>

<from>Param</from>

<to>public</to>

<body>Hi There, This is just a example, Enjoy working with Logicoy OpenESB 2.3</body>

<date>17 May 2013 14:22:00</date>

</message>

Save it and rename with input1.xml. Now automatically file will be picked up and processed by your service assembly that results new file created in FTP locations.

Click on message repository DEMO_REPO, and select inbox folder. Please note that this repository folder is automatically got created first time. You can see your file inside inbox folder.

Open the file to see the message. Note this message we configured in scheduler BC. This is a simple Text Message, which can be modified anytime, during BPEL Process.

I hope this tutorial will help you to get your understanding with simple FTP Operation with OpenESB 2.3.

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*