OPEN ESB 2.3 Working with FTPBC [Part -1]

 

(Sending text message in ftp files)

INTRODUCTION

This blog shows you step by step approach to create a FTPBC application 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.

clip_image002

Create a new BPEL module project.

Select New project from File->New Project

clip_image004

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

clip_image006

Enter Project Name [FTPBCDemoBPEL] , 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

clip_image008

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

Working With BPEL Module

Create a trigger to start BPEL

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

clip_image009

Now enter WSDL name as [triggerBPEL], as shown below.

clip_image011

Select WSDL type as Concrete WSDL Document, and select Binding as SCHEDULER, and leave default binding type static. Click Next

clip_image013

Now you need to create new trigger. In Scheduler BC, there are two type of trigger, Simple and Cron. Simple trigger executes as per some static time interval, for example after every 5 min / 1 day etc. We just need to give the time interval and repeat value, that specify number of time scheduler will fire. Cron trigger executes in specific time configured in WSDL. For now compare it with the crontab in linux. For example we want to fire trigger in every mid night 1:00 AM. For this project we are going to create Simple trigger. Click on + sign to add simple trigger as shown below.

clip_image015

Enter trigger Name, Description and interval in Seconds, and Message that trigger will send to BPEL module.

clip_image017

Click on finish to complete the WSDL creation.

clip_image019

You can see difference in generated source code of WSDL document. Remember interval we given 5 seconds, that is converted to 5000 milliseconds. As shown below

clip_image021

Create new BPEL process,

Right click on process files and select BPEL process

clip_image023

Enter new BPEL process file name as FTPBCDemo, and click on finish.

Create new FTP WSDL

Here we will create new WSDL document of type FTP as shown below. Select the binding type as Send Request. Click on next

clip_image025

Give the FTP configuration as shown below. Enter FTP host name, FTP user, FTP Password, Leave the document style as UNIX. Click on next

clip_image027

Enter valid Remote file path where message will be written. Select Post send command as Rename, that will move the remote file in other FTP location. Don’t forget to give %u in file name given in location. Also select check box that shows the file name is a pattern file name. %u specifies that the File name will be UUID that will work with JDK 1.5 + versions. Match your entries with following dialogue box.

clip_image029

Click on finish to complete FTP WSDL creation.

Define Your BPEL Process

Now we will start defining our BPEL process. At first drag the triggerBPEL WSDL file in left side of your BPEL process file. Give the partner link name as triggerBPELLink.

clip_image031

Drag Receive operation from palette as shown below.

clip_image033

At first this operation will show error mark because this is not yet join to any partner link.

clip_image035

To remove the error, double click on Receive1 operation.

clip_image036

Select triggerBPELLink from partner Link select box. Select Operation FireTriggerOperation.

clip_image037

Click on create button to create new input variable, that will store the Message send from scheduler. We will use this message to send in FTP files.

clip_image038

As you can see in below dialogue box, Error is gone

clip_image040

Now drag the FTP WSDL, in right hand side of the BPEL process. As shown below. Give the partner link name as invokeFTPLink.

clip_image042

Drag Assign and Invoke Element from the palette.

clip_image044

Double click on Invoke1 element. And select partner Link invokeFTPLink and Operation OutboundOneWayTransferringOperation. Click on create button to create new inputVariable.

clip_image045

Now Double click on Assign1 Element that will open Mapping view in BPEL process. Do the mapping as shown below

clip_image047

Note that all errors should go off and you will see following final BPEL process view.

clip_image049

Working with Composite Application

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

clip_image051

Add BPEL Module in Composite Application

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

clip_image053

Now BPEL Module is added in your CompApp.

clip_image055

Build Composite Application

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

clip_image057

Deploy the Comp App in Glasshfish server.

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

clip_image059

As soon as the project is deployed in Glasshfish server. Scheduler BC fires trigger in every 5 seconds that results new file created in FTP locations in every 5 seconds as shown below.

clip_image061

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.

clip_image062

I hope this tutorial will help you to get start with simple FTP Operation in Logicoy OpenESB 2.3. In Next tutorial I will discuss about FTPBC with the File Operation, where we can send a complete file directly in FTP Message Repository.

This entry was posted in GlassFishESB, Uncategorized, openesb and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply