About Me
Facebook
Facebook
Linked In
Linked In
Twitter
Twitter
YouTube
YouTube
Google +
Google +

Tuesday, July 23, 2013

Hello World Sample using WID & WPS

Introduction:
This sample shows the basic steps of business process development with WebSphere® Integration Developer. The sample covers everything you need to develop, test and run a simple business process including:
                Creating business processes from scratch, implementing snippet activities, testing business processes in the integrated test environment, installing business processes to WebSphere Process Server.
 Overview:
            Here are we are going to develop.
  • A WSDL interface file
  • A BPEL file

WSDL interface

                The WSDL interface exposes the process' functionality, enabling clients to interact with the business process. It contains an operation and describes the in/output for that operation. In this sample, we are going to develop a simple WSDL file with single operation using WebSphere® Integration Developer.

BPEL process

                The BPEL file describes the control flow and the activities that make up the business process. Furthermore, it defines variables that hold the data used throughout the business process and so-called "partner links" that represent entities such as process clients and other services with which the BPEL process interacts.
                We can develop the process two ways, micro flow and long running Process. If the process is a micro flow; this means that all activities in the process are executed in single transaction. The process is transient, no database interaction or messaging system is involved in the execution of this process. Only the process template is stored in the Process Choreographer database and read once before a process instance is started. If the process is a Long running, this means that all activities in the process can executed in multiple transaction. The process is non-transient, database interaction or messaging system is involved in the execution of this process.
                In this sample we are going to develop micro flow as because it has single transaction. Here the process will take request, append with hello and it will produce the response.
Implementation:
To implement hello world sample, follow these steps:
  • Create a new module.
  • Create an Interface.
  • Create the business process (BPEL).
  • Implement the Business Process (BPEL).
  • Assemble the SCA module.

Create a new module

To create the Hello World module, complete the following steps:
  1. In the Business Integration view, Right click on Projects and select New > Module.
  1. Give module Name as “EAI_HelloWorld” select ‘Use default location’ and ‘Open the module assembly diagram’ then click on finish.

Create an Interface

                Right click on Interfaces under “EAI_HelloWorld”, select New à Interface.

Give the name as “HelloWorldInterface” then click on finish.

Click on ‘Add Request and Response Operation’ in Interface editor. 
Give Operation Name as “helloWorld”, Inputs as “Request” type “String” and Outputs as “Response” type “String” then save.
Create the Business Process (BPEL)
Right click on Integration Logic under “EAI_HelloWorld”, select New àBusiness Process.
      Give name as “BP_HelloWorld” then click on next.
Select microFlow, and then click on next.
Select and Interface radio button, browse the ‘HelloWorldInterface’ Interface, select ‘helloWorld’ operation name and then click on finish.
So now our initial Business process is look like below.

Implement the Business Process (BPEL)

                Now we are going to implement our logic here for produce response as request along with Hello.
Drag and drop the snippet activity and rename it as ‘Logic’ from Basic Activities to pallet between Receive and Reply activity.
Now we need to write a java code for print request, response variables data and assign data to response variable.
                Select Logic snippet, go to properties à Details, select Java radio button and write the code as shown below.
Assembly the SCA Module
Now we need to assembly our SCA module.
Double click on Assembly Diagram under ‘EAI_HelloWorld’. It will open our Assembly diagram Editor.
Drag and Drop BP_HelloWorld Business process from EAI_HelloWorld to our Assembly diagram.
Now we need export as a web Services for communicated our BPEL from any external services.
Right click on ‘BP_HelloWorld’ in assembly diagram select Generate Export à Web Service Binding.
Select SOAP1.1/HTTP using JAX-RPC and then click on finish.
Finally our HelloWorld application is built successfully. The Assembly diagram is look like below, save the application.

Testing:
          Before going to test our application we need to install into WPS.
Deploy using WID:
Click on Servers tab on below of WID. If WebSphere Process Server v7.0 is stopped, start by right click on WebSphere Process Server v7.0 and select Start.
Once the WebSphere Process Server started, Right click on server and select ‘Add or Remove Projects.’
Select ‘EAI_HelloWorld’ click on Add then it will move into Configured projects and then click on Finish.
So now it will be published into WebSphere Process Server.
So now we are ready to test our HelloWorld Application.
Double click on Assembly diagram, then Right click on ‘BP_HelloWorld’ select ’Test Component’.
Now Integrated Test client window will open, Give Request as Your name (Ameer Basha) then click on Continuebutton at left corner Green Button. Please look in to the following screen shot for conformation all components.
Now you select ‘WebSphere Process Sever V7.0’ as your deployment location then click on finish.
Give user name and Password as ‘admin’ then click on Ok.
Now you check for successfully completion of your test. The Response is ‘Hello Ameer Basha’ as shown below, and check the logs at Console view. Check the flow of BP_HelloWorld in Integrated Test Client for detail steps.
Conclusion:
          In this article we learnt how to implement wsdl and BPEL. This is the simple and basic for learning WebSphere Integration Developer and WebSphere Process Server. Here we learnt about short running process implementation and testing using WID. We will see more examples in coming articles.
Downloads:
File Name
Description
  Size
Download
HelloWorldSample.pdf
Hello World Sample Using WID & WPS
675 KB
EAI_HelloWorld.zip
Hello World Sample Code
11 KB


0 comments :

Post a Comment

Designed By AMEER BASHA G