This documentation is for WSO2 Enterprise Integrator version 6.4.0 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.
Echoing a Message Using a Simple BPEL Process - WSO2 Enterprise Integrator 6.4.0 - WSO2 Documentation

All docs This doc
||
Skip to end of metadata
Go to start of metadata

This tutorial guides you on how to create a BPEL process and to assign a value in the request to the response using the WSO2 Enterprise Integrator (WSO2 EI) Tooling. 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,

  • Install Oracle Java SE Development Kit (JDK) version 1.8.* and set the JAVA_HOME environment variable.
  • 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:
    OSHome directory
    Mac OS/Library/WSO2/EnterpriseIntegrator/6.4.0
    WindowsC:\Program Files\WSO2\EnterpriseIntegrator\6.4.0\
    Ubuntu/usr/lib/wso2/EnterpriseIntegrator/6.4.0
    CentOS/usr/lib64/EnterpriseIntegrator/6.4.0
  • Select and download the relevant EI tooling ZIP file based on your operating system from hereand then extract the ZIP file.
    The path to this folder will be referred to as <EI_TOOLING> throughout this tutorial.

This tutorial includes the following sections:

Creating a BPEL Workflow

You will find a BPEL editor packaged along with the WSO2 EI tooling. This BPEL editor can be used to create a BPEL artifact easily.

Prerequisite

 To create a BPEL artifact you should have Eclipse setup with the WSO2 EI tooling pack. For more information, see Installing Enterprise Integrator Tooling.

  1. Start Eclipse and navigate to File → New → Other
  2. Search or scroll and find the BPEL category under the WSO2 folder, click BPEL Workflow, and click Next.
  3. Select Create new BPEL Workflow on the dialog box that appears and click Next
  4. Enter the below details, and specify the Template (asynchronous process or synchronous process), and click Next
  5. Provide the Maven information for the package and click Finish. You will now have a BPEL project according to the details you specified. 
  6. 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 PaletteYou 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.

  1. Right click on the FIX_ME-Add_Business_Logic_Here element, and click Delete to remove it from the default diagram.
  2. 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 

  1. Click on the receiveInput activity and in the Details section of the Properties tab, select client as the Partner Link.
  2. Select Process as the Operation.
  3. 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 

  1. Click on the Assign activity, click Details in the Properties tab, and click New.
  2. In the From: box, expand the input : EchoAsyncProjectRequestMessage drop down and select the input : string option.
  3.  In the To: box, expand the output : EchoAsyncProjectResponseMessage drop down and select the result : string option.
  4. Press Ctrl+S to save the variable mapping.
  5. Click Yes in the message, which pops up to initialize the variables.

Configuring the replyOutput activity 

  1. Click on the replyOutput activity and in the Details section of the Properties tab, select client as the Partner Link.

  2. Select process as the Operation.
    Now, you have completed the process logic. Next, 

  3. 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

  1. Double click on the deploy.xml file in the Project Explorer.
  2. 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.

  1. Open WSO2 EI Tooling and save the BPEL Workflow you created.
  2. 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.


  3. 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.

  1. Start the Business Process profile of WSO2 EI.

    Open a terminal and execute the following command:

    wso2ei-6.4.0-business-process

    Go to Start Menu -> Programs -> WSO2 -> Enterprise Integrator 6.4.0 Business Process. This will open a terminal and start the business process profile.

  2. 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).
  3. 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 Preparing for Process Deployment.

  4. 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.

 Undeploying a BPEL Workflow

There are two ways to undeploy a BPEL Workflow.

  1. From the Management Console of the Business Process profile:
    1. Log in to Management Console, click Main → Manage → Processes →  List →  BPEL.
    2. Click the Package Name you want to undeploy.

    3. The Package Dashboard page appears. Click on the Undeploy link.
  2. By deleting the BPEL ZIP file from the file system. 
    1. Delete the BPEL package from <EI_HOME>/wso2/business-process/repository/deployment/server/bpel directory.

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.

  1. Log in to the Management Console using the admin/admin credentials.
  2. Click Main → Manage → Services →  List, and click the Try this service link of the corresponding service.

  3. In the Request section of the Try It Tool, replace the ? symbol with a preferred text.

  4. Click Send. You view the text you entered in the Request printed in the Response section.

  • No labels