Echoing a Message Using a Simple BPEL Process
This tutorial guides you on how to create a BPEL process and to assign a value in the request to the response using WSO2 Integration Studio. It walks you through the steps to demonstrate how you can assign the input string of the request message to the result string of the response message.
Before you begin,
- Download the product installer from here, and run the installer.
Let's call the installation location of your product the <EI_HOME> directory. This is located in a place specific to your OS as shown below:OS Home directory Mac OS /Library/WSO2/EnterpriseIntegrator/6.6.0
Windows C:\Program Files\WSO2\EnterpriseIntegrator\6.6.0\
Ubuntu /usr/lib/wso2/EnterpriseIntegrator/6.6.0
CentOS /usr/lib64/EnterpriseIntegrator/6.6.0
Select the relevant WSO2 Integration Studio based on your operating system and download it from here.
The path to this folder is referred to as<EI_TOOLING>
throughout this tutorial.Getting an error message? See the troubleshooting tips given under Installing WSO2 Integration Studio.
This tutorial includes the following sections:
Creating a BPEL Workflow
You will find a BPEL editor packaged along with WSO2 Integration Studio. This BPEL editor can be used to create a BPEL artifact easily.
Prerequisite
To create a BPEL artifact, you should first /wiki/spaces/EI6xx/pages/49612293.
- Start Eclipse and navigate to File → New → Other .
- Search or scroll and find the BPEL category under the WSO2 folder, click BPEL Workflow , and click Next .
- Select Create new BPEL Workflow on the dialog box that appears and click Next.
- Enter the below details, and specify the Template (asynchronous process or synchronous process), and click Next.
- Project Name:
EchoAsyncProject
- Process Name:
EchoAsyncProject
- Process Namespace:
http://wso2.org.bps/EchoAsyncProcess
- Template:
Synchronous BPEL Process
- Project Name:
- Provide the Maven information for the package and click Finish. You will now have a BPEL project according to the details you specified.
Click Open Perspective on the below message, which pops up.
You will not get this message if you are already in the BPEL perspective. You can view the current perspective from the below tab.
In the Project Explorer view, you view the BPEL diagram added under the project you specified and the default diagram will open up along with a Palette. You can use the Palette to drag and drop artifact symbols to create the desired diagram.
Creating the artifacts
Follow the steps below to create the required artifacts.
- Right click on the FIX_ME-Add_Business_Logic_Here element, and click Delete to remove it from the default diagram.
Drag and drop an Assign activity to the canvas and place it after the receiveInput activity.
Drag and drop this from the Actions section of the Palette.
Now, you have completed creating the activities of the BPEL workflow.
Configuring the receiveInput activity
- Click on the receiveInput activity and in the Details section of the Properties tab, select
client
as the Partner Link. - Select Process as the Operation.
- In the Quick Pick: box, expand the process → EchoAsyncProjectRequestMessage → payload : EchoAsyncProjectRequest drop down and double click on the input : string option.
Configuring the Assign activity
- Click on the Assign activity, click Details in the Properties tab, and click New.
- In the From: box, expand the input : EchoAsyncProjectRequestMessage drop down and select the input : string option.
- In the To: box, expand the output : EchoAsyncProjectResponseMessage drop down and select the result : string option.
- Press Ctrl+S to save the variable mapping.
- Click Yes in the message, which pops up to initialize the variables.
Configuring the replyOutput activity
Click on the replyOutput activity and in the Details section of the Properties tab, select
client
as the Partner Link.Select process as the Operation.
Now, you have completed the process logic. Next,Double click process in the Quick Pick section to generate the input and output variables for this element.
Setting the port of the Partner Link for deployment
- Double click on the
deploy.xml
file in the Project Explorer. - In the
deploy.xml
file under Inbound Interfaces (Services), click on the value in the Associated Port column and select EchoAsyncProjectPort.
Creating the deployable archive
Follow the instructions below to deploy a BPEL Workflow.
- Open WSO2 Integration Studio and save the BPEL Workflow you created.
Right click on the name of the BPEL Workflow in the Project Explorer window, and click Export project as Deployable Archive .
If you do not have the Project Explorer view, click Window → Show View → Other, select Project Explorer and open it.
- Click Browse, select a location to save the deployable archive file, which will be created, and click Finish.
This creates the ZIP file in the location you specified . This archive file contains of all the artifacts of your BPEL Workflow for you to deploy it in the Business Process profile of WSO2 EI.
Deploying the BPEL Workflow
After creating the deployable archive, follow the steps below to deploy the BPEL Workflow.
Start the Business Process profile of WSO2 EI.
- In a web browser, open the Management Console of the Business Process profile , and log in with the default credentials (username: admin and password: admin ).
Click Main → Manage → Processes → Add → BPEL , browse the ZIP file of the BPEL Workflow and click Upload .
You can find sample BPEL package ZIP files in the
<EI/HOME>/samples/business-process/bpel
directory. Also, instead of using the Management Console, you can deploy a BPEL process manually by creating the<EI_HOME>/repository/deployment/server/bpel
directory, and copying the ZIP file to it. For instructions on preparing the process ZIP file, see /wiki/spaces/EI6xx/pages/49612261 .In the New BPEL Package window, browse and select the BPEL Package ZIP file and click Upload.
You view the deployed BPEL process listed under the Deployed Processes as shown below.
- Package Name: The name of the package containing at least the deployment descriptor and one or more process definitions (BPEL), WSDL and XSDs.
- Process ID: A unique ID to identify the deployed BPEL process.
- Version: If a package with an existing name is uploaded, the processes in the package will be versioned. All old processes in the package will be retired and new version deployed. Since there is only package-level versioning available, the new package should include all the processes defined in the old package, even though you may only need to update a single process in that package.
- Status: Status of the process. Can be either “Active" or “Retired".
- Deployed Date: Date and time of the package deployment.
- Manage: A newly-created process has status as “Active", which can be retired by clicking on the “Retire" link. Once a process is retired, a new instance of it cannot be created.
If you do not view the new process, refresh the browser or click Main → Manage → Processes → List → BPEL .
Testing the output
Once the process is deployed successfully, follow the steps below to use the built-in Tryit Tool to send a request to the process.
- Log in to the Management Console using the
admin/admin
credentials. - Click Main → Manage → Services → List, and c lick the Try this service link of the corresponding service.
- In the Request section of the Try It Tool, replace the ? symbol with a preferred text.
- Click Send. You view the text you entered in the Request printed in the Response section.